The Resistance puzzle discussion

Computation time limit is not part of the constraints. But it makes tests fail.

Do you mean bit as the ā€œ.ā€ and ā€œ-ā€?

This really is a memoization puzzle. Keep that in mind.

the same issue :frowning:

i want to ask about the large sequence, how many character it consists . please i am in trouble. i use C++ and i try to store the morse sequence in a string object , when i try to print it i get just a part of the whole morse sequence iā€™ve previously typed . can anybody provides some help ?

As it is a puzzle created by CG, only the staff is able to view the validators. So, I have no idea how many characters there are in their input strings.

This thread includes a lot of hints and tips. I would highly recommend you to read them all to get some inspiration on how to optimise your code.

Not sure if I get your meaning? Thereā€™s a character limit in the CodinGame console, and it wonā€™t show the middle part if the output is too long. If you need to see the entire output, the best way is to do it outside CodinGame.

And if you want to see the input, you can click the button above the cases to see it. (This applies to tests only, not validators.)

i solved the problem very well in my environment all the tests passed but at codingame, my code seems to be not optimized in test case 6 (the huge one) , i really did my best to optimize but since i need a matrix to store data in, since the morse code is too much long the matrix is also huge ,so the iteration over the matrix is a big problem ? no other data structure solves the problem since i need the random access and to fetch entries in specified well defined manner as matrix . any help (my algorithm is correct, just an optimization stuff)

Please read this thread and youā€™ll find some optimization tips quite near the beginning.

Which thread ?

When you solved this puzzel, have you used a matrix to store your results or not ?

This very thread that you are posting in.

Iā€™ve solved this puzzle in many programming languages, and different data structures have been used in storing the intermediate results.

no body speaks about the optimization, i really donā€™t know what to do ? because the solution is correct, howerver the validator One single message possible is not passed and a little bit confused if it an optimization problem or the algorithm fails. iā€™m quit sure itā€™s correct . any help sir ?

They do, even if their message donā€™t contain the word ā€œoptimizationā€. For example, this and this and this. I suggest you to read slowly and carefully all the messages on this page.

how did you passed the test long sequence, large dictionary ?

my implementation is to iterate over the dictionary of words, for each word find all occurences and store them in a map with the key start,end of the occurence. then calculate the possibilities, my algorithm with LSLD ends up in 0.222329 s, which leads to fail the test why ?