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

hint
Posted by Toshpulatov (MSU Tashkent) 30 Mar 2021 17:05
suppose everything is good for the first 'i' columns, but the column is 'i' bad, then let's try to find such 'j' that, by doing the operation, our new column 'i' will become good, what properties should the column 'j' have ?
If you can find 'j' just do operation swap (i, j)