Send your feedback or ask for help here!
Only validator 6 result is over 2^63 (but still below 2^64). This makes the puzzle unnecessarily complicated in languages that have only ‘signed int64’ support, but not ‘unsigned int64’ support.
To be honest i didn’t check this, because i supposed it was a standard data type supported in every language, My bad. What language does not support it ?
I don’t program in Java, but there might be problems.
I liked it, I found the loops not as easy to write as I expected thank you !
I agree with the others, it may be difficult for beginners to think of that, especially depending on the language.
I don’t understand tests 7 and 8. Why the result is 64 for test 7 and 2066850 for test 8?
What do you think the answer should be, and what is your calculation (say, list the first few steps)?
The problem is that it’s a validator (12 for me) which is not working with a classic code in php…It can be hard to guess that it’s a problem with large numbers. Should be a good thing to swap validator 12 and test 12 no ?
For test 7:
_At T0: nb of pairs = 8
_At T1: nb of pairs = 8
_At T2: nb of pairs = 8
_At T3: nb of pairs = 8
_At T4: nb of pairs = 16 (2T3)
_At T5: nb of pairs = 32 (2T4)
_At T6: nb of pairs = 24 (T1+T2+T3)
_At T7: nb of pairs = 32 (T2+T3+T4)
_At T8: nb of pairs = 56 (T3+T4+T5)
_At T9: nb of pairs = 72 (T4+T5+T6)
_At T10: nb of pairs = 88 (T5+T6+T7)
_At T11: nb of pairs = 112 (T6+T7+T8)
_At T12: nb of pairs = 160 (T7+T8+T9)
For Test 7 it should be:
T0: 8 T1: 0 T2: 0 T3: 8 (T0) T4: 8 (T0 + T1) T5: 8 (T0 + T1 + T2) T6: 8 (T1 + T2 + T3) T7: 16 (T2 + T3 + T4) ...
The initial pairs are only old enough to produce new pairs starting at T3
Seeing the comments here I realised I set the maximum to be under 2^64 so it could be done in every languages, I didn’t know there was no unsigned in some language, if it’s not too late to change that now that it is published I’ll edit that because even if there was the fact that the issue only occur on a validator is no good.
It’s ok to edit the puzzle to remove the issues which prevent players of some programming languages from completing it.
I set the maximum to be under 2^64 so it could be done in every languages
Well I realise I said something really wrong, it must have been too long since I last did Js, you can overcome the 2^53-1 limit by using BigInt. Something like the following will print the exact good answer:
const num = BigInt(2**64); console.log(num.toString()); // Output : 18446744073709551616