Submission #223137

# Submission time Handle Problem Language Result Execution time Memory
223137 2020-04-14T23:24:18 Z Haunted_Cpp Slon (COCI15_slon) Python 3
120 / 120
318 ms 25452 KB
n = str (input())
p, m = map (int, input().split())

a = eval(n.replace("x", str(1))) 
b = eval(n.replace("x", str(2)))

start = eval(n.replace("x", str(0))) 
diff = b - a

for i in range (1000000):
  if (start == p) :
    print(i)
    break
  start += diff
  start %= m
  
# Verdict Execution time Memory Grader output
1 Correct 318 ms 3340 KB Output is correct
2 Correct 251 ms 25452 KB Output is correct
3 Correct 41 ms 3400 KB Output is correct
4 Correct 102 ms 3436 KB Output is correct
5 Correct 36 ms 3484 KB Output is correct
6 Correct 229 ms 4368 KB Output is correct
7 Correct 67 ms 5332 KB Output is correct
8 Correct 88 ms 9456 KB Output is correct
9 Correct 111 ms 11444 KB Output is correct
10 Correct 164 ms 18300 KB Output is correct