ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1507. Difficult Decision

After rejudge I had WA42 and Crash on #41. Hints are here (+)
Posted by Tbilisi SU: Andrew Lutsenko 31 Oct 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 :)
Re: After rejudge I had WA42 and Crash on #41. Hints are here (+)
Posted by Fantast 31 Oct 2006 15:21
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?
Re: But Power 0 of [0]-Matrix is undefined, isn't it?
Posted by Sandro (USU) 31 Oct 2006 15:44
Sorry, there may be different definitions. But you may be sure that [0]^0 = [1] in this problem.
Re: After rejudge I had WA42 and Crash on #41. Hints are here (+)
Posted by ucmcauchy 31 Oct 2006 19:49
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?
N >= 2 now (+)
Posted by Vladimir Yakovlev (USU) 31 Oct 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.
Re: N >= 2 now (+)
Posted by Tbilisi SU: Andrew Lutsenko 1 Nov 2006 14:25
After second rejudge all my attempts (except one or two with silly mistakes) were accepted =)