12039 | 2024-11-26 12:17:06 | DianaTaylor | Számjegycsere | python3 | Wrong answer 0/100 | 584ms | 3660 KiB |
t=int(input())
for i in range(t):
n=input()
k=-1
nullak=n.count("0")
if len(n)>=2:
if n[-2:] in ["00","25","50","75"]:
k=0
elif n[-2:] in ["52","05","57"]:
k=1
elif n[-1:] in ["0"] and n[:-1] in ["5"] or nullak>=2:
k=1
elif n[-1:] in ["5"] and n[:-1] in ["2"] or["7"]:
k=1
elif n[-2] == "2" and "5" in n:
k=1
elif n[-2] == "7" and "5" in n:
k=1
elif n[-2] == "5" and "0" in n:
k=1
elif n[-2] == "0" and nullak>=2:
k=1
elif "5" and "0" in n:
k=2
elif "5" and "7" in n:
k=2
elif "5" and "2" in n:
k=2
elif nullak >=2:
k=2
else:
k=-1
print(k)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 16ms | 3192 KiB | ||||
subtask2 | 0/21 | ||||||
2 | Wrong answer | 179ms | 3128 KiB | ||||
subtask3 | 0/23 | ||||||
3 | Wrong answer | 513ms | 3388 KiB | ||||
4 | Wrong answer | 526ms | 3384 KiB | ||||
5 | Wrong answer | 528ms | 3384 KiB | ||||
6 | Wrong answer | 523ms | 3384 KiB | ||||
7 | Wrong answer | 518ms | 3212 KiB | ||||
8 | Wrong answer | 518ms | 3384 KiB | ||||
9 | Wrong answer | 533ms | 3384 KiB | ||||
10 | Wrong answer | 517ms | 3384 KiB | ||||
11 | Wrong answer | 526ms | 3384 KiB | ||||
12 | Wrong answer | 513ms | 3392 KiB | ||||
13 | Wrong answer | 500ms | 3384 KiB | ||||
14 | Wrong answer | 523ms | 3384 KiB | ||||
15 | Wrong answer | 513ms | 3416 KiB | ||||
16 | Wrong answer | 504ms | 3384 KiB | ||||
17 | Wrong answer | 584ms | 3384 KiB | ||||
18 | Wrong answer | 518ms | 3384 KiB | ||||
19 | Wrong answer | 512ms | 3372 KiB | ||||
20 | Wrong answer | 575ms | 3316 KiB | ||||
21 | Wrong answer | 517ms | 3216 KiB | ||||
22 | Wrong answer | 527ms | 3384 KiB | ||||
23 | Wrong answer | 529ms | 3384 KiB | ||||
subtask4 | 0/41 | ||||||
24 | Wrong answer | 14ms | 3216 KiB | ||||
25 | Wrong answer | 14ms | 3020 KiB | ||||
26 | Wrong answer | 16ms | 3092 KiB | ||||
27 | Wrong answer | 17ms | 3128 KiB | ||||
28 | Wrong answer | 17ms | 3128 KiB | ||||
29 | Wrong answer | 16ms | 3128 KiB | ||||
30 | Wrong answer | 16ms | 3000 KiB | ||||
31 | Wrong answer | 16ms | 3108 KiB | ||||
32 | Wrong answer | 16ms | 3072 KiB | ||||
33 | Wrong answer | 16ms | 3032 KiB | ||||
34 | Wrong answer | 16ms | 3012 KiB | ||||
35 | Wrong answer | 16ms | 3028 KiB | ||||
36 | Wrong answer | 20ms | 3128 KiB | ||||
37 | Accepted | 56ms | 3128 KiB | ||||
38 | Wrong answer | 17ms | 3128 KiB | ||||
39 | Wrong answer | 17ms | 3200 KiB | ||||
40 | Wrong answer | 16ms | 3132 KiB | ||||
41 | Wrong answer | 16ms | 3208 KiB | ||||
42 | Wrong answer | 20ms | 3100 KiB | ||||
43 | Wrong answer | 20ms | 3144 KiB | ||||
44 | Wrong answer | 20ms | 3148 KiB | ||||
45 | Wrong answer | 20ms | 3204 KiB | ||||
46 | Wrong answer | 16ms | 3324 KiB | ||||
47 | Wrong answer | 19ms | 3204 KiB | ||||
subtask5 | 0/15 | ||||||
48 | Wrong answer | 24ms | 3128 KiB | ||||
49 | Wrong answer | 18ms | 3660 KiB | ||||
50 | Wrong answer | 510ms | 3204 KiB | ||||
51 | Wrong answer | 20ms | 3052 KiB | ||||
52 | Wrong answer | 115ms | 3220 KiB | ||||
53 | Wrong answer | 17ms | 3128 KiB | ||||
54 | Wrong answer | 23ms | 3128 KiB | ||||
55 | Wrong answer | 67ms | 3128 KiB | ||||
56 | Wrong answer | 518ms | 3384 KiB | ||||
57 | Accepted | 19ms | 3556 KiB | ||||
58 | Wrong answer | 17ms | 3512 KiB | ||||
59 | Wrong answer | 17ms | 3580 KiB | ||||
60 | Wrong answer | 21ms | 3128 KiB | ||||
61 | Wrong answer | 21ms | 3116 KiB | ||||
62 | Wrong answer | 23ms | 3152 KiB | ||||
63 | Wrong answer | 21ms | 3020 KiB | ||||
64 | Wrong answer | 528ms | 3384 KiB | ||||
65 | Wrong answer | 518ms | 3252 KiB | ||||
66 | Wrong answer | 527ms | 3216 KiB |