11893 | 2024-11-15 19:21:48 | LenglZalanMor | Számjegycsere | python3 | Wrong answer 0/100 | 563ms | 3648 KiB |
N = int(input())
m = 0
M = 9
for i in range(N):
K = input()
if K == ['0','1','2','3','4','5','6','7','8','9']:
m = -1
else:
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 | 14ms | 3128 KiB | ||||
subtask2 | 0/21 | ||||||
2 | Wrong answer | 168ms | 3176 KiB | ||||
subtask3 | 0/23 | ||||||
3 | Wrong answer | 501ms | 3384 KiB | ||||
4 | Wrong answer | 509ms | 3304 KiB | ||||
5 | Wrong answer | 499ms | 3396 KiB | ||||
6 | Wrong answer | 507ms | 3384 KiB | ||||
7 | Wrong answer | 504ms | 3384 KiB | ||||
8 | Wrong answer | 488ms | 3176 KiB | ||||
9 | Wrong answer | 488ms | 3384 KiB | ||||
10 | Wrong answer | 517ms | 3384 KiB | ||||
11 | Wrong answer | 505ms | 3244 KiB | ||||
12 | Wrong answer | 507ms | 3440 KiB | ||||
13 | Wrong answer | 537ms | 3228 KiB | ||||
14 | Wrong answer | 504ms | 3252 KiB | ||||
15 | Wrong answer | 490ms | 3396 KiB | ||||
16 | Wrong answer | 510ms | 3328 KiB | ||||
17 | Wrong answer | 495ms | 3432 KiB | ||||
18 | Wrong answer | 483ms | 3384 KiB | ||||
19 | Wrong answer | 513ms | 3384 KiB | ||||
20 | Wrong answer | 500ms | 3340 KiB | ||||
21 | Wrong answer | 501ms | 3444 KiB | ||||
22 | Wrong answer | 493ms | 3240 KiB | ||||
23 | Wrong answer | 488ms | 3384 KiB | ||||
subtask4 | 0/41 | ||||||
24 | Accepted | 17ms | 3064 KiB | ||||
25 | Accepted | 16ms | 3120 KiB | ||||
26 | Accepted | 16ms | 3128 KiB | ||||
27 | Accepted | 16ms | 3124 KiB | ||||
28 | Accepted | 16ms | 3128 KiB | ||||
29 | Accepted | 17ms | 3080 KiB | ||||
30 | Accepted | 17ms | 3108 KiB | ||||
31 | Accepted | 16ms | 3128 KiB | ||||
32 | Accepted | 16ms | 2988 KiB | ||||
33 | Wrong answer | 17ms | 3128 KiB | ||||
34 | Accepted | 16ms | 3192 KiB | ||||
35 | Accepted | 17ms | 3116 KiB | ||||
36 | Accepted | 19ms | 3132 KiB | ||||
37 | Accepted | 63ms | 3120 KiB | ||||
38 | Accepted | 17ms | 2972 KiB | ||||
39 | Accepted | 16ms | 3200 KiB | ||||
40 | Accepted | 17ms | 3132 KiB | ||||
41 | Accepted | 17ms | 3128 KiB | ||||
42 | Accepted | 20ms | 3176 KiB | ||||
43 | Accepted | 20ms | 3068 KiB | ||||
44 | Accepted | 20ms | 3124 KiB | ||||
45 | Accepted | 21ms | 3060 KiB | ||||
46 | Wrong answer | 16ms | 3188 KiB | ||||
47 | Wrong answer | 20ms | 2992 KiB | ||||
subtask5 | 0/15 | ||||||
48 | Wrong answer | 21ms | 3132 KiB | ||||
49 | Wrong answer | 17ms | 3648 KiB | ||||
50 | Wrong answer | 493ms | 3184 KiB | ||||
51 | Wrong answer | 17ms | 3116 KiB | ||||
52 | Wrong answer | 108ms | 3184 KiB | ||||
53 | Accepted | 17ms | 3236 KiB | ||||
54 | Accepted | 24ms | 3216 KiB | ||||
55 | Accepted | 68ms | 3012 KiB | ||||
56 | Accepted | 563ms | 3436 KiB | ||||
57 | Accepted | 17ms | 3508 KiB | ||||
58 | Accepted | 17ms | 3528 KiB | ||||
59 | Accepted | 18ms | 3520 KiB | ||||
60 | Accepted | 21ms | 2960 KiB | ||||
61 | Accepted | 23ms | 3128 KiB | ||||
62 | Accepted | 23ms | 3128 KiB | ||||
63 | Accepted | 24ms | 3092 KiB | ||||
64 | Accepted | 513ms | 3384 KiB | ||||
65 | Accepted | 524ms | 3468 KiB | ||||
66 | Accepted | 501ms | 3496 KiB |