|
|
I got a question about the problem description. In other games, the losers hope to last the game longer for as many turns/rounds/moves as possible. In this game, is the losers' optimal move to (1) to minimize the difference, (2) to maximize theirselves' scores, or (3) to minimize the opponents' scores? Or are the 3 goals lead to the same move? Thanks. Why the second difference is 1.937 and no 2.000? u menja uzhe gorit proboval ispravit' vse - ne pomogaet zada4a to4no rewaetsja na pyhon? plz daite neskolko primerov The first student makes odd moves, second student makes even moves. 1st student makes 1st move, the second one makes 2nd move, then first strudent makes third move and so on. 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. I find little bug in your old post const NMAX=510;) Edited by author 11.03.2007 01:56 It was the same task on previos CBOSS contest. Does anybody knows how to solve it. Yeah... CBOSS first contest was based on tasks from Ukrainian ACM. Hint: Look at some greedy algo. |
|
|