|
|
вернуться в форумПоказать все сообщения Спрятать все сообщения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? 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. Thanks. But I think, that this situation is unfair for Java-programmers. 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. |
|
|