11959 | 2024-11-22 14:41:02 | Xetoxino | Számjegycsere | pypy3 | Wrong answer 0/100 | 458ms | 27516 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 | Wrong answer | 46ms | 19436 KiB | ||||
subtask2 | 0/21 | ||||||
2 | Wrong answer | 266ms | 26348 KiB | ||||
subtask3 | 0/23 | ||||||
3 | Wrong answer | 458ms | 26936 KiB | ||||
4 | Wrong answer | 446ms | 27432 KiB | ||||
5 | Wrong answer | 368ms | 24616 KiB | ||||
6 | Wrong answer | 437ms | 27004 KiB | ||||
7 | Wrong answer | 441ms | 27372 KiB | ||||
8 | Wrong answer | 391ms | 24784 KiB | ||||
9 | Wrong answer | 437ms | 26844 KiB | ||||
10 | Wrong answer | 407ms | 25716 KiB | ||||
11 | Wrong answer | 449ms | 26920 KiB | ||||
12 | Wrong answer | 437ms | 27372 KiB | ||||
13 | Wrong answer | 432ms | 27516 KiB | ||||
14 | Wrong answer | 370ms | 24636 KiB | ||||
15 | Wrong answer | 439ms | 26604 KiB | ||||
16 | Wrong answer | 386ms | 24908 KiB | ||||
17 | Wrong answer | 400ms | 24752 KiB | ||||
18 | Wrong answer | 402ms | 24756 KiB | ||||
19 | Wrong answer | 368ms | 24556 KiB | ||||
20 | Wrong answer | 365ms | 24512 KiB | ||||
21 | Wrong answer | 372ms | 24512 KiB | ||||
22 | Wrong answer | 423ms | 26348 KiB | ||||
23 | Wrong answer | 414ms | 26600 KiB | ||||
subtask4 | 0/41 | ||||||
24 | Accepted | 43ms | 19664 KiB | ||||
25 | Accepted | 46ms | 19520 KiB | ||||
26 | Accepted | 41ms | 19656 KiB | ||||
27 | Accepted | 41ms | 19668 KiB | ||||
28 | Accepted | 41ms | 19556 KiB | ||||
29 | Accepted | 39ms | 19672 KiB | ||||
30 | Accepted | 43ms | 19508 KiB | ||||
31 | Accepted | 45ms | 19524 KiB | ||||
32 | Accepted | 41ms | 19572 KiB | ||||
33 | Wrong answer | 45ms | 19692 KiB | ||||
34 | Accepted | 39ms | 19500 KiB | ||||
35 | Accepted | 54ms | 21232 KiB | ||||
36 | Accepted | 78ms | 21500 KiB | ||||
37 | Accepted | 103ms | 23004 KiB | ||||
38 | Accepted | 46ms | 21268 KiB | ||||
39 | Accepted | 52ms | 21232 KiB | ||||
40 | Accepted | 56ms | 21232 KiB | ||||
41 | Accepted | 52ms | 21228 KiB | ||||
42 | Accepted | 71ms | 21656 KiB | ||||
43 | Accepted | 71ms | 21484 KiB | ||||
44 | Accepted | 78ms | 21452 KiB | ||||
45 | Accepted | 78ms | 21456 KiB | ||||
46 | Wrong answer | 48ms | 21232 KiB | ||||
47 | Wrong answer | 78ms | 21500 KiB | ||||
subtask5 | 0/15 | ||||||
48 | Wrong answer | 75ms | 21724 KiB | ||||
49 | Wrong answer | 46ms | 21996 KiB | ||||
50 | Wrong answer | 430ms | 27068 KiB | ||||
51 | Wrong answer | 59ms | 21564 KiB | ||||
52 | Wrong answer | 177ms | 23532 KiB | ||||
53 | Accepted | 52ms | 21384 KiB | ||||
54 | Accepted | 85ms | 21484 KiB | ||||
55 | Accepted | 125ms | 23788 KiB | ||||
56 | Accepted | 312ms | 23016 KiB | ||||
57 | Accepted | 45ms | 21660 KiB | ||||
58 | Accepted | 48ms | 21756 KiB | ||||
59 | Accepted | 46ms | 21724 KiB | ||||
60 | Accepted | 76ms | 21724 KiB | ||||
61 | Accepted | 75ms | 21456 KiB | ||||
62 | Accepted | 83ms | 21484 KiB | ||||
63 | Accepted | 76ms | 21480 KiB | ||||
64 | Accepted | 303ms | 23000 KiB | ||||
65 | Accepted | 324ms | 22992 KiB | ||||
66 | Accepted | 316ms | 22880 KiB |