ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1507. Трудное решение

Tbilisi SU: Andrew Lutsenko After rejudge I had WA42 and Crash on #41. Hints are here (+) [5] // Задача 1507. Трудное решение 31 окт 2006 13:55
I had crash because of trivial stack overflow, my recursion never ended. Check the recursion exit condition.
Hint for WA42:
Power 0 of M(nxn) matrix is a matrix
1 0 .. 0
0 1 .. 0
........
0 0 .. 1

Good luck and have fun :)
As i can understand from changes i did to make my solution work,  42th test was
---------
1
0
---------
And it's considered that [0]^0 = [1]
But Power 0 of [0]-Matrix is undefined, isn't it?
Sorry, there may be different definitions. But you may be sure that [0]^0 = [1] in this problem.
Vladimir Yakovlev (USU) N >= 2 now (+) [1] // Задача 1507. Трудное решение 31 окт 2006 21:57
I agree, that test
1
0
is not correct, because [0]^0 in not defined in problem statements.

New tests 41 and 42 have been modified. N >= 2 now for this problem. Submissions have been rejudged back.
Tbilisi SU: Andrew Lutsenko Re: N >= 2 now (+) // Задача 1507. Трудное решение 1 ноя 2006 14:25
After second rejudge all my attempts (except one or two with silly mistakes) were accepted =)
My program keeps getting WA in the test 42 but works fine for the input:
1
0
whose output is Yes
In fact my exponentation is ok when the exponent is 0.
Any possible explanation?