n = int(input())
s = list(input())
for i in range(n):
if s[i].isdigit():
s[i] = int(s[i])
s.reverse()
x = s.index("x")
for i in range(10):
a = s[:]
a[x] = i
zbroj = 0
for j in range(1, n):
if j % 2:
a[j] = a[j] * 2
if a[j] > 10:
a[j] = a[j] % 10 + a[j] // 10
zbroj += a[j]
if (zbroj * 9) % 10 == a[0]:
print(i)
break
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
22 ms |
3308 KB |
Output isn't correct |
2 |
Incorrect |
23 ms |
3308 KB |
Output isn't correct |
3 |
Incorrect |
23 ms |
3300 KB |
Output isn't correct |
4 |
Incorrect |
23 ms |
3308 KB |
Output isn't correct |
5 |
Incorrect |
22 ms |
3300 KB |
Output isn't correct |
6 |
Incorrect |
23 ms |
3308 KB |
Output isn't correct |
7 |
Incorrect |
23 ms |
3300 KB |
Output isn't correct |
8 |
Incorrect |
24 ms |
3308 KB |
Output isn't correct |
9 |
Incorrect |
23 ms |
3308 KB |
Output isn't correct |
10 |
Incorrect |
26 ms |
3352 KB |
Output isn't correct |