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 1439. Battle with You-Know-Who

treap + binarySearch
Posted by Berezhko German 30 Aug 2012 18:07
my AC used treap as data structure and binary search for the answer. In heap I have kept numbers of initial deleted rooms. After each query I was looking for this number. And if query is 'LOOK AT', I print it, else insert in treap.
O(M * log^2K), where K is number of query 'D'
P.S.: sorry for bad English.

Edited by author 30.08.2012 18:26