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

WA#4 - answer!
Posted by Ilmir Tazetdinov [IATE] 6 Oct 2010 18:49
Our mistake was following: we used wrong function of matrix multiplication. Our function had three parameters FUNC(a, b, c). We call FUNC(x, y, x) to calculate x = x * y; but there is mistake, because when we calculate resulting matrix we should use constant "x" and "y", but first source parameter "x" is the same as third resulting parameter "x". "X" is changing during calculation and so we change also source parameter.
Right decision is to use additional variable to store "x"

t = x;
FUNC(t, y, x);

That's all