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 1397. Points Game

To admins: Time Limit in Java
Posted by crdp 19 Sep 2007 22:47
I have sent two solutions: one in Java, one in Pascal.
Java solution is more efficiently.
But Java solution got TL1, and Pascal solution got AC.
For optimization, i killed making instances of all classes in Java, but still TL1.
Can You change java time limit for this problem?
Re: To admins: Time Limit in Java
Posted by Sandro (USU) 19 Sep 2007 23:54
There is no possibility to set different TL for different languages in Timus Online Judge. Your Java solution works more than 5 seconds on 1st test. Write more effective solution. By the way, try to avoid Math.hypot in your program; sqrt works faster.
Re: To admins: Time Limit in Java
Posted by crdp 20 Sep 2007 14:25
Thanks. But I think, that this situation is unfair for Java-programmers.
Re: To admins: Time Limit in Java
Posted by Vladimir Yakovlev (USU) 20 Sep 2007 15:17
Change Math.hypot to Math.sqrt and you'll get 20x acceleration! Solution will work even faster than your pascal solution.

So, this problem can be solved in Java with the same algorithm.