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 1254. Die Hard

It's a good problem !
Posted by hello 25 Jun 2004 19:03
Re: It's a good problem !
Posted by svr 4 Feb 2007 11:27
One of solvable by Dijksta with heap.
But interesting how to speed up.
Idea: use struct (int,int*sqrt(2)) instead of double
for distances with compair: (h1,h2*sqrt(2))<(q1,q2*sqrt(2))~
(h1-q1)^2<2*(h2-q2)^2 in int type.
Re: It's a good problem !
Posted by Alias (Alexander Prudaev) 24 Mar 2007 21:02
i have used other method, and i have best AC 0.265 sec 220 kb
Re: It's a good problem !
Posted by IgorKoval(from Pskov) 22 Dec 2011 03:53
svr wrote 4 February 2007 11:27
One of solvable by Dijksta with heap.
But interesting how to speed up.
Idea: use struct (int,int*sqrt(2)) instead of double
for distances with compair: (h1,h2*sqrt(2))<(q1,q2*sqrt(2))~
(h1-q1)^2<2*(h2-q2)^2 in int type.

I have read you massage and after wrote as you said. I got TLE. I changed <<<struct harT{long k1, k2;};>>> on <<<double>>> and get AC.
Conclusion: It's not good idea or I don't undestand you. =)

Edited by author 22.12.2011 03:53

Edited by author 22.12.2011 03:54