s_id
string
p_id
string
u_id
string
date
string
language
string
original_language
string
filename_ext
string
status
string
cpu_time
string
memory
string
code_size
string
code
string
error
string
stdout
string
s752272922
p02550
u934119021
1600636342
Python
Python (3.8.2)
py
Runtime Error
2206
9620
380
n, x, m = map(int, input().split()) ans = 0 a = x arr = [] for i in range(n): if a in arr: break else: arr.append(a) a = a ** 2 % m f = sum(arr[:arr.index(a)]) r = sum(arr[arr.index(a):]) k = (n - arr.index(a)) // (len(arr) - arr.index(a)) b = sum(arr[arr.index(a): arr.index(a) + (n - (arr.index(a) + (len...
Traceback (most recent call last): File "/tmp/tmp9use40sq/tmplwg4nrhf.py", line 1, in <module> n, x, m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s489741069
p02550
u576432509
1600635874
Python
PyPy3 (7.3.0)
py
Runtime Error
749
74512
1107
n,x,m=map(int,input().split()) if x==0: print(0) elif x==1: print(n) elif m==1: print(0) elif n<=m*2: asum=x ai=x for i in range(1,n): ai=(ai*ai)%m asum+=ai print(asum) else: aa=[] ai=x icnt=0 asum=0 while not ai in aa: asum+=ai aa.ap...
Traceback (most recent call last): File "/tmp/tmptbw70rwv/tmpdytr12me.py", line 1, in <module> n,x,m=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s123348365
p02550
u325282913
1600634362
Python
PyPy3 (7.3.0)
py
Runtime Error
85
74944
906
N, X, M = map(int, input().split()) if X == 0: print(0) exit() if X == 1: print(N) exit() check = [0]*(M+1) check[X] += 1 A = X last_count = 0 while True: A = (A**2)%M if check[A] != 0: last_count = sum(check) target_value = A break check[A] += 1 A2 = X first_count = ...
Traceback (most recent call last): File "/tmp/tmptqy3ou_l/tmpa1g1zwel.py", line 1, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s920005840
p02550
u325282913
1600634211
Python
PyPy3 (7.3.0)
py
Runtime Error
85
75428
871
N, X, M = map(int, input().split()) if X == 0: print(0) exit() check = [0]*(M+1) check[X] += 1 A = X last_count = 0 while True: A = (A**2)%M if check[A] != 0: last_count = sum(check) target_value = A break check[A] += 1 A2 = X first_count = 0 while True: first_count += 1 ...
Traceback (most recent call last): File "/tmp/tmpsd3p16rn/tmpeuz0ju8b.py", line 1, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s069245351
p02550
u325282913
1600634178
Python
PyPy3 (7.3.0)
py
Runtime Error
83
75536
919
N, X, M = map(int, input().split()) if X == 0: print(0) exit() check = [0]*(M+1) check[X] += 1 A = X last_count = 0 while True: A = (A**2)%M if check[A] != 0: last_count = sum(check) target_value = A break check[A] += 1 A2 = X first_count = 0 while True: first_count += 1 ...
Traceback (most recent call last): File "/tmp/tmpgqnadr6u/tmpwvz6drft.py", line 1, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s816328181
p02550
u325282913
1600633076
Python
PyPy3 (7.3.0)
py
Runtime Error
84
75244
808
N, X, M = map(int, input().split()) check = [0]*(M+1) check[X] += 1 A = X last_count = 0 while True: A = (A**2)%M if check[A] != 0: last_count = sum(check) target_value = A break check[A] += 1 A2 = X first_count = 0 while True: first_count += 1 A2 = (A2**2)%M if A2 == tar...
Traceback (most recent call last): File "/tmp/tmpmtq65vn1/tmpxjzyeq8b.py", line 1, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s183791731
p02550
u970449052
1600632413
Python
Python (3.8.2)
py
Runtime Error
80
13324
339
N, X, M = map(int, input().split()) if X == 0: print(0) exit() tx = X % M tl = [] ts = set() ttl = [] for i in range(N): tl.append(tx) ts.add(tx) tx = pow(tx, 2, M) if tx in ts: ttl = tl[tl.index(tx):] break ans = sum(tl) d, m = divmod(N-len(tl), len(ttl)) ans += sum(ttl)*d+sum(t...
Traceback (most recent call last): File "/tmp/tmplje4q1ri/tmp7loa9247.py", line 1, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s108310231
p02550
u970449052
1600632384
Python
Python (3.8.2)
py
Runtime Error
78
13468
328
N, X, M = map(int, input().split()) if X == 0: print(0) tx = X % M tl = [] ts = set() ttl = [] for i in range(N): tl.append(tx) ts.add(tx) tx = pow(tx, 2, M) if tx in ts: ttl = tl[tl.index(tx):] break ans = sum(tl) d, m = divmod(N-len(tl), len(ttl)) ans += sum(ttl)*d+sum(ttl[:m]) pri...
Traceback (most recent call last): File "/tmp/tmp0o5xaez1/tmpvnpcru5p.py", line 1, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s253553515
p02550
u970449052
1600632260
Python
Python (3.8.2)
py
Runtime Error
79
13280
304
N, X, M = map(int, input().split()) tx = X % M tl = [] ts = set() ttl = [] for i in range(N): tl.append(tx) ts.add(tx) tx = pow(tx, 2, M) if tx in ts: ttl = tl[tl.index(tx):] break ans = sum(tl) d, m = divmod(N-len(tl), len(ttl)) ans += sum(ttl)*d+sum(ttl[:m]) print(ans)
Traceback (most recent call last): File "/tmp/tmpd7cz5ctj/tmpyseoj032.py", line 1, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s209752973
p02550
u970449052
1600631940
Python
Python (3.8.2)
py
Runtime Error
2206
9712
278
N, X, M = map(int, input().split()) tx = X % M tl = [] ttl = [] for i in range(N): tl.append(tx) tx = pow(tx, 2, M) if tx in tl: ttl = tl[tl.index(tx):] break ans = sum(tl) d, m = divmod(N-len(tl), len(ttl)) ans += sum(ttl)*d+sum(ttl[:m]) print(ans)
Traceback (most recent call last): File "/tmp/tmpx1lr7xf3/tmppjtey0ak.py", line 1, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s035747234
p02550
u325282913
1600627984
Python
PyPy3 (7.3.0)
py
Runtime Error
87
75132
791
N, X, M = map(int, input().split()) check = [0]*(M+1) check[X] += 1 A = X while True: A = (A**2)%M if check[A] != 0: last_count = sum(check) target_value = A break check[A] += 1 A2 = X first_count = 0 while True: first_count += 1 A2 = (A2**2)%M if A2 == target_value: ...
Traceback (most recent call last): File "/tmp/tmp9i8c0do7/tmpsxap5rv9.py", line 1, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s893194628
p02550
u576432509
1600622370
Python
PyPy3 (7.3.0)
py
Runtime Error
751
74712
767
n,x,m=map(int,input().split()) if x==0: print(0) elif m==1: print(0) elif n<=m*3: asum=x ai=x for i in range(1,n): ai=(ai*ai)%m asum+=ai print(asum) else: aa=[] ai=x icnt=0 asum=0 while not ai in aa: asum+=ai aa.append(ai) ai=(ai...
Traceback (most recent call last): File "/tmp/tmpw2ivspas/tmppxnt6k3q.py", line 2, in <module> n,x,m=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s494711244
p02550
u576432509
1600622161
Python
PyPy3 (7.3.0)
py
Runtime Error
753
74724
743
n,x,m=map(int,input().split()) if x==0: print(0) elif n<=m*3: asum=x ai=x for i in range(1,n): ai=(ai*ai)%m asum+=ai print(asum) else: aa=[] ai=x icnt=0 asum=0 while not ai in aa: asum+=ai aa.append(ai) ai=(ai*ai)%m icnt+=1 ...
Traceback (most recent call last): File "/tmp/tmpgmztc8m3/tmpovvdo33h.py", line 2, in <module> n,x,m=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s423864748
p02550
u576432509
1600621950
Python
PyPy3 (7.3.0)
py
Runtime Error
754
74264
719
n,x,m=map(int,input().split()) if n<=m*3: asum=x ai=x for i in range(1,n): ai=(ai*ai)%m asum+=ai print(asum) else: aa=[] ai=x icnt=0 asum=0 while not ai in aa: asum+=ai aa.append(ai) ai=(ai*ai)%m icnt+=1 asum0=0 ai0=x ...
Traceback (most recent call last): File "/tmp/tmpp6cdepij/tmpd9dwsola.py", line 2, in <module> n,x,m=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s355657467
p02550
u350491208
1600621916
Python
Python (3.8.2)
py
Runtime Error
85
16376
585
n, x, m = map(int, input().split()) ida = [-1] * (m + 1) a = [-1] * (m + 1) sa = [-1] * (m + 1) a[1] = x sa[1] = x ida[x] = 1 l_len = 1 l_start = 1 for i in range(2, m + 1): fx = a[i - 1] ** 2 % m if ida[fx] < 0: ida[fx] = i a[i] = fx sa[i] = sa[i - 1] + a[i] else: a[i] = fx ...
Traceback (most recent call last): File "/tmp/tmp4moi33qt/tmp7_0ni78x.py", line 1, in <module> n, x, m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s680446259
p02550
u152741807
1600621245
Python
Python (3.8.2)
py
Runtime Error
2206
30164
448
import numpy as np import sys n,x,m = (int(i) for i in input().split()) l = np.array([x]) ans = x memo_array = [-1]*(m+1) for i in range(1,n): ans = ans**2%m idx = memo_array[ans] if idx != -1: loop_num, mod = divmod((n-idx),(i-idx)) print(np.sum(l[:loop_start]) + np.sum(l[loop_start:])*(lo...
Traceback (most recent call last): File "/tmp/tmp07ye1cn_/tmpdbe4tpbw.py", line 4, in <module> n,x,m = (int(i) for i in input().split()) ^^^^^^^ EOFError: EOF when reading a line
s613817804
p02550
u152741807
1600621073
Python
Python (3.8.2)
py
Runtime Error
2206
28808
494
import numpy as np import sys n,x,m = (int(i) for i in input().split()) l = np.array([x]) ans = x memo_array = [False]*(m+1) for i in range(1,n): ans = ans**2%m if memo_array[ans]: loop_start = int(np.where(l==ans)[0]) loop_num, mod = divmod((n-loop_start),(i-loop_start)) print(np.sum(l...
Traceback (most recent call last): File "/tmp/tmpbahof69u/tmpobj998xa.py", line 4, in <module> n,x,m = (int(i) for i in input().split()) ^^^^^^^ EOFError: EOF when reading a line
s250536064
p02550
u576432509
1600620969
Python
PyPy3 (7.3.0)
py
Runtime Error
754
74520
722
n,x,m=map(int,input().split()) if n<=m*3: asum=x ai=x for i in range(1,n): ai=(ai*ai)%m asum+=ai print(asum) else: aa=[] ai=x icnt=0 asum=0 while not ai in aa: asum+=ai aa.append(ai) ai=(ai*ai)%m icnt+=1 asum0=0 ai0=x ...
Traceback (most recent call last): File "/tmp/tmpvjqgb2bk/tmpj3jgr0o1.py", line 2, in <module> n,x,m=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s705268888
p02550
u152741807
1600620890
Python
Python (3.8.2)
py
Runtime Error
2154
28692
490
import numpy as np import sys n,x,m = (int(i) for i in input().split()) l = np.array([x]) ans = x memo_array = [False]*m for i in range(1,n): ans = ans**2%m if memo_array[ans]: loop_start = int(np.where(l==ans)[0]) loop_num, mod = divmod((n-loop_start),(i-loop_start)) print(np.sum(l[:lo...
Traceback (most recent call last): File "/tmp/tmpdmlvbxv4/tmpqjsefkbu.py", line 4, in <module> n,x,m = (int(i) for i in input().split()) ^^^^^^^ EOFError: EOF when reading a line
s597012581
p02550
u620084012
1600617851
Python
PyPy3 (7.3.0)
py
Runtime Error
81
75236
404
N, X, M = map(int,input().split()) if X == 0: print(0) exit(0) t = X A = [0]*(M+1) A[X] = 1 B = [X] k = 1 while True: X = (X*X)%M if X == 0 or k == N: print(sum(B)) exit(0) elif A[X] != 0: s, e = A[X], k r = k-A[X] break else: A[X] = k B.ap...
Traceback (most recent call last): File "/tmp/tmpprjf_nvc/tmp3tg63khy.py", line 1, in <module> N, X, M = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s691075590
p02550
u620084012
1600617155
Python
PyPy3 (7.3.0)
py
Runtime Error
80
75356
368
N, X, M = map(int,input().split()) t = X A = [0]*(M+1) A[X] = 1 B = [X] k = 1 while True: X = (X*X)%M if X == 0 or k == N: print(sum(B)) exit(0) elif A[X] != 0: s, e = A[X], k r = k-A[X] break else: A[X] = k B.append(X) k += 1 print(sum(B[:...
Traceback (most recent call last): File "/tmp/tmpd3_grmpw/tmpd2eqyth8.py", line 1, in <module> N, X, M = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s052150107
p02550
u620084012
1600617026
Python
PyPy3 (7.3.0)
py
Runtime Error
84
75464
366
N, X, M = map(int,input().split()) t = X A = [0]*(M) A[X] = 1 B = [X] k = 1 while True: X = (X*X)%M if X == 0 or k == N: print(sum(B)) exit(0) elif A[X] != 0: s, e = A[X], k r = k-A[X] break else: A[X] = k B.append(X) k += 1 print(sum(B[:s]...
Traceback (most recent call last): File "/tmp/tmpm8raz2_6/tmpfogvn_lh.py", line 1, in <module> N, X, M = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s134315321
p02550
u620084012
1600616595
Python
PyPy3 (7.3.0)
py
Runtime Error
85
75392
347
N, X, M = map(int,input().split()) t = X A = [0]*(M) A[X] = 1 B = [X] k = 1 while True: X = (X*X)%M if X == 0: print(sum(B)) exit(0) elif A[X] != 0: s, e = A[X], k r = k-A[X] break else: A[X] = k B.append(X) k += 1 print(sum(B[:s-2])+(N//r)...
Traceback (most recent call last): File "/tmp/tmp488tfxy7/tmp0wolwqis.py", line 1, in <module> N, X, M = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s949948961
p02550
u620084012
1600616388
Python
PyPy3 (7.3.0)
py
Runtime Error
80
75308
334
N, X, M = map(int,input().split()) t = X A = [0]*(M) A[X] = 1 B = [X] k = 1 while True: X = (X*X)%M if X == 0: print(sum(B)) exit(0) elif A[X] != 0: s, e = A[X], k r = k-A[X] break else: A[X] = k B.append(X) k += 1 print((N//r)*sum(B[s:e])+...
Traceback (most recent call last): File "/tmp/tmp02gb41mz/tmpuhv5hw52.py", line 1, in <module> N, X, M = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s860105895
p02550
u545368057
1600611790
Python
Python (3.8.2)
py
Runtime Error
154
14752
708
n,x,m = map(int, input().split()) b = x%m add = 0 # nใŒmไปฅไธ‹ใชใ‚‰ๅ…จ้ƒจ่ถณใ›ใฐ่‰ฏใ„ ans = 0 if n <= m: for i in range(n): ans += b b = pow(b,2,m) print(ans) exit() # nใŒmใ‚ˆใ‚Šๅคงใฎใจใใ€ๅŠน็އๅŒ– cnt = 0 while 2 ** cnt < m: cnt += 1 # ไฝๆ•ฐใจๅˆๆœŸๅ€คใ‚’ๅ‡บใ™ s = set() for i in range(m): if i < cnt: add += b ...
Traceback (most recent call last): File "/tmp/tmp82bm18zz/tmpn39j4lwj.py", line 1, in <module> n,x,m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s641064008
p02550
u545368057
1600611640
Python
Python (3.8.2)
py
Runtime Error
154
14588
665
n,x,m = map(int, input().split()) b = x%m add = 0 # nใŒmไปฅไธ‹ใชใ‚‰ๅ…จ้ƒจ่ถณใ›ใฐ่‰ฏใ„ ans = 0 if n <= m: for i in range(n): ans += b b = pow(b,2,m) print(ans) exit() # nใŒmใ‚ˆใ‚Šๅคงใฎใจใใ€ๅŠน็އๅŒ– cnt = 0 while 2 ** cnt < m: cnt += 1 # ไฝๆ•ฐใจๅˆๆœŸๅ€คใ‚’ๅ‡บใ™ s = set() for i in range(m): if i < cnt: add += b ...
Traceback (most recent call last): File "/tmp/tmpt6971qhr/tmpxhp3wj3v.py", line 1, in <module> n,x,m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s457118953
p02550
u545368057
1600611603
Python
Python (3.8.2)
py
Runtime Error
162
14732
688
n,x,m = map(int, input().split()) b = x%m add = 0 # nใŒmไปฅไธ‹ใชใ‚‰ๅ…จ้ƒจ่ถณใ›ใฐ่‰ฏใ„ ans = 0 if n <= m: for i in range(n): ans += b b = pow(b,2,m) print(ans) exit() # nใŒmใ‚ˆใ‚Šๅคงใฎใจใใ€ๅŠน็އๅŒ– cnt = 0 while 2 ** cnt < m: cnt += 1 # ไฝๆ•ฐใจๅˆๆœŸๅ€คใ‚’ๅ‡บใ™ s = set() for i in range(m): if i < cnt: add += b ...
Traceback (most recent call last): File "/tmp/tmp62x3y9_s/tmp3png1cep.py", line 1, in <module> n,x,m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s638170596
p02550
u054514819
1600611155
Python
PyPy3 (7.3.0)
py
Runtime Error
89
86804
596
import sys def input(): return sys.stdin.readline().strip() def mapint(): return map(int, input().split()) sys.setrecursionlimit(10**9) N, X, mod = mapint() first = set() second = set() in_loop = [] ans = 0 for i in range(min(10**5*2, N)): if X in first: if X in second: break in_loop.ap...
Traceback (most recent call last): File "/tmp/tmp454d5gj3/tmp2wmuo8te.py", line 6, in <module> N, X, mod = mapint() ^^^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0)
s051622869
p02550
u288430479
1600610422
Python
Python (3.8.2)
py
Runtime Error
71
11180
825
n,x,m = map(int,input().split()) mod = m ans = 0 bit = [-1 for i in range(m)] cycle = False for i in range(n): if i == 0 : a = x bit[a] = i ans += a else: a = (a**2)% mod if bit[a] != -1: cy_st = bit[a] cy_fi = i -1 cycle = True ...
Traceback (most recent call last): File "/tmp/tmp6qgh9ihc/tmpe8gung1c.py", line 1, in <module> n,x,m = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s777753093
p02550
u893063840
1600610371
Python
Python (3.8.2)
py
Runtime Error
50
15684
348
n, x, m = map(int, input().split()) a = x li = [a] exists = dict() for i in range(2, n + 1): a = a * a % m if a in exists: break li.append(a) exists[a] = i ans = sum(li) if i != n: loop, left = divmod(n - i + 1, i - exists[a]) ans += loop * sum(li[exists[a]-1:]) + sum(li[exists[a]-1:ex...
Traceback (most recent call last): File "/tmp/tmpsvnxn7b9/tmptdob5907.py", line 1, in <module> n, x, m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s839857679
p02550
u288430479
1600610370
Python
Python (3.8.2)
py
Runtime Error
68
11344
825
n,x,m = map(int,input().split()) mod = m ans = 0 bit = [-1 for i in range(m)] cycle = False for i in range(n): if i == 0 : a = x bit[a] = i ans += a else: a = (a**2)% mod if bit[a] != -1: cy_st = bit[a] cy_fi = i -1 cycle = True ...
Traceback (most recent call last): File "/tmp/tmpxwn9jn8f/tmpxc3p60hu.py", line 1, in <module> n,x,m = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s408257469
p02550
u288430479
1600609426
Python
Python (3.8.2)
py
Runtime Error
67
11204
730
n,x,m = map(int,input().split()) mod = m ans = 0 bit = [-1 for i in range(m)] cycle = False for i in range(n): if i == 0 : a = x bit[a] = i ans += a else: a = (a**2)% mod if bit[a] != -1: cy_st = bit[a] cy_fi = i -1 cycle = True ...
Traceback (most recent call last): File "/tmp/tmphedzjuqb/tmp_n1t7axi.py", line 1, in <module> n,x,m = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s410841122
p02550
u397953026
1600605687
Python
PyPy3 (7.3.0)
py
Runtime Error
777
78088
863
n,x,m = map(int,input().split()) mod = m num = [] ans = 0 cnt = 0 ch = x #ใƒซใƒผใƒ—ใฎๅง‹ใพใ‚Šใ‚’็‰นๅฎš while True: if ch not in num: num.append(ch) else: st = ch #ใƒซใƒผใƒ—ใฎ้–‹ๅง‹ใ—ใฆใ„ใ‚‹้…ๅˆ—ใฎๅˆใ‚ใฎๆ•ฐๅญ— break ch *= ch ch %= mod #ใƒซใƒผใƒ—ใฎๅง‹ใพใ‚Šใฎ้…ๅˆ—ใฎๆทปใˆๅญ—ใ‚’็‰นๅฎš for i in range(len(num)): if num[i] == st: stnum = i #ใƒซใƒผใƒ—้–‹...
Traceback (most recent call last): File "/tmp/tmprew8uwp7/tmpw4s1p1qn.py", line 1, in <module> n,x,m = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s763870115
p02550
u137542041
1600604817
Python
Python (3.8.2)
py
Runtime Error
60
15784
430
N, X, M = map(int, input().split()) nxt = X lst = [] dic = {} for i in range(M): if nxt in dic: loop_st = dic[nxt] loop_ed = i - 1 break lst.append(nxt) dic[nxt] = i nxt = (nxt ** 2) % M v = N - loop_st q, r = divmod(v, loop_ed - loop_st + 1) pre_sum = sum(lst[:loop_st]) l...
Traceback (most recent call last): File "/tmp/tmprv2wo_z0/tmp_a1w231o.py", line 1, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s323541207
p02550
u356567743
1600604777
Python
Python (3.8.2)
py
Runtime Error
26
9092
141
n, x, m = map(int, input().split()) l = [] l[0] = x ans = x for i in range(n): l[i] = (l[i-1]*l[i-1]) % m ans += l[i] print(ans)
Traceback (most recent call last): File "/tmp/tmpuedvflzq/tmpjsk3jemw.py", line 1, in <module> n, x, m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s422199072
p02550
u137542041
1600604764
Python
Python (3.8.2)
py
Runtime Error
58
15704
394
N, X, M = map(int, input().split()) nxt = X lst = [] dic = {} for i in range(M): if nxt in dic: loop_st = dic[nxt] loop_ed = i - 1 break lst.append(nxt) dic[nxt] = i nxt = (nxt ** 2) % M v = N - loop_st q, r = divmod(v, loop_ed - loop_st + 1) pre_sum = sum(lst[:loop_st]) l...
Traceback (most recent call last): File "/tmp/tmp568m26ft/tmp7xi4qm05.py", line 1, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s740702970
p02550
u015767468
1600603619
Python
Python (3.8.2)
py
Runtime Error
2205
9508
354
N,X,M=list(map(int,input().split())) C=[] C.append(X) for i in range(N): t=(C[i]**2)%M if t not in C: C.append(t) else: k=C.index(t) L=i-k+1 break Cinitial=C[0:k] Crepeat=C[k:] sumCrepeat=sum(Crepeat) sumCinitial=sum(Cinitial) S=(N-k)//L print(sumCinitial+sumCrepeat*S+sum(Cr...
Traceback (most recent call last): File "/tmp/tmpidmd8hgx/tmp2bhwg81x.py", line 1, in <module> N,X,M=list(map(int,input().split())) ^^^^^^^ EOFError: EOF when reading a line
s775040023
p02550
u015767468
1600603501
Python
Python (3.8.2)
py
Runtime Error
26
9056
373
N,X,M=list(map(int,input().split())) C=[] C.append(X) for i in range(M+3): t=(C[i]**2)%M if t not in C: C.append(t) else: k=C.index(t) L=i-k+1 break Cinitial=C[0:k] Crepeat=C[k:] sumCrepeat=sum(C[i] for i in range(k:)) sumCinitial=sum(Cinitial) S=(N-k)//L print(sumCinitial+s...
File "/tmp/tmptal3vgpp/tmpmna0c218.py", line 15 sumCrepeat=sum(C[i] for i in range(k:)) ^ SyntaxError: invalid syntax
s964633350
p02550
u414050834
1600602221
Python
Python (3.8.2)
py
Runtime Error
2206
9636
409
n,x,m=map(int,input().split()) ans=0 p=0 l=[x] o=0 if x%m==0: print(x) else: for i in range(1,n): s=(l[i-1]**2)%m if s==0: break if s in l: p=1 o=list.index(s) break else: l.append(s) if p==1: t=sum(l[o:]) k=(n-o)//(len(l)-1) #ใƒซใƒผใƒ—ไฝ•ๅ›žๅ›žใ‚‹ใ‹ j=(n-o)%(len(l)...
Traceback (most recent call last): File "/tmp/tmpf5ubicw_/tmpuml0ur6e.py", line 1, in <module> n,x,m=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s768936512
p02550
u414050834
1600601805
Python
Python (3.8.2)
py
Runtime Error
2205
9604
418
n,x,m=map(int,input().split()) ans=0 p=0 l=[x] if x%m==0: print(x) else: for i in range(1,n): s=(l[i-1]**2)%m if s==0: p=1 break if s in l: p=2 break else: l.append(s) if p==2: t=sum(l[1:]) k=(n-1)//(len(l)-1) #ใƒซใƒผใƒ—ไฝ•ๅ›žๅ›žใ‚‹ใ‹ j=(n-1)%(len(l)-1) ans=x+t*k+sum...
Traceback (most recent call last): File "/tmp/tmp3vvi_stw/tmpq2g5dm12.py", line 1, in <module> n,x,m=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s721584512
p02550
u350491208
1600601396
Python
Python (3.8.2)
py
Runtime Error
573
100976
177
n, x, m = map(int, input().split()) a = [0] * (n+1) sa = [0] * (n+1) a[1] = x sa[1] = x for i in range(2, n+1): a[i] = a[i-1]**2 % m sa[i] = sa[i-1] + a[i] print(sa[n])
Traceback (most recent call last): File "/tmp/tmpgba7pi_k/tmp_v1qc_um.py", line 1, in <module> n, x, m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s826350184
p02550
u061835391
1600600356
Python
Python (3.8.2)
py
Runtime Error
25
9064
90
n,x,m=map(int,input().split()) a=x for i in range(0,n): p=(a*a)%m w=w+p a=p print(w)
Traceback (most recent call last): File "/tmp/tmp8adc8ehv/tmprd3lmd6m.py", line 1, in <module> n,x,m=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s815595962
p02550
u056358163
1600599543
Python
Python (3.8.2)
py
Runtime Error
65
15588
582
N, X, M = map(int, input().split()) ans = X x = X C = [0, x] Xd = [-1] * (M+1) Xd[x] = 0 Xl = [x] for i in range(1, N): x = x**2 % M if Xd[x] > -1: break Xd[x] = i Xl.append(x) ans += x C.append(ans) # print(Xl) # print(C) # print(Xd[x], i) loop_len = i - Xd[x] # print(loop_len) if ...
Traceback (most recent call last): File "/tmp/tmp5oeiahjm/tmpw398fshw.py", line 1, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s917811753
p02550
u056358163
1600599503
Python
Python (3.8.2)
py
Runtime Error
66
15608
579
N, X, M = map(int, input().split()) ans = X x = X C = [0, x] Xd = [-1] * (M+1) Xd[x] = 0 Xl = [x] for i in range(1, N): x = x**2 % M if Xd[x] > -1: break Xd[x] = i Xl.append(x) ans += x C.append(ans) # print(Xl) # print(C) # print(Xd[x], i) loop_len = i - Xd[x] # print(loop_len) if ...
Traceback (most recent call last): File "/tmp/tmpcvp4ej7q/tmplqe7ilyn.py", line 1, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s009109144
p02550
u056358163
1600599440
Python
Python (3.8.2)
py
Runtime Error
68
15740
580
N, X, M = map(int, input().split()) ans = X x = X C = [0, x] Xd = [-1] * (M+1) Xd[x] = 0 Xl = [x] for i in range(1, N): x = x**2 % M if Xd[x] > -1: break Xd[x] = i Xl.append(x) ans += x C.append(ans) # print(Xl) # print(C) # print(Xd[x], i) loop_len = i - Xd[x] # print(loop_len) if ...
Traceback (most recent call last): File "/tmp/tmpju_oxxwb/tmp439r2gol.py", line 1, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s871521650
p02550
u056358163
1600598847
Python
Python (3.8.2)
py
Runtime Error
62
15524
570
N, X, M = map(int, input().split()) ans = X x = X C = [0, x] Xd = [-1] * (M+1) Xd[x] = 0 Xl = [x] for i in range(1, N): x = x**2 % M if Xd[x] > -1: break Xd[x] = i Xl.append(x) ans += x C.append(ans) # print(Xl) # print(C) # print(Xd[x], i) S = C[i] - C[Xd[x]] # print(S) loop_len = ...
Traceback (most recent call last): File "/tmp/tmpiuu4u0sc/tmpold09l_k.py", line 1, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s578367967
p02550
u056358163
1600598199
Python
Python (3.8.2)
py
Runtime Error
103
20696
709
from collections import defaultdict N, X, M = map(int, input().split()) if M == 0: print(X) exit() ans = X x = X m = [] for i in range(0, M+1): m.append((i ** 2) % M) C = [x] Xd = defaultdict(lambda: -1) Xd[x] = 0 Xl = [x] for i in range(1, N): x = m[x] if Xd[x] > -1: # print(i) ...
Traceback (most recent call last): File "/tmp/tmpudtxdd7m/tmp0vpefi2c.py", line 3, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s016449747
p02550
u056358163
1600597778
Python
Python (3.8.2)
py
Runtime Error
105
20624
673
from collections import defaultdict N, X, M = map(int, input().split()) ans = X x = X m = [] for i in range(0, M+1): m.append((i ** 2) % M) C = [x] Xd = defaultdict(lambda: -1) Xd[x] = 0 Xl = [x] for i in range(1, N): x = m[x] if Xd[x] > -1: # print(i) break Xd[x] = i Xl.a...
Traceback (most recent call last): File "/tmp/tmp63rc2e42/tmpiivd0q0v.py", line 3, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s500445845
p02550
u179169725
1600596820
Python
PyPy3 (7.3.0)
py
Runtime Error
86
82524
2739
import sys sys.setrecursionlimit(1 << 25) readline = sys.stdin.buffer.readline read = sys.stdin.readline # ๆ–‡ๅญ—ๅˆ—่ชญใฟ่พผใ‚€ๆ™‚ใฏใ“ใฃใก ra = range enu = enumerate def exit(*argv, **kwarg): print(*argv, **kwarg) sys.exit() def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv)) # ๅ—ใ‘ๆธกใ•ใ‚ŒใŸใ™ในใฆใฎ่ฆ็ด ใ‹ใ‚‰subใ ใ‘ๅผ•ใ.ใƒชใ‚นใƒˆใ‚’*ใ‚’ใคใ‘ใฆๅฑ•้–‹...
Traceback (most recent call last): File "/tmp/tmpq39gxbji/tmp3rfvmf_x.py", line 85, in <module> N, X, M = ints() ^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0)
s356620838
p02550
u433380437
1600595988
Python
PyPy3 (7.3.0)
py
Runtime Error
2212
219460
598
n,x,m = map(int,input().split()) y=x A=[] A.append(y) cnt=1 su=x for i in range(n): y=(y**2)%m cnt+=1 if y in A: break else: A.append(y) su+=y if len(A)==n: print(su) else: c=A.index(y) #ๅ‘จๆœŸใฎใฏใ˜ใ‚ d=cnt-(c+1) #ๅ‘จๆœŸใฎใฏใ˜ใ‚ใ‹ใ‚‰ๆฌกใฎๅ‘จๆœŸใฎใฏใ˜ใ‚ใงๅ€‹ๆ•ฐใ‚’ๆฑ‚ใ‚ใ‚‹ e=sum(A[:c]) #ๅ‘จๆœŸใซๅ…ฅใ‚‹...
Traceback (most recent call last): File "/tmp/tmpgcg6hcn1/tmpyli_3zci.py", line 1, in <module> n,x,m = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s095843954
p02550
u433380437
1600595905
Python
PyPy3 (7.3.0)
py
Runtime Error
782
77456
598
n,x,m = map(int,input().split()) y=x A=[] A.append(y) cnt=1 su=x for i in range(n): y=(y**2)%m cnt+=1 if y in A: break else: A.append(y) su+=y if len(A)==N: print(su) else: c=A.index(y) #ๅ‘จๆœŸใฎใฏใ˜ใ‚ d=cnt-(c+1) #ๅ‘จๆœŸใฎใฏใ˜ใ‚ใ‹ใ‚‰ๆฌกใฎๅ‘จๆœŸใฎใฏใ˜ใ‚ใงๅ€‹ๆ•ฐใ‚’ๆฑ‚ใ‚ใ‚‹ e=sum(A[:c]) #ๅ‘จๆœŸใซๅ…ฅใ‚‹...
Traceback (most recent call last): File "/tmp/tmp9xi59ulk/tmpjz21qbai.py", line 1, in <module> n,x,m = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s493748662
p02550
u520276780
1600595495
Python
Python (3.8.2)
py
Runtime Error
55
13648
470
#ๅ‘จๆœŸmไปฅไธ‹ n,x,m=map(int, input().split()) used = [0]*(m+1) used_list=[] pre=x flag0=False s=-1;t=-1 for i in range(m+1): if pre==0: flag0=True break now=(pre*pre)%m if used[pre]: s=used[pre] break used[pre]=i used_list.append(pre) pre=now l=len(used_list[s:])...
Traceback (most recent call last): File "/tmp/tmpo1kxffdx/tmprbfw1zq0.py", line 3, in <module> n,x,m=map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s181574300
p02550
u666550725
1600587860
Python
PyPy3 (7.3.0)
py
Runtime Error
80
79688
372
N, X, M = map(int, input().split()) B = [0 for i in range(M+1)] C = [0 for i in range(M)] ans = 0 f = 0 for i in range(1, N+1): B[i] = B[i-1] + X if C[X] != 0: ans += ((N-C[X]+1) // (i-C[X])) * (B[i-1] - B[C[X]-1]) ans += B[C[X] + (N-C[X]+1) % (i-C[X]) - 1] f = 1 break else: C[X] = i X = (X ...
Traceback (most recent call last): File "/tmp/tmpshhjxwys/tmpfuihyzi2.py", line 1, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s208321025
p02550
u666550725
1600587443
Python
PyPy3 (7.3.0)
py
Runtime Error
85
79364
364
N, X, M = map(int, input().split()) B = [0 for i in range(M+1)] C = [0 for i in range(M)] ans = 0 f = 0 for i in range(1, N+1): B[i] = B[i-1] + X if C[X] != 0: ans += ((N-C[X]+1) // (i-C[X])) * (B[i-1] - B[C[X]-1]) ans += B[C[X]+(N-C[X]+1)%(i-C[X])-1] f = 1 break else: C[X] = i X = X * X % M...
Traceback (most recent call last): File "/tmp/tmpn8ds243g/tmp4q0zy6io.py", line 1, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s683264190
p02550
u979552932
1600586431
Python
Python (3.8.2)
py
Runtime Error
688
33212
588
import numpy as np from sys import stdin import copy def main(): input = stdin.readline n, x, m = map(int, input().split()) a = np.array([x], dtype=np.int64) h = {} h[x] = 0 t = 0 for i in range(n - 1): t = a[i] * a[i] % m if t in h: break h[t] = 0 ...
Traceback (most recent call last): File "/tmp/tmp3z5w7__f/tmp2j91h2fe.py", line 26, in <module> main() File "/tmp/tmp3z5w7__f/tmp2j91h2fe.py", line 7, in main n, x, m = map(int, input().split()) ^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0)
s377543499
p02550
u419655514
1600585630
Python
Python (3.8.2)
py
Runtime Error
64
13128
1163
def readInt(): return int(input()) def readList(): return list(map(int,input().split())) def readMap(): return map(int,input().split()) def readStr(): return input() inf=float('inf') mod = 10**9+7 import math from collections import OrderedDict def solve(N,X,M): A=X ans=A seen=set() order_s...
Traceback (most recent call last): File "/tmp/tmpu6u9o08c/tmp_p5i4y2n.py", line 44, in <module> N,X,M=readMap() ^^^^^^^^^ File "/tmp/tmpu6u9o08c/tmp_p5i4y2n.py", line 6, in readMap return map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s001370592
p02550
u419655514
1600585366
Python
Python (3.8.2)
py
Runtime Error
60
13028
1149
def readInt(): return int(input()) def readList(): return list(map(int,input().split())) def readMap(): return map(int,input().split()) def readStr(): return input() inf=float('inf') mod = 10**9+7 import math from collections import OrderedDict def solve(N,X,M): A=X ans=A seen=set() order_s...
Traceback (most recent call last): File "/tmp/tmpvw5fwv7c/tmpd03udrr2.py", line 44, in <module> N,X,M=readMap() ^^^^^^^^^ File "/tmp/tmpvw5fwv7c/tmpd03udrr2.py", line 6, in readMap return map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s385828984
p02550
u769694158
1600582446
Python
PyPy3 (7.3.0)
py
Runtime Error
93
74632
539
n,x,m=list(map(int,input().split())) if m==1: print(x) else: d=[-1]*(m-1) j=1 s=x a=[] a.append(x) while j<n: x=x**2 x%=m if d[x]!=-1: break else: d[x]=j s+=x a.append(s) j+=1 ##print(d[x],j,s,a[d[x]-1]) ...
Traceback (most recent call last): File "/tmp/tmpm4p2xfco/tmpkiv5j4m7.py", line 1, in <module> n,x,m=list(map(int,input().split())) ^^^^^^^ EOFError: EOF when reading a line
s098127826
p02550
u769694158
1600582404
Python
PyPy3 (7.3.0)
py
Runtime Error
88
74580
540
n,x,m=list(map(int,input().split())) if m==1: print(x) else: d=[-1]*(m-1) j=1 s=x a=[] a.append(x) while j<n: x=x**2 x%=m if d[x]!=-1: break else: d[x]=j s+=x a.append(s) j+=1 ##print(d[x],j,s,a[d[x]-1]) ...
Traceback (most recent call last): File "/tmp/tmp2bfscis6/tmpcp2u3xoo.py", line 1, in <module> n,x,m=list(map(int,input().split())) ^^^^^^^ EOFError: EOF when reading a line
s054529586
p02550
u769694158
1600582166
Python
PyPy3 (7.3.0)
py
Runtime Error
97
74496
531
n,x,m=list(map(int,input().split())) if m==1: print(x) else: d=[-1]*(m-1) j=1 s=x a=[] a.append(x) while j<n: x=x**2 x%=m if d[x]!=-1: break else: d[x]=j s+=x a.append(s) j+=1 ##print(d[x],j,s,a[d[x]-1]) ...
Traceback (most recent call last): File "/tmp/tmpe8iz2951/tmphn5d5tpa.py", line 1, in <module> n,x,m=list(map(int,input().split())) ^^^^^^^ EOFError: EOF when reading a line
s236401964
p02550
u769694158
1600581934
Python
PyPy3 (7.3.0)
py
Runtime Error
95
73972
407
n,x,m=list(map(int,input().split())) d=[-1]*(m-1) j=1 s=x a=[] a.append(x) while j<n: x=x**2 x%=m if d[x]!=-1: break else: d[x]=j s+=x a.append(s) j+=1 ##print(d[x],j,s,a[d[x]-1]) if j!=d[x]: s+=(n-j)//(j-d[x])*(s-a[d[x]-1]) #print(s) if (n-j)%(j-d[x])!=0: #p...
Traceback (most recent call last): File "/tmp/tmps53i8q4o/tmprzmrvtc5.py", line 1, in <module> n,x,m=list(map(int,input().split())) ^^^^^^^ EOFError: EOF when reading a line
s931086772
p02550
u769694158
1600581852
Python
PyPy3 (7.3.0)
py
Runtime Error
92
74020
382
n,x,m=list(map(int,input().split())) d=[-1]*(m-1) j=1 s=x a=[] a.append(x) while j<n: x=x**2 x%=m if d[x]!=-1: break else: d[x]=j s+=x a.append(s) j+=1 ##print(d[x],j,s,a[d[x]-1]) s+=(n-j)//(j-d[x])*(s-a[d[x]-1]) #print(s) if (n-j)%(j-d[x])!=0: #print((n-d[x]),(j-d[x]...
Traceback (most recent call last): File "/tmp/tmpkl0chc4i/tmp1cny2xvf.py", line 1, in <module> n,x,m=list(map(int,input().split())) ^^^^^^^ EOFError: EOF when reading a line
s011971046
p02550
u287742786
1600576281
Python
PyPy3 (7.3.0)
py
Runtime Error
2207
74620
1167
# -*- coding: utf-8 -*- def input_int_array(): return map(int, input().split()) def f(x, m): return x % m def find_index(a, x, count): for i in range(count): ai = a[i] if ai == x: return i return -1 def answer(n, x, m): a1 = x ai = a1 loop_start = -1 lo...
Traceback (most recent call last): File "/tmp/tmpxg50l0y2/tmpucc597so.py", line 54, in <module> n, x, m = input_int_array() ^^^^^^^^^^^^^^^^^ File "/tmp/tmpxg50l0y2/tmpucc597so.py", line 4, in input_int_array return map(int, input().split()) ^^^^^^^ EOFError: EOF when readi...
s301449079
p02550
u369133448
1600576030
Python
PyPy3 (7.3.0)
py
Runtime Error
89
82900
576
import collections n,x,m=map(int,input().split()) if n==1: print(x) exit() start,end,loopcnt=0,0,0 a={x:0} wk=x for i in range(1,m): wk=(wk*wk)%m if not wk in a: a[wk]=i else: start=a[wk] end=i break a=sorted(a.items(),key=lambda x:x[1]) koteiindex=min(n,start) koteiwa=0 for i in range(koteiin...
Traceback (most recent call last): File "/tmp/tmpdldpb4ax/tmpgno8w0rr.py", line 2, in <module> n,x,m=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s481427676
p02550
u369133448
1600575813
Python
PyPy3 (7.3.0)
py
Runtime Error
98
82960
547
import collections n,x,m=map(int,input().split()) start,end,loopcnt=0,0,0 a={x:0} wk=x for i in range(1,m): wk=(wk*wk)%m if not wk in a: a[wk]=i else: start=a[wk] end=i break a=sorted(a.items(),key=lambda x:x[1]) koteiindex=min(n,start) koteiwa=0 for i in range(koteiindex): koteiwa+=a[i][0] loop...
Traceback (most recent call last): File "/tmp/tmps8i_6ore/tmpe838p7nn.py", line 2, in <module> n,x,m=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s603281569
p02550
u242580186
1600575794
Python
PyPy3 (7.3.0)
py
Runtime Error
90
74684
1054
import sys input = sys.stdin.readline sys.setrecursionlimit(10**6) # import decimal # from decimal import Decimal # decimal.getcontext().prec = 10 # from heapq import heappush, heappop, heapify # import math # from math import gcd # import itertools as it # import collections # from collections import deque def inp(...
Traceback (most recent call last): File "/tmp/tmpxcftgq7u/tmp7lz3ww67.py", line 24, in <module> N, X, M = inpl() ^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0)
s065984958
p02550
u242580186
1600575435
Python
PyPy3 (7.3.0)
py
Runtime Error
92
74668
1058
import sys input = sys.stdin.readline sys.setrecursionlimit(10**6) # import decimal # from decimal import Decimal # decimal.getcontext().prec = 10 # from heapq import heappush, heappop, heapify # import math # from math import gcd # import itertools as it # import collections # from collections import deque def inp(...
Traceback (most recent call last): File "/tmp/tmpmuzs3wdc/tmpgonl_89t.py", line 24, in <module> N, X, M = inpl() ^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0)
s249182696
p02550
u242580186
1600575386
Python
PyPy3 (7.3.0)
py
Runtime Error
94
74156
1052
import sys input = sys.stdin.readline sys.setrecursionlimit(10**6) # import decimal # from decimal import Decimal # decimal.getcontext().prec = 10 # from heapq import heappush, heappop, heapify # import math # from math import gcd # import itertools as it # import collections # from collections import deque def inp(...
Traceback (most recent call last): File "/tmp/tmpf3_5y9ha/tmpk3mno8io.py", line 24, in <module> N, X, M = inpl() ^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0)
s088941121
p02550
u242580186
1600575322
Python
PyPy3 (7.3.0)
py
Runtime Error
88
74580
1046
import sys input = sys.stdin.readline sys.setrecursionlimit(10**6) # import decimal # from decimal import Decimal # decimal.getcontext().prec = 10 # from heapq import heappush, heappop, heapify # import math # from math import gcd # import itertools as it # import collections # from collections import deque def inp(...
Traceback (most recent call last): File "/tmp/tmpu2s27jsl/tmpzl4arury.py", line 24, in <module> N, X, M = inpl() ^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0)
s323124042
p02550
u369133448
1600575046
Python
Python (3.8.2)
py
Runtime Error
68
18776
541
import collections n,x,m=map(int,input().split()) start,end,loopcnt=0,0,0 a={x:0} wk=x for i in range(1,m): wk=(wk*wk)%m if not wk in a: a[wk]=i else: start=a[wk] end=i break a=sorted(a.items(),key=lambda x:x[1]) koteiindex=min(n,start) koteiwa=0 for i in range(koteiindex): koteiwa+=a[i][0] loop...
Traceback (most recent call last): File "/tmp/tmppichccxn/tmpnc72x4at.py", line 2, in <module> n,x,m=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s780008769
p02550
u242580186
1600566921
Python
Python (3.8.2)
py
Runtime Error
76
16404
1009
import sys input = sys.stdin.readline sys.setrecursionlimit(10**6) # import decimal # from decimal import Decimal # decimal.getcontext().prec = 10 # from heapq import heappush, heappop, heapify # import math # from math import gcd # import itertools as it # import collections # from collections import deque def inp(...
Traceback (most recent call last): File "/tmp/tmpc2le97o8/tmpz9644zz1.py", line 24, in <module> N, X, M = inpl() ^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0)
s925669277
p02550
u242580186
1600566894
Python
PyPy3 (7.3.0)
py
Runtime Error
90
74788
1009
import sys input = sys.stdin.readline sys.setrecursionlimit(10**6) # import decimal # from decimal import Decimal # decimal.getcontext().prec = 10 # from heapq import heappush, heappop, heapify # import math # from math import gcd # import itertools as it # import collections # from collections import deque def inp(...
Traceback (most recent call last): File "/tmp/tmpe1f_tzbj/tmp_lliumxf.py", line 24, in <module> N, X, M = inpl() ^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0)
s886395867
p02550
u784022244
1600564395
Python
PyPy3 (7.3.0)
py
Runtime Error
82
79948
1070
N,X,M=map(int, input().split()) from math import log, ceil ans=0 ini=[0]*M mod=[0]*M ini[0]=sum(list(range(1,M))) Counter=[0]*M Counter[0]=M-1 for i in range(1,M): now=i+1 temp=now count=1 while now**2<M: now=now**2 temp+=now count+=1 m=now**2%M ini[i]=temp mod[i]...
Traceback (most recent call last): File "/tmp/tmp96a5333v/tmp4bd5_hyw.py", line 1, in <module> N,X,M=map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s202129303
p02550
u238786149
1600563877
Python
PyPy3 (7.3.0)
py
Runtime Error
102
77500
498
n, x, m = map(int, input().split()) if x == 0: print(0) sys.exit() l = [x] s = {x} prev = x for i in range(1, m): next = prev ** 2 next = next % m if next in s: break s.add(next) l.append(next) prev = next start = l.index(next) length = i - start ans = 0 if n < start + length...
Traceback (most recent call last): File "/tmp/tmp4if1x78v/tmpn99nzkhk.py", line 1, in <module> n, x, m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s138469490
p02550
u238786149
1600563677
Python
PyPy3 (7.3.0)
py
Runtime Error
73
77176
458
n, x, m = map(int, input().split()) l = [x] s = {x} prev = x for i in range(1, m): next = prev ** 2 next = next % m if next in s: break s.add(next) l.append(next) prev = next start = l.index(next) length = i - start ans = 0 if n < start + length: ans += sum(l[:n]) else: ans +=...
Traceback (most recent call last): File "/tmp/tmp3fg8m5l_/tmpjhique5d.py", line 1, in <module> n, x, m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s564600115
p02550
u539969758
1600558908
Python
Python (3.8.2)
py
Runtime Error
68
15468
567
N,X,M = map(int,input().split()) ans = X A = X TF = True srt = 1000000 retu = [X] d = dict() d[X] = 0 loop = X for i in range(N-1): if TF: A = A**2 % M if d.get(A) != None: srt = d[A] + 1 goal = i TF = False if TF: retu.append(A) ...
Traceback (most recent call last): File "/tmp/tmp84g0fs9u/tmp9ho7ixik.py", line 1, in <module> N,X,M = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s738954290
p02550
u682672120
1600558244
Python
PyPy3 (7.3.0)
py
Runtime Error
82
68572
475
value_index = dict() n, x, m = map(int, input().split()) a = [0] * m s = [0] * (m + 1) for i in range(m): a[i] = x % m s[i+1] = s[i] + a[i] if i == n - 1: print(s[i+1]) quit() if a[i] in value_index: break value_index[a[i]] = i x = x * x % m l = value_index...
File "/tmp/tmpxr1s_tal/tmp723l4j2q.py", line 2 n, x, m = map(int, input().split()) IndentationError: unexpected indent
s282264241
p02550
u432453907
1600557611
Python
Python (3.8.2)
py
Runtime Error
2205
9752
408
N, X, M = map(int, input().split()) A = [X] for i in range(M-1): z = A[i]**2 % M if z not in A: A.append(z) else: break idx = A.index(z) before = A[:idx] cy_sum = sum(A[idx:]) cy_len = len(A[idx:]) cy_cnt = (N-len(before)) // cy_len mod = A[idx:idx + N - len(before)-cy_len*cy_cnt] if cy_...
Traceback (most recent call last): File "/tmp/tmp6qp64kz1/tmpa8eq69ov.py", line 1, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s083305804
p02550
u539969758
1600557554
Python
Python (3.8.2)
py
Runtime Error
57
13996
544
N,X,M = map(int,input().split()) ans = X A = X TF = True srt = 1000000 retu = dict() retu[X] = 1 loop = X for i in range(N-1): if TF: A = A**2 % M if retu.get(A) != None: srt = j goal = i TF = False break if TF: retu[A] = 1 loop...
Traceback (most recent call last): File "/tmp/tmpvu2i3koa/tmpuey2ac5f.py", line 1, in <module> N,X,M = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s004779438
p02550
u019685451
1600557237
Python
PyPy3 (7.3.0)
py
Runtime Error
84
74656
454
import math N, X, M = map(int, input().split()) A = [X] vis = [-1] * M vis[X] = 0 for i in range(1, M): X = X ** 2 % M if vis[X] != -1: pref = A[:vis[X]] cycle = A[vis[X]:] break A.append(X) vis[X] = i n_full_period = (N - len(pref)) // len(cycle) suffix_length = N - len(pref)...
Traceback (most recent call last): File "/tmp/tmpd9fqbg4e/tmp4qbfux2s.py", line 3, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s995893659
p02550
u159723084
1600556594
Python
Python (3.8.2)
py
Runtime Error
53
12352
407
# -*- coding: utf-8 -*- N,X,M=map(int,input().split()) A=[0]*M A[0]=X D=[0]*M s=N for i in range(1,N): a=A[i-1]**2%M if D[a] == 1: s=A.index(a) break else: A[i]=a D[a]=1 if s==N: ans=sum(A) else: A=A[:i] ans=0 l=len(A)-s ans+=sum(A[:s]) S=sum(...
Traceback (most recent call last): File "/tmp/tmpxnsd7mas/tmpi1m85n5d.py", line 3, in <module> N,X,M=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s266576924
p02550
u159723084
1600556537
Python
Python (3.8.2)
py
Runtime Error
60
12368
411
# -*- coding: utf-8 -*- N,X,M=map(int,input().split()) A=[0]*M A[0]=X D=[0]*M s=N for i in range(1,N): a=A[i-1]**2%M if D[a] == 1: s=A.index(a) break else: A[i]=a D[a]=1 if s==N: ans=sum(A[:i]) else: A=A[:i] ans=0 l=len(A)-s ans+=sum(A[:s]) S=...
Traceback (most recent call last): File "/tmp/tmpnp59tvnp/tmp2asivs7e.py", line 3, in <module> N,X,M=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s614691896
p02550
u335406314
1600556387
Python
Python (3.8.2)
py
Runtime Error
24
9196
473
N,X,M=map(int,input().split()) A = [X,] setA = {A,} alast=X flag=False for i in range(min(N-1,M)): P=alast**2%M if P in setA: flag=True d = A.index(P) C=A[d:] alast=P break else: A.append(P) setA.add(P) alast=P if alast==0: print(sum(C)) el...
Traceback (most recent call last): File "/tmp/tmph91ufjhs/tmpe7z3hj3r.py", line 1, in <module> N,X,M=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s601063153
p02550
u202560873
1600555844
Python
Python (3.8.2)
py
Runtime Error
72
21276
506
N, X, M = [int(x) for x in input().split()] A = [0] * (M + 1) firstApearAt = {i:0 for i in range(M)} A[1] = X firstApearAt[X] = 1 l, r = 1, 1 for i in range(2, M + 1): A[i] = (A[i - 1] * A[i - 1]) % M if firstApearAt[A[i]] > 0: r = i l = firstApearAt[A[i]] break firstApearAt[A[i]] ...
Traceback (most recent call last): File "/tmp/tmp891yfskb/tmpmx5icpet.py", line 1, in <module> N, X, M = [int(x) for x in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s313054417
p02550
u202560873
1600555809
Python
Python (3.8.2)
py
Runtime Error
42
20148
503
N, X, M = [int(x) for x in input().split()] A = [0] * (M + 1) firstApearAt = {i:0 for i in range(M)} A[1] = X firstApearAt[X] = 1 l, r = 1 for i in range(2, M + 1): A[i] = (A[i - 1] * A[i - 1]) % M if firstApearAt[A[i]] > 0: r = i l = firstApearAt[A[i]] break firstApearAt[A[i]] = i...
Traceback (most recent call last): File "/tmp/tmpxw063p8t/tmp8j8k06do.py", line 1, in <module> N, X, M = [int(x) for x in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s441628038
p02550
u911856499
1600555672
Python
Python (3.8.2)
py
Runtime Error
95
18000
802
import sys import copy #import math #import itertools #import numpy as np #import re def func(x,m): return x**2%m N,X,M=[int(c) for c in input().split()] myset = {X} mydict = {0:X} A = [] A.append(X) s = X i = 0 i_stop = i #i=0ใฏ่จˆ็ฎ—ใ—ใŸใฎใง1ใ‹ใ‚‰ for i in range(1,N): A.append(func(A[i-1],M)) if A[i] in myset: ...
Traceback (most recent call last): File "/tmp/tmpk3d0q29n/tmpnqf5pkr_.py", line 11, in <module> N,X,M=[int(c) for c in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s565240104
p02550
u728566015
1600555546
Python
Python (3.8.2)
py
Runtime Error
2206
9624
452
N, X, M = map(int, input().split()) loop_start, n = 0, 0 A = [X] for i in range(1, N): tmp = A[-1]**2 % M if tmp in A: loop_start = A.index(tmp) n = i - A.index(tmp) break else: A.append(tmp) start, loop = A[:loop_start], A[loop_start:] sum_start = sum(start) sum_loop = sum(...
Traceback (most recent call last): File "/tmp/tmp3nqxsefl/tmpfkl993o_.py", line 1, in <module> N, X, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s848618303
p02550
u911856499
1600555313
Python
Python (3.8.2)
py
Runtime Error
89
17904
769
import sys import copy #import math #import itertools #import numpy as np #import re def func(x,m): return x**2%m N,X,M=[int(c) for c in input().split()] myset = {X} mydict = {0:X} A = [] A.append(X) s = X i = 0 i_stop = i #i=0ใฏ่จˆ็ฎ—ใ—ใŸใฎใง1ใ‹ใ‚‰ for i in range(1,N): A.append(func(A[i-1],M)) if A[i] in myset: ...
Traceback (most recent call last): File "/tmp/tmp9vee6asg/tmpretwp4w8.py", line 11, in <module> N,X,M=[int(c) for c in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s087289234
p02550
u911856499
1600555106
Python
Python (3.8.2)
py
Runtime Error
101
17896
776
import sys import copy #import math #import itertools #import numpy as np #import re def func(x,m): return x**2%m N,X,M=[int(c) for c in input().split()] myset = {X} mydict = {0:X} A = [] A.append(X) s = X i = 0 i_stop = i #i=0ใฏ่จˆ็ฎ—ใ—ใŸใฎใง1ใ‹ใ‚‰ for i in range(1,N): A.append(func(A[i-1],M)) if A[i] in myset: ...
Traceback (most recent call last): File "/tmp/tmp7_osqifi/tmp49xs5iwg.py", line 11, in <module> N,X,M=[int(c) for c in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s061351612
p02550
u416011173
1600555051
Python
Python (3.8.2)
py
Runtime Error
28
9056
639
# -*- coding: utf-8 -*- # ๆจ™ๆบ–ๅ…ฅๅŠ›ใ‚’ๅ–ๅพ— N, X, M = list(map(int, input().split())) # ๆฑ‚่งฃๅ‡ฆ็† def f(x: int, m: int) -> int: return x**2 % m A = {X} loop_start_index = 0 while True: A_next = f(A[-1], M) if A_next in A: loop_start_index = A.index(A_next) break else: A.add(A_next) loop_l...
Traceback (most recent call last): File "/tmp/tmplrobwsid/tmp59i2y13u.py", line 3, in <module> N, X, M = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s116627963
p02550
u202560873
1600555040
Python
Python (3.8.2)
py
Runtime Error
71
21404
490
N, X, M = [int(x) for x in input().split()] A = [0] * (M + 1) firstApearAt = {i:0 for i in range(M)} A[1] = X firstApearAt[X] = 1 for i in range(2, M + 1): A[i] = (A[i - 1] * A[i - 1]) % M if firstApearAt[A[i]]: r = i l = firstApearAt[A[i]] break firstApearAt[A[i]] = i ans = 0 if ...
Traceback (most recent call last): File "/tmp/tmpulj2el6w/tmpi15repue.py", line 1, in <module> N, X, M = [int(x) for x in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s149038663
p02550
u911856499
1600554409
Python
Python (3.8.2)
py
Runtime Error
87
17948
667
import sys import copy #import math #import itertools #import numpy as np #import re def func(x,m): return x**2%m N,X,M=[int(c) for c in input().split()] myset = {X} mydict = {0:X} A = [] A.append(X) s = X #i=0ใฏ่จˆ็ฎ—ใ—ใŸใฎใง1ใ‹ใ‚‰ for i in range(1,N): A.append(func(A[i-1],M)) if A[i] in myset: i_stop = i ...
Traceback (most recent call last): File "/tmp/tmpozun7abh/tmpyi5ccov8.py", line 11, in <module> N,X,M=[int(c) for c in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s967007889
p02550
u607075479
1600554272
Python
Python (3.8.2)
py
Runtime Error
59
16364
1084
import sys import math from collections import defaultdict from collections import deque sys.setrecursionlimit(1000000) MOD = 10 ** 9 + 7 input = lambda: sys.stdin.readline().strip() NI = lambda: int(input()) NMI = lambda: map(int, input().split()) NLI = lambda: list(NMI()) SI = lambda: input() def main(): N, X,...
Traceback (most recent call last): File "/tmp/tmp9d_m4_tr/tmpvecjhycr.py", line 53, in <module> main() File "/tmp/tmp9d_m4_tr/tmpvecjhycr.py", line 16, in main N, X, M = NMI() ^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0)
s093697564
p02550
u411203878
1600554058
Python
PyPy3 (7.3.0)
py
Runtime Error
94
74756
750
N,X,M = map(int,input().split()) #ๅ…จไฝ“ใƒซใƒผใƒ—ใ‚’่ฆ‹ใ‚‹้…ๅˆ— t_loop = [X] #ๅˆๅ›žใƒซใƒผใƒ—ใ‚’่ฆ‹ใ‚‹้…ๅˆ— f_loop = [X] #ๅ‡บ็พๅ›žๆ•ฐใ‚’่ฆ‹ใ‚‹่พžๆ›ธ memo = {X:1} #2ๅ›ž็›ฎไปฅ้™ใฎใƒซใƒผใƒ—ใ‚’่ฆ‹ใ‚‹้…ๅˆ— s_loop = [] while True: new_val = t_loop[-1]**2%M t_loop.append(new_val) if new_val not in f_memo: memo[new_val] = 1 f_loop.append(new_val) else: memo[new_va...
Traceback (most recent call last): File "/tmp/tmpbr2q7umk/tmpzgv6ox0b.py", line 1, in <module> N,X,M = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s835317843
p02550
u469254913
1600553923
Python
Python (3.8.2)
py
Runtime Error
71
16108
1453
# import numpy as np # import math # import copy # from collections import deque import sys input = sys.stdin.readline # sys.setrecursionlimit(10000) def main(): N,X,M = map(int,input().split()) A = [-1 for i in range(M)] A[0] = X start = -1 end = -1 cnt = [0 for i in range(M)] cnt[X] =...
Traceback (most recent call last): File "/tmp/tmp8s75o1u6/tmp0d2846q8.py", line 67, in <module> main() File "/tmp/tmp8s75o1u6/tmp0d2846q8.py", line 11, in main N,X,M = map(int,input().split()) ^^^^^ ValueError: not enough values to unpack (expected 3, got 0)
s981586716
p02550
u469254913
1600553048
Python
Python (3.8.2)
py
Runtime Error
65
16120
1310
# import numpy as np # import math # import copy # from collections import deque import sys input = sys.stdin.readline # sys.setrecursionlimit(10000) def main(): N,X,M = map(int,input().split()) A = [-1 for i in range(M)] A[0] = X start = N end = N cnt = [0 for i in range(M)] cnt[X] = 0...
Traceback (most recent call last): File "/tmp/tmpbsfdbfg6/tmpfkyzk2x1.py", line 76, in <module> main() File "/tmp/tmpbsfdbfg6/tmpfkyzk2x1.py", line 11, in main N,X,M = map(int,input().split()) ^^^^^ ValueError: not enough values to unpack (expected 3, got 0)
s281803898
p02550
u935511247
1600552374
Python
Python (3.8.2)
py
Runtime Error
2206
13016
658
#import sys #print(sys.maxsize) N,X,M=map(int,input().split()) table=list(range(M)) for i in range(M): table[i]=((table[i]%M)**2)%M print(table[471]) start=X%M rireki=list() rireki.append(start) ss=0 for j in range(1,N): if table[start] in rireki: ss=rireki.index(table[start]) break else: ...
Traceback (most recent call last): File "/tmp/tmpqhyvj9u3/tmpjz1voezn.py", line 3, in <module> N,X,M=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s909591120
p02550
u202560873
1600552175
Python
Python (3.8.2)
py
Runtime Error
77
21348
476
N, X, M = [int(x) for x in input().split()] A = [0] * (M + 1) firstApearAt = {i:0 for i in range(M)} A[1] = X for i in range(2, M + 1): A[i] = (A[i - 1] * A[i - 1]) % M if firstApearAt[A[i]]: r = i l = firstApearAt[A[i]] break firstApearAt[A[i]] = i S = sum(A[l:r]) ans = 0 if N <=...
Traceback (most recent call last): File "/tmp/tmpka6bq1k9/tmp_m4175k3.py", line 1, in <module> N, X, M = [int(x) for x in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s301985998
p02550
u805332733
1600552136
Python
PyPy3 (7.3.0)
py
Runtime Error
81
75400
707
def resolve(): N, X, M = map(int, input().split(" ")) checked = [False] * M val = X ans = val val_list = [val] checked[val] = val base = M for i in range(N-1): val*=val if val >= base: val %= base if checked[val] != False: loop_start_index = checked[val]+1 loop_val = sum...
Traceback (most recent call last): File "/tmp/tmpsu90vwmu/tmpeamgj41o.py", line 33, in <module> resolve() File "/tmp/tmpsu90vwmu/tmpeamgj41o.py", line 2, in resolve N, X, M = map(int, input().split(" ")) ^^^^^^^ EOFError: EOF when reading a line
s621886069
p02550
u811817592
1600551081
Python
Python (3.8.2)
py
Runtime Error
27
9228
402
n,x,m=map(int,input().split()) a=[] mod_check_list = [False for _ in range(M)] a.append(x*x%m) ind=0 s=0 for i in range(m): t=a[i]*a[i]%m if mod_check_list[t]: ind=a.index(t) break mod_check_list[t] = True a.append(t) s=sum(a[ind:]) l=len(a)-ind loop_times = (n-1-ind)//l answer=loop_time...
Traceback (most recent call last): File "/tmp/tmpm5tmmlq5/tmpbv7ft2cx.py", line 1, in <module> n,x,m=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line