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 1126. Magnetic Storms

Please, help me to solve this problem!
Posted by Bedny Yuri (bedny@rain.ifmo.ru) 16 Feb 2002 22:30
First of all, I sorry for my bad English.
Please help me to solve this problem. I wrote solution, but my
program works very slow(>0.5). I think that idea of my solution is
bad. Please help me!
You may use(+)
Posted by Miguel Angel 17 Feb 2002 02:49
Well my solution isn't the fastest but is quick. Maybe is something
complicated, but as you may see the data are ordered like a queue and
you want to determine of all the data in the queue which one is the
greatest, print it, and then throw the first, add the later and do
the operation again. Hint: There's a Data Structure which does
exactly this :).
Doubts?: miguelangelhdz@hotmail.com
Re: You may use(+)
Posted by Junjie Liang 21 Mar 2002 16:52
Are you referring to a heap? Because that's was the first things that
came to my mind (and nothing else so far)...

If you are referring to a heap, could you explain how you decide
which one to "throw away"? I can't seem to fit the idea of a queue
and heap together...