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 1781. Clean Code

Sample explanation
Posted by Foobar 9 Oct 2010 20:13
Can anyone explain the sample:

3
0 0 0
1 1 0
1 1 0



1
1 3


I dont understand it. The resulting matrix is:
0 1 1
0 1 1
0 0 0

Thanks!
Re: Sample explanation
Posted by Khúc Anh Tuấn 9 Oct 2010 20:31
I think the correct final matrix must have all 1(s) above or lie on the main diagonal.

Any hint to solve this problem ?

Edit: nvm, solved it, nice problem with simple algorithm :D

Edited by author 12.10.2010 11:07

Edited by author 12.10.2010 11:07
Re: Sample explanation
Posted by svr 16 Oct 2010 22:29
This problem very similar with 1042- central heating
Each move (i,j) make switching (and replacing) of some set of pairs of cells.
Thus we have linear system over field {0,1)
Re: Sample explanation
Posted by bsu.mmf.team 8 Dec 2016 15:29
No, the solution is much simplier. You just need to investigate the properties such an operation has.

Edited by author 08.12.2016 15:31