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 1019. Line Painting

If you wa 2 or 3
Posted by Li_Ke[NEU] 13 Nov 2011 16:09
Attention:

At the beginning, [0, 1000000000)is white,and the second test's output is [..., 1000000000), and in fact you have to deal it with[0, 1000000000 - 1), or you'll got wa. I don't know why!


Forgive my english:)

Edited by author 13.11.2011 16:28
Re: If you wa 2 or 3
Posted by lpeter83 13 Nov 2011 16:37
I saw your solution run at 0.046s, it was really fast. however I use segmentTree to get accept at 0.64s. what kind of algorithm do you use?
Re: If you wa 2 or 3
Posted by cs_Diablo 22 Dec 2011 02:44
I don't know what you have been doing, but the bruteforce is 0.156s which is 4.4 times faster than your idea. What I'm trying to say is that you dont need segmentTrees for this problem, unless you want to exercize on them; the naive approach is also very fast :)