11985 | 2024-11-22 15:46:33 | PeterfalvyZoltan | Számjegycsere | python3 | Accepted 100/100 | 569ms | 3752 KiB |
N = int(input())
m = -1
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 K[-2] == '2' and ('5' in K ):
m = 1
elif K[-2] == '5' and ('0' in K ):
m = 1
elif K[-2] == '7' and ('5' in K):
m = 1
elif K[-2] == '0' and K.count('0')>= 2:
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 | 17ms | 3128 KiB | ||||
subtask2 | 21/21 | ||||||
2 | Accepted | 171ms | 3128 KiB | ||||
subtask3 | 23/23 | ||||||
3 | Accepted | 531ms | 3384 KiB | ||||
4 | Accepted | 515ms | 3384 KiB | ||||
5 | Accepted | 533ms | 3308 KiB | ||||
6 | Accepted | 515ms | 3384 KiB | ||||
7 | Accepted | 512ms | 3356 KiB | ||||
8 | Accepted | 504ms | 3388 KiB | ||||
9 | Accepted | 524ms | 3384 KiB | ||||
10 | Accepted | 518ms | 3472 KiB | ||||
11 | Accepted | 569ms | 3384 KiB | ||||
12 | Accepted | 526ms | 3456 KiB | ||||
13 | Accepted | 523ms | 3456 KiB | ||||
14 | Accepted | 522ms | 3332 KiB | ||||
15 | Accepted | 531ms | 3448 KiB | ||||
16 | Accepted | 501ms | 3200 KiB | ||||
17 | Accepted | 517ms | 3460 KiB | ||||
18 | Accepted | 513ms | 3476 KiB | ||||
19 | Accepted | 514ms | 3384 KiB | ||||
20 | Accepted | 517ms | 3208 KiB | ||||
21 | Accepted | 513ms | 3464 KiB | ||||
22 | Accepted | 523ms | 3384 KiB | ||||
23 | Accepted | 509ms | 3396 KiB | ||||
subtask4 | 41/41 | ||||||
24 | Accepted | 16ms | 3320 KiB | ||||
25 | Accepted | 16ms | 3312 KiB | ||||
26 | Accepted | 16ms | 3128 KiB | ||||
27 | Accepted | 16ms | 3124 KiB | ||||
28 | Accepted | 17ms | 2972 KiB | ||||
29 | Accepted | 16ms | 3208 KiB | ||||
30 | Accepted | 16ms | 2976 KiB | ||||
31 | Accepted | 16ms | 2976 KiB | ||||
32 | Accepted | 16ms | 3128 KiB | ||||
33 | Accepted | 16ms | 3148 KiB | ||||
34 | Accepted | 16ms | 3216 KiB | ||||
35 | Accepted | 16ms | 3128 KiB | ||||
36 | Accepted | 21ms | 3364 KiB | ||||
37 | Accepted | 57ms | 3232 KiB | ||||
38 | Accepted | 16ms | 3364 KiB | ||||
39 | Accepted | 17ms | 2988 KiB | ||||
40 | Accepted | 17ms | 3128 KiB | ||||
41 | Accepted | 16ms | 3172 KiB | ||||
42 | Accepted | 20ms | 3192 KiB | ||||
43 | Accepted | 20ms | 3076 KiB | ||||
44 | Accepted | 20ms | 3128 KiB | ||||
45 | Accepted | 19ms | 3200 KiB | ||||
46 | Accepted | 17ms | 3204 KiB | ||||
47 | Accepted | 20ms | 3204 KiB | ||||
subtask5 | 15/15 | ||||||
48 | Accepted | 23ms | 3128 KiB | ||||
49 | Accepted | 17ms | 3752 KiB | ||||
50 | Accepted | 523ms | 3376 KiB | ||||
51 | Accepted | 18ms | 3124 KiB | ||||
52 | Accepted | 115ms | 3248 KiB | ||||
53 | Accepted | 17ms | 3132 KiB | ||||
54 | Accepted | 23ms | 3104 KiB | ||||
55 | Accepted | 79ms | 3128 KiB | ||||
56 | Accepted | 537ms | 3388 KiB | ||||
57 | Accepted | 17ms | 3560 KiB | ||||
58 | Accepted | 17ms | 3560 KiB | ||||
59 | Accepted | 17ms | 3612 KiB | ||||
60 | Accepted | 23ms | 3092 KiB | ||||
61 | Accepted | 23ms | 2972 KiB | ||||
62 | Accepted | 23ms | 3076 KiB | ||||
63 | Accepted | 23ms | 3128 KiB | ||||
64 | Accepted | 531ms | 3468 KiB | ||||
65 | Accepted | 526ms | 3384 KiB | ||||
66 | Accepted | 523ms | 3456 KiB |