|
|
In this test N=50 and the answer is 1069. How we get this? После первого опрыскивания — 2, 4, 5, 1, 3. После второго опрыскивания — 4, 1, 3, 2, 5. После третьего опрыскивания — 1, 2, 5, 4, 3. После четвёртого опрыскивания — 2, 4, 3, 1, 5. После пятого опрыскивания — 4, 1, 5, 2, 3. После шестого опрыскивания — 1, 2, 3, 4, 5. I don't understand rule P. It's strange rule. =) I am sure that all 0.015- 0.031 submissions aren't honest. My program really solve the task in [1-40] ~ 0.015 [1-50] - 2-3 s. .After I simply placed an answer at the beginning of the program. My program doesn't use precalc at all. Time is about 0.5 sec. Jury solution without precalc works about 0.15 sec I just submitted a calculating code, which got accepted and ran only within 0.14 sec. I did not use extensive knowledge of math but just counted all the number of combination and stored it in double, which was enough in this case. Edited by author 24.12.2010 02:06 Now, after optimized a little bit, my code ran within 0.078 sec. Edited by author 24.12.2010 02:11 я получил accepted используя маасив с предрешением. Но когда отправил саму прогу котроая его высчитывает система выдает wrong answer на третьем тесте!! Почему?? перепроверь как заполняется массив, индексы и тд и тп проверь а еще лучше, проведи маленькую трассировку у себя на компе (выведи значения массива, индексы. ошибку думаю быстро обнаружишь) Are there any polynomial solutions to this problem? Mine one is exponentinal. Edited by author 12.10.2008 23:51 |
|
|