Task: | Lumimyrsky |
Sender: | Matutao |
Submission time: | 2023-11-05 19:16:37 +0200 |
Language: | Java |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.12 s | details |
#2 | WRONG ANSWER | 0.13 s | details |
#3 | WRONG ANSWER | 0.12 s | details |
#4 | WRONG ANSWER | 0.12 s | details |
#5 | WRONG ANSWER | 0.12 s | details |
#6 | RUNTIME ERROR | 0.12 s | details |
#7 | RUNTIME ERROR | 0.12 s | details |
#8 | RUNTIME ERROR | 0.12 s | details |
#9 | RUNTIME ERROR | 0.12 s | details |
#10 | RUNTIME ERROR | 0.12 s | details |
#11 | RUNTIME ERROR | 0.12 s | details |
Code
import java.util.*; public class Lumimyrsky { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String[] rivi1 = (sc.nextLine().split(" ")); String[] rivi2 = (sc.nextLine().split(" ")); sc.close(); int[] rivi1numero = new int[10]; int[] rivi2numero = new int[10]; for(int i = 0; i < 10; i++){ rivi1numero[i] = Integer.valueOf(rivi1[i]); rivi2numero[i] = Integer.valueOf(rivi2[i]); } for (int i : rivi2numero) { System.out.println(rivi1numero[i]); } int summa1 = 0; int summa2 = 0; for(int i = 0; i < 10; i++){ if (i != 0) { if (rivi1numero[i - 1] < rivi1numero[i]) { summa1 = summa1 + (rivi1numero[i] - rivi1numero[i - 1]); } else{ continue; } } else{ if (rivi1numero[0] < rivi1numero[i]) { summa1 = summa1 + (rivi1numero[i] - rivi1numero[i - 1]); } else{ continue; } } } for(int i = 0; i < 10; i++){ if (i != 0) { if (rivi2numero[i - 1] < rivi2numero[i]) { summa2 = summa2 + (rivi2numero[i] - rivi2numero[i - 1]); } else{ continue; } } else{ if (rivi2numero[0] < rivi2numero[i]) { summa2 = summa2 + (rivi2numero[i] - rivi2numero[i - 1]); } else{ continue; } } } if (summa1 < summa2) { System.out.print(1); } else{ System.out.print(2); } } }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
0 0 1 1 1 2 2 2 1 0 0 1 2 3 2 2 3 0 1 1 |
correct output |
---|
1 |
user output |
---|
0 0 1 1 1 ... |
Test 2
Verdict: WRONG ANSWER
input |
---|
1 1 1 1 1 1 1 1 0 1 1 0 0 0 1 0 1 0 0 0 |
correct output |
---|
1 |
user output |
---|
1 1 1 1 1 ... |
Test 3
Verdict: WRONG ANSWER
input |
---|
1 2 2 2 0 0 0 2 0 0 0 1 0 1 1 2 1 2 1 2 |
correct output |
---|
1 |
user output |
---|
1 2 1 2 2 ... |
Test 4
Verdict: WRONG ANSWER
input |
---|
4 2 0 10 6 10 4 5 4 3 3 1 2 7 6 1 3 5 2 6 |
correct output |
---|
2 |
user output |
---|
10 2 0 5 4 ... |
Test 5
Verdict: WRONG ANSWER
input |
---|
6 0 7 9 3 1 5 6 9 4 9 0 1 0 2 2 0 1 4 7 |
correct output |
---|
2 |
user output |
---|
4 6 0 6 7 ... |
Test 6
Verdict: RUNTIME ERROR
input |
---|
10 9 6 1 10 9 7 6 7 6 2 1 10 2 0 7 2 9 4 6 |
correct output |
---|
1 |
user output |
---|
6 9 |
Error:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 10 out of bound...
Test 7
Verdict: RUNTIME ERROR
input |
---|
22 5 87 83 20 36 92 98 49 9 61 40 77 35 52 49 29 100 18 81 |
correct output |
---|
1 |
user output |
---|
(empty) |
Error:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 61 out of bound...
Test 8
Verdict: RUNTIME ERROR
input |
---|
90 95 33 21 82 6 4 37 10 99 60 10 53 61 42 53 33 48 62 83 |
correct output |
---|
2 |
user output |
---|
(empty) |
Error:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 60 out of bound...
Test 9
Verdict: RUNTIME ERROR
input |
---|
7 22 78 32 44 98 73 46 98 31 54 26 50 8 7 42 27 1 50 53 |
correct output |
---|
2 |
user output |
---|
(empty) |
Error:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 54 out of bound...
Test 10
Verdict: RUNTIME ERROR
input |
---|
88 1 97 24 87 38 53 82 23 42 1 61 43 77 40 40 52 88 48 93 |
correct output |
---|
2 |
user output |
---|
1 |
Error:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 61 out of bound...
Test 11
Verdict: RUNTIME ERROR
input |
---|
1 36 50 50 50 0 13 31 14 1 22 88 42 13 25 13 8 39 34 49 |
correct output |
---|
1 |
user output |
---|
(empty) |
Error:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 22 out of bound...