11968 | 2024-11-22 14:54:23 | Xetoxino | Számjegycsere | pypy3 | Wrong answer 0/100 | 481ms | 27076 KiB |
N = int(input())
m = 0
for i in range(N):
K = input()
if len(K) >= 2:
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
else:
m = -1
print(m)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 39ms | 19440 KiB | ||||
subtask2 | 0/21 | ||||||
2 | Wrong answer | 250ms | 26504 KiB | ||||
subtask3 | 0/23 | ||||||
3 | Wrong answer | 425ms | 26832 KiB | ||||
4 | Wrong answer | 451ms | 26912 KiB | ||||
5 | Wrong answer | 377ms | 24712 KiB | ||||
6 | Wrong answer | 439ms | 26892 KiB | ||||
7 | Wrong answer | 449ms | 26860 KiB | ||||
8 | Wrong answer | 393ms | 24664 KiB | ||||
9 | Wrong answer | 433ms | 26832 KiB | ||||
10 | Wrong answer | 411ms | 25608 KiB | ||||
11 | Wrong answer | 439ms | 26852 KiB | ||||
12 | Wrong answer | 481ms | 26908 KiB | ||||
13 | Wrong answer | 439ms | 27076 KiB | ||||
14 | Wrong answer | 370ms | 24552 KiB | ||||
15 | Wrong answer | 432ms | 26604 KiB | ||||
16 | Wrong answer | 386ms | 24832 KiB | ||||
17 | Wrong answer | 409ms | 24848 KiB | ||||
18 | Wrong answer | 404ms | 24812 KiB | ||||
19 | Wrong answer | 358ms | 24552 KiB | ||||
20 | Wrong answer | 360ms | 24592 KiB | ||||
21 | Wrong answer | 375ms | 24712 KiB | ||||
22 | Wrong answer | 426ms | 26092 KiB | ||||
23 | Wrong answer | 407ms | 26060 KiB | ||||
subtask4 | 0/41 | ||||||
24 | Accepted | 45ms | 19624 KiB | ||||
25 | Accepted | 45ms | 19772 KiB | ||||
26 | Accepted | 39ms | 19696 KiB | ||||
27 | Accepted | 41ms | 19672 KiB | ||||
28 | Accepted | 45ms | 19696 KiB | ||||
29 | Accepted | 41ms | 19808 KiB | ||||
30 | Accepted | 39ms | 19580 KiB | ||||
31 | Accepted | 43ms | 19500 KiB | ||||
32 | Accepted | 41ms | 19632 KiB | ||||
33 | Wrong answer | 41ms | 19668 KiB | ||||
34 | Accepted | 43ms | 19544 KiB | ||||
35 | Accepted | 54ms | 21468 KiB | ||||
36 | Accepted | 78ms | 21484 KiB | ||||
37 | Accepted | 101ms | 23020 KiB | ||||
38 | Accepted | 48ms | 21316 KiB | ||||
39 | Accepted | 48ms | 21276 KiB | ||||
40 | Accepted | 54ms | 21224 KiB | ||||
41 | Accepted | 48ms | 21460 KiB | ||||
42 | Accepted | 79ms | 21480 KiB | ||||
43 | Accepted | 71ms | 21536 KiB | ||||
44 | Accepted | 78ms | 21664 KiB | ||||
45 | Accepted | 71ms | 21672 KiB | ||||
46 | Wrong answer | 54ms | 21232 KiB | ||||
47 | Wrong answer | 71ms | 21880 KiB | ||||
subtask5 | 0/15 | ||||||
48 | Wrong answer | 74ms | 21476 KiB | ||||
49 | Wrong answer | 46ms | 21692 KiB | ||||
50 | Wrong answer | 432ms | 27072 KiB | ||||
51 | Wrong answer | 63ms | 21588 KiB | ||||
52 | Wrong answer | 199ms | 23280 KiB | ||||
53 | Accepted | 52ms | 21392 KiB | ||||
54 | Accepted | 75ms | 21484 KiB | ||||
55 | Accepted | 125ms | 23788 KiB | ||||
56 | Accepted | 328ms | 23020 KiB | ||||
57 | Accepted | 52ms | 21744 KiB | ||||
58 | Accepted | 48ms | 21740 KiB | ||||
59 | Accepted | 54ms | 21748 KiB | ||||
60 | Accepted | 76ms | 21496 KiB | ||||
61 | Accepted | 85ms | 21484 KiB | ||||
62 | Accepted | 86ms | 21616 KiB | ||||
63 | Accepted | 76ms | 21484 KiB | ||||
64 | Accepted | 324ms | 23016 KiB | ||||
65 | Accepted | 328ms | 23020 KiB | ||||
66 | Accepted | 324ms | 23020 KiB |