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

Common Board

Prob 1090 "In the army now" : I know its algorithm is "Balanced tree" but is there any other algorithm run in time limit ?
Posted by Tran Nam Trung (trungduck@yahoo.com) 6 Jul 2001 17:35
71222119
mailto : trungduck@yahoo.com
Re: Prob 1090
Posted by Jivko Ganev 7 Jul 2001 18:47
Yes there is much simpler algorithm for this problem, just
use array [1..10000] and do binary search on it. Use the
elements of the array to denote how many times you have
gone left of them(during the binary search). You should do
this sequentialy for every element in the input, and you'll
get n * log 10000 algorithm.