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

About 1028 Stars.
Posted by Smasher_nine 25 Oct 2000 04:39
Any ideas about really simple and efficient algorithm that
does the job in the time bounds.I tried keeping sorted
array or binary tree but they get TLE.When I test it at
home i never get TLE with random tests.They obviously try
tests like all the points with increasing or decresing x.I
can only think of balanced trees and I don't like B
trees.Also I have several other optimizations and I think
my code should get 5 secs at most even with samples like
all the stars with increasing x.My other idea was assembler
but did anyone try asm, does it work?
I kept the array sorted and that solved the problem in 2.2 sec. try using C++ instead of pascal (-)
Posted by Ilya Semenov (NSU) 25 Oct 2000 23:52
Re: About 1028 Stars.
Posted by Petko Minkov 26 Oct 2000 02:31
> Any ideas about really simple and efficient algorithm
that
> does the job in the time bounds.I tried keeping sorted
> array or binary tree but they get TLE.When I test it at
> home i never get TLE with random tests.They obviously try
> tests like all the points with increasing or decresing
x.I
> can only think of balanced trees and I don't like B
> trees.Also I have several other optimizations and I think
> my code should get 5 secs at most even with samples like
> all the stars with increasing x.My other idea was
assembler
> but did anyone try asm, does it work?

 Straightforward N^2 worked in 2.5 secs.