11889 | 2024-11-15 15:52:46 | LenglZalanMor | Számjegycsere | pypy3 | Wrong answer 0/100 | 477ms | 27460 KiB |
N = int(input())
m = 0
for i in range(N):
K = input()
if K[-2:] in ['00','25','50','75']:
m = 0
elif K[-2:] in ['52','05','57']:
m = 1
elif K[-1] == '5' and ('2' in K or '7' in K[:-1]):
m = 1
elif K[-1] == '0' and ('5' in K or '0' in K[:-1]):
m = 1
elif '2' in K and '5' in K:
m = 2
elif '5' in K and '7' in K:
m = 2
elif K.count('0') > 1:
m = 2
elif '5' in K and '0' in K:
m = 2
else:
m = -1
print(m)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 39ms | 19436 KiB | ||||
subtask2 | 0/21 | ||||||
2 | Wrong answer | 259ms | 26856 KiB | ||||
subtask3 | 0/23 | ||||||
3 | Wrong answer | 430ms | 27416 KiB | ||||
4 | Wrong answer | 442ms | 27296 KiB | ||||
5 | Wrong answer | 365ms | 24768 KiB | ||||
6 | Wrong answer | 442ms | 27268 KiB | ||||
7 | Wrong answer | 432ms | 27372 KiB | ||||
8 | Wrong answer | 388ms | 24812 KiB | ||||
9 | Wrong answer | 439ms | 27208 KiB | ||||
10 | Wrong answer | 402ms | 25780 KiB | ||||
11 | Wrong answer | 437ms | 27372 KiB | ||||
12 | Wrong answer | 433ms | 27316 KiB | ||||
13 | Wrong answer | 428ms | 27460 KiB | ||||
14 | Wrong answer | 375ms | 24552 KiB | ||||
15 | Wrong answer | 442ms | 26528 KiB | ||||
16 | Wrong answer | 386ms | 24716 KiB | ||||
17 | Wrong answer | 402ms | 25180 KiB | ||||
18 | Wrong answer | 395ms | 24528 KiB | ||||
19 | Wrong answer | 370ms | 24560 KiB | ||||
20 | Wrong answer | 368ms | 24600 KiB | ||||
21 | Wrong answer | 377ms | 24680 KiB | ||||
22 | Wrong answer | 435ms | 26860 KiB | ||||
23 | Wrong answer | 414ms | 26900 KiB | ||||
subtask4 | 0/41 | ||||||
24 | Accepted | 41ms | 19648 KiB | ||||
25 | Accepted | 46ms | 19584 KiB | ||||
26 | Accepted | 41ms | 19644 KiB | ||||
27 | Accepted | 43ms | 19632 KiB | ||||
28 | Accepted | 41ms | 19672 KiB | ||||
29 | Accepted | 45ms | 19528 KiB | ||||
30 | Accepted | 41ms | 19600 KiB | ||||
31 | Accepted | 46ms | 19696 KiB | ||||
32 | Accepted | 46ms | 19592 KiB | ||||
33 | Wrong answer | 45ms | 19640 KiB | ||||
34 | Accepted | 39ms | 19476 KiB | ||||
35 | Accepted | 48ms | 21296 KiB | ||||
36 | Accepted | 79ms | 21484 KiB | ||||
37 | Accepted | 123ms | 22748 KiB | ||||
38 | Accepted | 48ms | 21312 KiB | ||||
39 | Accepted | 48ms | 21224 KiB | ||||
40 | Accepted | 48ms | 21224 KiB | ||||
41 | Accepted | 48ms | 21324 KiB | ||||
42 | Accepted | 78ms | 21488 KiB | ||||
43 | Accepted | 71ms | 21480 KiB | ||||
44 | Accepted | 76ms | 21492 KiB | ||||
45 | Accepted | 71ms | 21676 KiB | ||||
46 | Wrong answer | 54ms | 21408 KiB | ||||
47 | Wrong answer | 70ms | 21684 KiB | ||||
subtask5 | 0/15 | ||||||
48 | Wrong answer | 74ms | 21484 KiB | ||||
49 | Wrong answer | 48ms | 22104 KiB | ||||
50 | Wrong answer | 477ms | 26436 KiB | ||||
51 | Wrong answer | 61ms | 21452 KiB | ||||
52 | Wrong answer | 172ms | 23276 KiB | ||||
53 | Accepted | 59ms | 21484 KiB | ||||
54 | Accepted | 75ms | 21652 KiB | ||||
55 | Accepted | 134ms | 23640 KiB | ||||
56 | Accepted | 331ms | 23020 KiB | ||||
57 | Accepted | 46ms | 21744 KiB | ||||
58 | Accepted | 48ms | 21744 KiB | ||||
59 | Accepted | 54ms | 21560 KiB | ||||
60 | Accepted | 75ms | 21480 KiB | ||||
61 | Accepted | 82ms | 21508 KiB | ||||
62 | Accepted | 86ms | 21484 KiB | ||||
63 | Accepted | 90ms | 21704 KiB | ||||
64 | Accepted | 305ms | 22920 KiB | ||||
65 | Accepted | 312ms | 23040 KiB | ||||
66 | Accepted | 312ms | 22880 KiB |