I am sorry for such a question. I solved that with 100%, but cannot see solutions of others.
If I see a specific language, I see grayed out items with lock icons.
How I can see that? I think my solution is very far from the best and want to compare.
At first I put an arbitrary limit of 2000 iterations, that solved the problem, but it didnât let me sleep that night
Then I put on a nice solution: said âaâ the smallest number, you can just stop search as soon as you find âaâ consecutive numbers that are not a solution. This stop the search just when needed, no computation waste at all. Pretty satisfied now
If you solved it in javascript, you will see other javascript solutions; if you solved it in python3, you will see other python3 solutions.
If you solved it in a less common language and you are the first one to use it, youâll see your own code only before another same language solution appears.
I could never get my original algorithm to pass validator 8, no matter how I tried to tweak its magic numbers, so I went back to the drawing board and came up with a new algorithm. It is simpler, way faster and completely without any magic numbers. (Itâs published in Perl and Python.) Thanks to @geppoz for the idea to know when to stop searching.
I tried really hard to figure this out, and it took 2 days. I finally got it by realizing, maybe if I knew what was possible, I could determine the impossible.
I think this is memoization - My degree isnât in CS, so I donât know a ton of algorithms etcâŚ
I cheated and used a*b - a - b + 1 as the sieve size, where a,b are any two pairwise coprime numbers in the list. Any number above that can be served with just size a and b, by so clearly can be made with the full set of sizes. The cheat part is that itâs possible to have a set of 3+ numbers be coprime with no two of them being pairwise coprimeâŚbut that case did not arise in the tests or validators.
I donât understand the problem. Why is the limit 3 with boxes of 2 and 5? Wouldnât 11 be impossible too (and higher)? And then, why isnât 7 the answer for boxes of 6 and 8? Why is there no maximum then?
11 is not impossible ⌠it is 1 box of 5 and 3 boxes of 2
and as said in statement it is impossible to serve odd number so the maximum in âinfinite oddâ . answer should be âThe maximal number of nuggets that is impossible to getâ and infinite is bigger than 7 âŚ
Hi to all and thanks @Thib34 and (@Oioi, @Djoums and @UncleV as Validators) for this Puzzle âŚ
â after many tries/hours and different languages tested, i finally got 100% ⌠in Objective-C âŚ
â this is only with your help from this forum,
â specially about the 7th Validator (i stopped my main loop too early) !
=> so happy today ⌠Thanks to you all !
Bye, have sun, fun and CodinGames âŚ
and Good luck for all about the next CodinGame Fall Challenge next Monday !