TOMJERRY - Editorial

PROBLEM LINKS

Practice

Contest

DIFFICULTY

CHALLENGE

EXPLANATION

Stopping Jerry from reaching any of the doors was as HARD as a typical CodeChef Hard problem. Only the top 7 successful submissions are able to stop Jerry from reaching the Door in all the test cases. The key realization in solving the cases efficiently is that, in most cases, catching Jerry is better than trying to close access to all doors. The test suite for the problem comprised of several random test cases and several hand crafted test cases. Random test cases are mostly easy because after a few moves, the closest door can always be forced far away to catch Jerry. Hand crafted test cases can be pretty evil to solve. There are test cases where it takes exactly 100 moves to be able to stop Jerry; test cases with several options to stop Jerry and test cases where stopping Jerry - even by hand - is quite hard to figure out! You can try some of the test cases here

SETTER’S SOLUTION

Can be found here.

TESTER’S SOLUTION

Can be found here.

@admin it would be great if practice problem page contains link to the forum, that request holds for all new editorials (I saw that before for some problems)

1 Like

It will be done. We are in the process of moving the old editorials to discuss.

1 Like