Task: | Pörssihai |
Sender: | Perdex |
Submission time: | 2015-01-29 15:02:28 +0200 |
Language: | Java |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | OUTPUT LIMIT EXCEEDED | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.09 s | 1 | details |
#2 | WRONG ANSWER | 0.07 s | 1 | details |
#3 | WRONG ANSWER | 0.10 s | 1 | details |
#4 | WRONG ANSWER | 0.40 s | 2 | details |
#5 | WRONG ANSWER | 0.40 s | 2 | details |
#6 | WRONG ANSWER | 0.42 s | 2 | details |
#7 | OUTPUT LIMIT EXCEEDED | 0.00 s | 3 | details |
#8 | OUTPUT LIMIT EXCEEDED | 0.00 s | 3 | details |
#9 | TIME LIMIT EXCEEDED | -- | 3 | details |
#10 | OUTPUT LIMIT EXCEEDED | 0.00 s | 3 | details |
#11 | OUTPUT LIMIT EXCEEDED | 0.00 s | 3 | details |
#12 | OUTPUT LIMIT EXCEEDED | 0.00 s | 3 | details |
#13 | TIME LIMIT EXCEEDED | -- | 3 | details |
#14 | TIME LIMIT EXCEEDED | -- | 3 | details |
#15 | OUTPUT LIMIT EXCEEDED | 0.00 s | 3 | details |
#16 | OUTPUT LIMIT EXCEEDED | 0.00 s | 3 | details |
#17 | OUTPUT LIMIT EXCEEDED | 0.00 s | 3 | details |
#18 | OUTPUT LIMIT EXCEEDED | 0.00 s | 3 | details |
#19 | TIME LIMIT EXCEEDED | -- | 3 | details |
#20 | TIME LIMIT EXCEEDED | -- | 3 | details |
Code
public class Q52 { static int[] daysBack; static double [] average; static int i; public static void main(String[] fuckingCopyRightBreaker){ IO io = new IO(); int n = io.nextInt(); daysBack = new int[n]; average = new double[n]; average[0] = io.nextInt(); daysBack[0] = 1; io.print((daysBack[0]) + " "); io.println(average[0]); for(i = 1; i < n; i++){ average[i] = io.nextInt(); daysBack[i] = 1; daysBack[i] = go(i - 1); io.print((daysBack[i]) + " "); io.println(average[i]); }//for io.close(); }//main private static int go(int j){ if(j < 0) return 0; double nextAvg = (average[j] * daysBack[j] + average[i] * daysBack[i]) / (daysBack[j] + daysBack[i]); if(nextAvg >= average[i]){ average[i] = nextAvg; daysBack[i] += daysBack[j]; } return Math.max(daysBack[i], go(j - daysBack[j])); } }
Test details
Test 1
Group: 1
Verdict: WRONG ANSWER
input |
---|
200 5986 845897 759781 171305 7836... |
correct output |
---|
1 1 2 3 4 1 1 2 4 1 2 1 2 5 6 ... |
user output |
---|
1 5986.0 1 845897.0 2 802839.0 3 592327.6666666666 4 463836.0 ... |
Test 2
Group: 1
Verdict: WRONG ANSWER
input |
---|
200 607815 909742 130099 813674 34... |
correct output |
---|
1 1 3 1 5 1 1 3 4 5 1 1 1 4 10... |
user output |
---|
1 607815.0 1 909742.0 3 549218.6666666666 1 813674.0 5 499212.4 ... |
Test 3
Group: 1
Verdict: WRONG ANSWER
input |
---|
200 921591 381013 930275 151815 69... |
correct output |
---|
1 2 1 4 5 1 2 3 4 1 2 7 1 2 3 ... |
user output |
---|
1 921591.0 2 651302.0 1 930275.0 4 596173.5 5 490811.8 ... |
Test 4
Group: 2
Verdict: WRONG ANSWER
input |
---|
5000 952303 272950 268680 897180 13... |
correct output |
---|
1 2 3 1 2 1 4 8 9 10 1 2 13 14... |
user output |
---|
1 952303.0 2 612626.5 3 497977.6666666667 1 897180.0 2 514112.5 ... |
Test 5
Group: 2
Verdict: WRONG ANSWER
input |
---|
5000 815856 460818 496023 308974 33... |
correct output |
---|
1 2 3 4 5 1 1 2 9 1 11 12 13 1... |
user output |
---|
1 815856.0 2 638337.0 3 590899.0 4 520417.75 5 483388.8 ... |
Test 6
Group: 2
Verdict: WRONG ANSWER
input |
---|
5000 4889 373080 366119 72135 10214... |
correct output |
---|
1 1 2 3 4 1 1 2 3 4 5 1 2 3 1 ... |
user output |
---|
1 4889.0 1 373080.0 2 369599.5 3 270444.6666666667 4 228369.75 ... |
Test 7
Group: 3
Verdict: OUTPUT LIMIT EXCEEDED
input |
---|
1000000 444890 370930 385763 316218 44... |
correct output |
---|
1 2 3 4 1 2 3 4 9 1 2 1 4 5 6 ... |
user output |
---|
(empty) |
Test 8
Group: 3
Verdict: OUTPUT LIMIT EXCEEDED
input |
---|
1000000 202077 270536 246808 189471 19... |
correct output |
---|
1 1 2 3 4 1 1 3 4 5 1 2 8 9 10... |
user output |
---|
(empty) |
Test 9
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000 736301 784710 628727 708231 64... |
correct output |
---|
1 1 3 4 5 6 7 1 2 1 4 1 1 7 1 ... |
user output |
---|
(empty) |
Test 10
Group: 3
Verdict: OUTPUT LIMIT EXCEEDED
input |
---|
1000000 242104 238293 242641 242281 24... |
correct output |
---|
1 2 1 2 3 1 2 3 1 2 1 4 11 12 ... |
user output |
---|
(empty) |
Test 11
Group: 3
Verdict: OUTPUT LIMIT EXCEEDED
input |
---|
1000000 252952 189698 245317 275463 24... |
correct output |
---|
1 2 1 1 2 4 7 1 2 3 1 2 3 1 1 ... |
user output |
---|
(empty) |
Test 12
Group: 3
Verdict: OUTPUT LIMIT EXCEEDED
input |
---|
1000000 214451 357457 213436 351167 21... |
correct output |
---|
1 1 2 1 4 5 6 7 8 9 1 1 3 4 5 ... |
user output |
---|
(empty) |
Test 13
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000 363703 361248 358992 356404 35... |
correct output |
---|
1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
user output |
---|
(empty) |
Test 14
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000 718920 716974 715476 714540 71... |
correct output |
---|
1 2 3 4 5 6 7 1 1 1 1 1 1 1 1 ... |
user output |
---|
(empty) |
Test 15
Group: 3
Verdict: OUTPUT LIMIT EXCEEDED
input |
---|
1000000 614078 647174 701983 580935 58... |
correct output |
---|
1 1 1 3 4 1 6 8 9 1 1 3 4 14 1... |
user output |
---|
(empty) |
Test 16
Group: 3
Verdict: OUTPUT LIMIT EXCEEDED
input |
---|
1000000 788376 788632 788880 789118 78... |
correct output |
---|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
user output |
---|
(empty) |
Test 17
Group: 3
Verdict: OUTPUT LIMIT EXCEEDED
input |
---|
1000000 711774 711541 711305 711627 71... |
correct output |
---|
1 2 3 1 2 6 1 2 1 2 3 6 7 1 2 ... |
user output |
---|
(empty) |
Test 18
Group: 3
Verdict: OUTPUT LIMIT EXCEEDED
input |
---|
1000000 685798 944128 587123 653271 65... |
correct output |
---|
1 1 2 3 4 1 2 7 8 10 11 1 1 3 ... |
user output |
---|
(empty) |
Test 19
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000 734074 734109 733868 733873 73... |
correct output |
---|
1 1 3 4 5 1 1 1 1 1 1 1 3 5 6 ... |
user output |
---|
(empty) |
Test 20
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000 143117 1 267468 262833 141471 ... |
correct output |
---|
1 2 1 2 3 1 1 2 4 1 2 10 11 12... |
user output |
---|
(empty) |