|
|
back to boardCommon BoardAbout 1028 Stars. 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 (-) Re: About 1028 Stars. > 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. |
|
|