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 1521. War Games 2

anyone, please answer: i really confused with crash test1
Posted by lenny 16 Jan 2012 18:51
My solution use order-statistic tree (red-black tree with additional info in nodes).
In my computer it passes test from problem description and my tests too (without crashes).

Also I have function which solve this problem in a 'naive' way (O(n^2)). I've run this function and my solution on all possible n, k: 1 <= k <= n <= 300 and results was equal (there were no craches too). I know that n, k from test1 are less than 300. So, I don't know where is my bug or it is some kind of other error.

code here:
http://acm.timus.ru/forum/thread.aspx?id=27746&upd=634623275302370098