11967 | 2024-11-22 14:54:05 | redfoxdelta | Számjegycsere | python3 | Accepted 100/100 | 574ms | 3680 KiB |
# /| /| ~ ┏━━━━━━━━━━━━━━━━━┓
#( °-° ) ~ Do NOT copy!
#/づづ ~┗━━━━━━━━━━━━━━━━━┛
K = int(input())
for i in range(K):
N = input()
s = -1
phr = N.count('0')
if len(N) >= 2:
if N[-2:] in ['00','25', '50', '75']:
s = 0
elif N[-2:] in ['52', '05', '57']:
s = 1
elif N[-1] == '5' and (('2' in N) or ('7' in N)):
s = 1
elif N[-1] == '0' and (('5' in N) or phr >= 2):
s = 1
elif N[-2] in '72' and '5' in N:
s = 1
elif N[-2] == '5' and '0' in N:
s = 1
elif N[-2] == '0' and phr >= 2:
s = 1
elif ('5' in N) and (('2' in N) or ('7' in N) or ('0' in N)):
s = 2
elif phr >= 2:
s = 2
print(s)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 16ms | 3128 KiB | ||||
subtask2 | 21/21 | ||||||
2 | Accepted | 199ms | 3128 KiB | ||||
subtask3 | 23/23 | ||||||
3 | Accepted | 546ms | 3384 KiB | ||||
4 | Accepted | 522ms | 3448 KiB | ||||
5 | Accepted | 518ms | 3384 KiB | ||||
6 | Accepted | 526ms | 3452 KiB | ||||
7 | Accepted | 524ms | 3384 KiB | ||||
8 | Accepted | 540ms | 3384 KiB | ||||
9 | Accepted | 521ms | 3384 KiB | ||||
10 | Accepted | 517ms | 3384 KiB | ||||
11 | Accepted | 509ms | 3264 KiB | ||||
12 | Accepted | 509ms | 3228 KiB | ||||
13 | Accepted | 518ms | 3436 KiB | ||||
14 | Accepted | 574ms | 3384 KiB | ||||
15 | Accepted | 522ms | 3340 KiB | ||||
16 | Accepted | 523ms | 3384 KiB | ||||
17 | Accepted | 521ms | 3384 KiB | ||||
18 | Accepted | 513ms | 3384 KiB | ||||
19 | Accepted | 560ms | 3384 KiB | ||||
20 | Accepted | 532ms | 3384 KiB | ||||
21 | Accepted | 526ms | 3384 KiB | ||||
22 | Accepted | 528ms | 3680 KiB | ||||
23 | Accepted | 500ms | 3384 KiB | ||||
subtask4 | 41/41 | ||||||
24 | Accepted | 17ms | 3128 KiB | ||||
25 | Accepted | 16ms | 3320 KiB | ||||
26 | Accepted | 16ms | 3128 KiB | ||||
27 | Accepted | 16ms | 3008 KiB | ||||
28 | Accepted | 16ms | 3320 KiB | ||||
29 | Accepted | 16ms | 3148 KiB | ||||
30 | Accepted | 16ms | 3384 KiB | ||||
31 | Accepted | 16ms | 3132 KiB | ||||
32 | Accepted | 17ms | 3060 KiB | ||||
33 | Accepted | 16ms | 3128 KiB | ||||
34 | Accepted | 16ms | 3016 KiB | ||||
35 | Accepted | 17ms | 3208 KiB | ||||
36 | Accepted | 21ms | 3096 KiB | ||||
37 | Accepted | 54ms | 3020 KiB | ||||
38 | Accepted | 17ms | 3072 KiB | ||||
39 | Accepted | 16ms | 3300 KiB | ||||
40 | Accepted | 16ms | 3144 KiB | ||||
41 | Accepted | 17ms | 3128 KiB | ||||
42 | Accepted | 20ms | 3092 KiB | ||||
43 | Accepted | 20ms | 3180 KiB | ||||
44 | Accepted | 19ms | 3012 KiB | ||||
45 | Accepted | 20ms | 3172 KiB | ||||
46 | Accepted | 17ms | 3096 KiB | ||||
47 | Accepted | 19ms | 3184 KiB | ||||
subtask5 | 15/15 | ||||||
48 | Accepted | 25ms | 3128 KiB | ||||
49 | Accepted | 19ms | 3468 KiB | ||||
50 | Accepted | 504ms | 3280 KiB | ||||
51 | Accepted | 19ms | 3036 KiB | ||||
52 | Accepted | 119ms | 3260 KiB | ||||
53 | Accepted | 17ms | 3128 KiB | ||||
54 | Accepted | 21ms | 3128 KiB | ||||
55 | Accepted | 68ms | 3128 KiB | ||||
56 | Accepted | 532ms | 3400 KiB | ||||
57 | Accepted | 18ms | 3564 KiB | ||||
58 | Accepted | 17ms | 3428 KiB | ||||
59 | Accepted | 17ms | 3560 KiB | ||||
60 | Accepted | 23ms | 3012 KiB | ||||
61 | Accepted | 21ms | 3220 KiB | ||||
62 | Accepted | 24ms | 3128 KiB | ||||
63 | Accepted | 21ms | 3056 KiB | ||||
64 | Accepted | 521ms | 3272 KiB | ||||
65 | Accepted | 532ms | 3388 KiB | ||||
66 | Accepted | 570ms | 3384 KiB |