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 1135. Recruits

Nice problem, some hints
Posted by raggzy 11 Mar 2014 03:12
For those who couldn't do straightforward O(n^2) with tricks.
Think of < as 0 and > as 1.
Every time you see >< (10) you replace (swap) it with <> (01).
Which means, you stop as soon as you get sorted stuff, 0*1*.
Doesn't it look like count of swaps in bubblesort? :)
Re: Nice problem, some hints
Posted by maxormo 31 May 2017 02:06
this solution wont pass TL on 15 with small tricks on wont pass 16