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
s467155345
p02574
u906501980
1598761093
Python
Python (3.8.2)
py
Runtime Error
482
106548
910
from collections import defaultdict from numba import njit, b1, i4, i8, f8 import numpy as np @njit def get_prime_factors(x): out = set() if x < 1: return out while not x%2: out.add(2) x //= 2 i = 3 while i*i <= x: if not x%i: out.add(i) x //=...
Traceback (most recent call last): File "/tmp/tmpjdhtawu2/tmpfiordxl3.py", line 47, in <module> main() File "/root/miniconda3/envs/sandbox-runtime/lib/python3.11/site-packages/numba/core/dispatcher.py", line 468, in _compile_for_args error_rewrite(e, 'typing') File "/root/miniconda3/envs/sandbox-runtime/l...
s749833100
p02574
u906501980
1598760967
Python
Python (3.8.2)
py
Runtime Error
495
104808
905
from collections import defaultdict from numba import njit @njit def get_prime_factors(x): out = set() if x < 1: return out while not x%2: out.add(2) x //= 2 i = 3 while i*i <= x: if not x%i: out.add(i) x //= i else: i += 2...
Traceback (most recent call last): File "/tmp/tmp0xyk9v52/tmpz1m5_r1f.py", line 46, in <module> main() File "/root/miniconda3/envs/sandbox-runtime/lib/python3.11/site-packages/numba/core/dispatcher.py", line 468, in _compile_for_args error_rewrite(e, 'typing') File "/root/miniconda3/envs/sandbox-runtime/l...
s052542029
p02574
u906501980
1598760821
Python
Python (3.8.2)
py
Runtime Error
476
106252
975
from collections import defaultdict from numba import njit, b1, i4, i8, f8 @njit((i8, i8[:]), cache=True) def get_prime_factors(x): out = set() if x < 1: return out while not x%2: out.add(2) x //= 2 i = 3 while i*i <= x: if not x%i: out.add(i) ...
/root/miniconda3/envs/sandbox-runtime/lib/python3.11/site-packages/numba/core/utils.py:213: NumbaPendingDeprecationWarning: Code using Numba extension API maybe depending on 'old_style' error-capturing, which is deprecated and will be replaced by 'new_style' in a future release. See details at https://numba.readthe...
s830140131
p02574
u906501980
1598760662
Python
Python (3.8.2)
py
Runtime Error
24
8996
944
from collections import defaultdict from numba import njit, b1, i4, i8, f8 def get_prime_factors(x): out = set() if x < 1: return out while not x%2: out.add(2) x //= 2 i = 3 while i*i <= x: if not x%i: out.add(i) x //= i else: ...
File "/tmp/tmp9zci2ctg/tmp_flajq82.py", line 29 for ai in a: ^^^ SyntaxError: invalid syntax
s448740058
p02574
u642012866
1598754907
Python
PyPy3 (7.3.0)
py
Runtime Error
713
185932
510
from collections import Counter N = int(input()) A = list(map(int, input().split())) x = max(A) hurui = [x]*(x+1) for i in range(2, x+1): for j in range(i, x+1, i): hurui[j] = min(i, hurui[j]) cnt = Counter() for i in range(N): num = A[i] while num > 1: x = hurui[num] while num%x =...
Traceback (most recent call last): File "/tmp/tmp00696kpl/tmp54in2mdy.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s847375178
p02574
u642012866
1598754826
Python
PyPy3 (7.3.0)
py
Runtime Error
694
185948
508
from collections import Counter N = int(input()) A = list(map(int, input().split())) x = max(A) hurui = [x]*(x+1) for i in range(2, x+1): for j in range(i, x, i): hurui[j] = min(i, hurui[j]) cnt = Counter() for i in range(N): num = A[i] while num > 1: x = hurui[num] while num%x == ...
Traceback (most recent call last): File "/tmp/tmppjpjv5r8/tmprjmbv9hc.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s331274843
p02574
u642012866
1598754787
Python
PyPy3 (7.3.0)
py
Runtime Error
2208
186276
508
from collections import Counter N = int(input()) A = list(map(int, input().split())) x = max(A) hurui = [x]*(x+1) for i in range(2, N+1): for j in range(i, x, i): hurui[j] = min(i, hurui[j]) cnt = Counter() for i in range(N): num = A[i] while num > 1: x = hurui[num] while num%x == ...
Traceback (most recent call last): File "/tmp/tmpbvb7qu2t/tmpjkzcp7_1.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s862982158
p02574
u021814034
1598753710
Python
PyPy3 (7.3.0)
py
Runtime Error
88
74720
2659
import sys import bisect as bi import math from collections import defaultdict as dd import heapq import itertools input=sys.stdin.readline ##from random import randint ##import numpy as np ##sys.setrecursionlimit(10**7) mo=10**9+7 def cin(): return map(int,sin().split()) def ain(): return list(map(...
File "/tmp/tmpl28k1cpe/tmp4itvt4bm.py", line 48 if(l.count(1)>0):gc=1 TabError: inconsistent use of tabs and spaces in indentation
s991515243
p02574
u505564549
1598752948
Python
Python (3.8.2)
py
Runtime Error
242
127420
770
import sys input = sys.stdin.readline def prime_factor(n): factors = [] while n%2==0: factors.append(2) n//=2 f=3 while f*f<=n: if n%f==0: factors.append(f) n//=f else: f+=2 if n!=1: factors.append(n) return set(factors...
Traceback (most recent call last): File "/tmp/tmpgs6gfd98/tmpe4vd8p5l.py", line 25, in <module> n=int(input()) ^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s987250770
p02574
u021019433
1598751399
Python
PyPy3 (7.3.0)
py
Runtime Error
86
74736
468
N = 1000001 spf = [*range(N)] i = 2 while i * i < N: if spf[i] == i: for j in range(i * i, N, i): if spf[j] == j: spf[j] = i i += 1 r = 'pairwise' input() u = set() i = None a = [int(x) for x in input().split() if x > '1'] if len(a) > 1: for x in : s = set() while x > 1: p = s...
File "/tmp/tmpccegktl2/tmp1xr055ft.py", line 18 for x in : ^ SyntaxError: invalid syntax
s765253721
p02574
u917972976
1598750185
Python
PyPy3 (7.3.0)
py
Runtime Error
2214
361364
627
import math def lcm(x, y): return (x * y) // math.gcd(x, y) def main(): n = int(input()) a = [int(t) - 1 for t in input().split()] b = [1] * (n + 1) for i in range(n, 1, -1): b[i - 1] = lcm(b[i], a[i - 1]) flag = 1 for i in range(n - 1): if math.gcd(a[i], b[i + 1]) != 1: ...
Traceback (most recent call last): File "/tmp/tmpvloqrgcz/tmpe4iynwej.py", line 27, in <module> main() File "/tmp/tmpvloqrgcz/tmpe4iynwej.py", line 5, in main n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s497216044
p02574
u021019433
1598749973
Python
PyPy3 (7.3.0)
py
Runtime Error
91
74868
393
spf = [*range(N)] i = 2 while i * i < N: if spf[i] == i: for j in range(i * i, N, i): if spf[j] == j: spf[j] = i i += 1 r = 'pairwise' input() u = set() i = None for x in map(int, input().split()): s = set() while x > 1: p = spf[x] if p in u: r = 'setwise' s.add(p) x /...
Traceback (most recent call last): File "/tmp/tmpu0s3cq6x/tmpsym_uy1y.py", line 1, in <module> spf = [*range(N)] ^ NameError: name 'N' is not defined
s998359540
p02574
u021019433
1598749898
Python
PyPy3 (7.3.0)
py
Runtime Error
716
179272
810
N = 1000001 spf = [*range(N)] i = 2 while i * i < N: if spf[i] == i: for j in range(i * i, N, i): if spf[j] == j: spf[j] = i i += 1 r = 'pairwise' input() u = set() i = None for x in map(int, input().split()): s = set() while x > 1: p = spf[x] if p in u: r = 'setwise' s....
Traceback (most recent call last): File "/tmp/tmpc6438uud/tmp0n1d4dms.py", line 13, in <module> input() EOFError: EOF when reading a line
s907128352
p02574
u021019433
1598749803
Python
PyPy3 (7.3.0)
py
Runtime Error
720
179408
810
N = 1000001 spf = [*range(N)] i = 2 while i * i < N: if spf[i] == i: for j in range(i * i, N, i): if spf[j] == j: spf[j] = i i += 1 r = 'pairwise' input() u = set() i = None for x in map(int, input().split()): s = set() while x > 1: p = spf[x] if p in u: r = 'setwise' s....
Traceback (most recent call last): File "/tmp/tmpkpu_15g4/tmp1o624wkk.py", line 13, in <module> input() EOFError: EOF when reading a line
s800929540
p02574
u498677593
1598747812
Python
PyPy3 (7.3.0)
py
Runtime Error
477
247000
607
import math from collections import defaultdict N=int(input()) A=list(map(int,input().split())) A=list(set(A)) M= 10**6 +1 S = [1] *M for i in range(2, M): if S[i] == 1: for j in range(i, M, i): if S[j] == 1: S[j] = i isPairwise = True f = [0] *M for i in range(0, N): p = ...
Traceback (most recent call last): File "/tmp/tmp7foin0ki/tmp9nvm6yyx.py", line 4, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s653771858
p02574
u498677593
1598747761
Python
PyPy3 (7.3.0)
py
Runtime Error
455
227548
609
import math from collections import defaultdict N=int(input()) A=list(map(int,input().split())) A=(list(set(A))) M= 10**6 +1 S = [1] *M for i in range(2, M): if S[i] == 1: for j in range(i, M, i): if S[j] == 1: S[j] = i isPairwise = True f = [0] *M for i in range(0, N): p ...
Traceback (most recent call last): File "/tmp/tmpjnp037wl/tmp0h9_slm4.py", line 4, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s256028164
p02574
u970348538
1598745086
Python
PyPy3 (7.3.0)
py
Runtime Error
1503
360716
855
import math (_,), a = [list(map(int, s.split())) for s in open(0)] def fast_prime_factorize(num): prime_factor_sets = [set() for _ in range(num+1)] for i in range(2, int(math.sqrt(num)) + 2): if len(prime_factor_sets[i]) == 0: for j in range(i, num+1, i): prime_factor_sets[...
Traceback (most recent call last): File "/tmp/tmpe2kixh6p/tmp_0af_7me.py", line 2, in <module> (_,), a = [list(map(int, s.split())) for s in open(0)] ^^^^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s655467578
p02574
u437351386
1598744917
Python
PyPy3 (7.3.0)
py
Runtime Error
457
241252
807
n=int(input()) a=list(map(int,input().split())) import sys import math def setwise_coprime(a): ans=a[0] for i in range(1,n): ans=math.gcd(ans,a[i]) return ans def erast(n): num_set=set() prime_set=set() for i in range(2,n+1): if i not in num_set: prime_set.add(i) for j in range(i*i,n+1...
Traceback (most recent call last): File "/tmp/tmp119lutq0/tmpujnach1x.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s129092597
p02574
u842170774
1598744899
Python
PyPy3 (7.3.0)
py
Runtime Error
993
314760
984
# E N=int(input()) A=list(map(int,input().split())) def gcd(a,b): if a>b: a,b=b,a while a%b: a,b=b,(a%b) return b def fast_factorization_init(N): res=list(range(N)) for i in range(2,N): if i*i>N: break for j in range(i*i,N,i): if res[j]==j: ...
Traceback (most recent call last): File "/tmp/tmprac5i9hs/tmpxizub115.py", line 3, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s378653397
p02574
u842170774
1598744854
Python
PyPy3 (7.3.0)
py
Runtime Error
260
181560
988
# E N=int(input()) A=list(map(int,input().split())) def gcd(a,b): if a>b: a,b=b,a while a%b: a,b=b,(a%b) return b def fast_factorization_init(N): res=list(range(N)) for i in range(2,N): if i*i>N: break for j in range(i*i,N,i): if res[j]==j: ...
Traceback (most recent call last): File "/tmp/tmp8b5lieda/tmpfuekyohm.py", line 3, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s784638235
p02574
u437351386
1598744854
Python
PyPy3 (7.3.0)
py
Runtime Error
496
225752
807
n=int(input()) a=list(map(int,input().split())) import sys import math def setwise_coprime(a): ans=a[0] for i in range(1,n): ans=math.gcd(ans,a[i]) return ans def erast(n): num_set=set() prime_set=set() for i in range(2,n+1): if i not in num_set: prime_set.add(i) for j in range(i*i,n+1...
Traceback (most recent call last): File "/tmp/tmpeqq_27lt/tmpqskh3hvl.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s524245209
p02574
u255898796
1598744745
Python
Python (3.8.2)
py
Runtime Error
2208
134132
1408
def prime_factorize(n): global a a = [] while n % 2 == 0: a.append(2) n //= 2 f = 3 while f * f <= n: if n % f == 0: a.append(f) n //= f else: f += 2 if n != 1: a.append(n) a = set(a) a = list(a) N = input() t =...
Traceback (most recent call last): File "/tmp/tmpj_6rddok/tmp2i9l9a1u.py", line 19, in <module> N = input() ^^^^^^^ EOFError: EOF when reading a line
s689196438
p02574
u970348538
1598744492
Python
PyPy3 (7.3.0)
py
Runtime Error
1486
360600
770
import math (_,), a = [list(map(int, s.split())) for s in open(0)] def fast_prime_factorize(num): prime_factor_sets = [set() for _ in range(num+1)] for i in range(2, int(math.sqrt(num)) + 2): if len(prime_factor_sets[i]) == 0: for j in range(i, num+1, i): prime_factor_sets[...
Traceback (most recent call last): File "/tmp/tmp38gxzvms/tmpbis3n_zs.py", line 2, in <module> (_,), a = [list(map(int, s.split())) for s in open(0)] ^^^^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s717771137
p02574
u363421241
1598744373
Python
Python (3.8.2)
py
Runtime Error
2208
127588
611
import collections N = int(input()) A = list(set(list(map(int, input().split())))) def prime_factorize(n): r = set() if n % 2 == 0: r.add(2) f = 3 while f * f <= n: if n % f == 0: r.add(f) n //= f else: f += 2 if n != 1: r.add(n) ...
Traceback (most recent call last): File "/tmp/tmpdtnyoxli/tmpg835xhw8.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s976948615
p02574
u006880673
1598744249
Python
PyPy3 (7.3.0)
py
Runtime Error
390
226724
1399
from math import gcd N = int(input()) A = list(map(int, input().split())) MAX = 10**6 def prime_factor_sieve(n): """ エラトステネスの篩で、 2 ~ Nの各数に対して、その整数のもつ最小の素因数 (その整数を篩落とした最小の素因数)を記録して返す O(nloglog(n)) """ res = [i for i in range(n+1)] for i in range(2, int(n**0.5)+1): if res[i] < i...
Traceback (most recent call last): File "/tmp/tmpl5e_q6f3/tmp_utx16si.py", line 3, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s094727717
p02574
u255898796
1598744102
Python
Python (3.8.2)
py
Runtime Error
2206
133216
1391
def prime_factorize(n): global a a = [] while n % 2 == 0: a.append(2) n //= 2 f = 3 while f * f <= n: if n % f == 0: a.append(f) n //= f else: f += 2 if n != 1: a.append(n) a = set(a) a = list(a) N = input() t =...
Traceback (most recent call last): File "/tmp/tmpb5lc9do5/tmp3hdj48sb.py", line 19, in <module> N = input() ^^^^^^^ EOFError: EOF when reading a line
s677202915
p02574
u363421241
1598744072
Python
Python (3.8.2)
py
Runtime Error
2209
127556
611
import collections N = int(input()) A = set(list(map(int, input().split()))) def prime_factorize(n): r = set() if n % 2 == 0: r.add(2) f = 3 while f * f <= n: if n % f == 0: r.add(f) n //= f else: f += 2 if n != 1: r.add(n) re...
Traceback (most recent call last): File "/tmp/tmpeqiauhns/tmp1s_5rblu.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s205027586
p02574
u437351386
1598743926
Python
PyPy3 (7.3.0)
py
Runtime Error
253
182000
1012
n=int(input()) a=list(map(int,input().split())) import sys import math def setwise_coprime(a): ans=a[0] for i in range(1,n): ans=math.gcd(ans,a[i]) return ans def erast(n): num_set=set() prime_set=set() for i in range(2,n+1): if i not in num_set: prime_set.add(i) for j in range(i*i,n+1...
Traceback (most recent call last): File "/tmp/tmp5s5krn8z/tmppab1smds.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s103013597
p02574
u970348538
1598743790
Python
Python (3.8.2)
py
Runtime Error
2213
307392
770
import math (_,), a = [list(map(int, s.split())) for s in open(0)] def fast_prime_factorize(num): prime_factor_sets = [set() for _ in range(num+1)] for i in range(2, int(math.sqrt(num)) + 2): if len(prime_factor_sets[i]) == 0: for j in range(i, num+1, i): prime_factor_sets[...
Traceback (most recent call last): File "/tmp/tmpi6oxwun4/tmpkfxy64by.py", line 2, in <module> (_,), a = [list(map(int, s.split())) for s in open(0)] ^^^^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s224201680
p02574
u437351386
1598743664
Python
PyPy3 (7.3.0)
py
Runtime Error
92
74748
953
n=int(input()) a=list(map(int,input().split())) import sys import math def setwise_coprime(a): ans=a[0] for i in range(1,n): ans=math.gcd(ans,a[i]) return ans def erast(n): num_set=set() prime_set=set() for i in range(2,n+1): if i not in num_set: prime_set.add(i) for j in range(i*i,n+1...
File "/tmp/tmpp0xr5km1/tmp65kikjfq.py", line 31 return False: ^ SyntaxError: invalid syntax
s732522764
p02574
u970348538
1598743647
Python
Python (3.8.2)
py
Runtime Error
2213
311640
716
import math (_,), a = [list(map(int, s.split())) for s in open(0)] def fast_prime_factorize(num): prime_factor_sets = [set() for _ in range(num+1)] for i in range(2, int(math.sqrt(num)) + 2): if len(prime_factor_sets[i]) == 0: for j in range(i, num+1, i): prime_factor_sets[...
Traceback (most recent call last): File "/tmp/tmpfi73epkj/tmpi1rgmbdi.py", line 2, in <module> (_,), a = [list(map(int, s.split())) for s in open(0)] ^^^^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s842870847
p02574
u145231176
1598743357
Python
PyPy3 (7.3.0)
py
Runtime Error
1660
216160
2306
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] def input(): return sys.stdin.readline().rstrip() def rand_N(ran1, ran2): return random.randint(ran1,...
Traceback (most recent call last): File "/tmp/tmpfixodjr1/tmpfx4qrqlh.py", line 36, in <module> from fractions import gcd ImportError: cannot import name 'gcd' from 'fractions' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/fractions.py)
s701749376
p02574
u255898796
1598743184
Python
Python (3.8.2)
py
Runtime Error
2208
133972
1355
def prime_factorize(n): global a a = [] while n % 2 == 0: a.append(2) n //= 2 f = 3 while f * f <= n: if n % f == 0: a.append(f) n //= f else: f += 2 if n != 1: a.append(n) a = set(a) a = list(a) N = input() t =...
Traceback (most recent call last): File "/tmp/tmpgaq401_i/tmpm07qm0vj.py", line 19, in <module> N = input() ^^^^^^^ EOFError: EOF when reading a line
s966424644
p02574
u145231176
1598743068
Python
PyPy3 (7.3.0)
py
Runtime Error
1637
215900
2388
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] def input(): return sys.stdin.readline().rstrip() def rand_N(ran1, ran2): return random.randint(ran1,...
Traceback (most recent call last): File "/tmp/tmpansjq6ps/tmp6rtcpea1.py", line 36, in <module> from fractions import gcd ImportError: cannot import name 'gcd' from 'fractions' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/fractions.py)
s755411888
p02574
u117541450
1598742762
Python
Python (3.8.2)
py
Runtime Error
2207
134764
613
import math as m N=int(input()) As=list(map(int,input().split())) D=[0]*(10**6+1) D[1]=1 for i in range(2,int(m.sqrt(10**6))+2): if D[i]!=0: continue j=i while j < 10**6+1: D[j]=i j+=i P=[0]*10**6 pc=True g=As[0] for n in range(N): A=As[n] ppre=1 while True: p...
Traceback (most recent call last): File "/tmp/tmpsbpuhk4r/tmpl58dbq2k.py", line 3, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s980315063
p02574
u874320250
1598742676
Python
PyPy3 (7.3.0)
py
Runtime Error
734
204964
616
import sys from collections import defaultdict N = int(input()) A = list(map(int, input().split())) p = [-1] * (max(A)+1) count = defaultdict(lambda: 0) p[0] = 0 p[1] = 1 for i in range(2, len(p)): if p[i] == -1: for j in range(i, len(p), i): p[j] = i for a in A: factors = set() while...
Traceback (most recent call last): File "/tmp/tmprxst5prc/tmph8e4m5l4.py", line 4, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s978530389
p02574
u145231176
1598742182
Python
PyPy3 (7.3.0)
py
Runtime Error
2168
260424
2579
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def getArray(intn): return [int(input()) for i in range(intn)] def input(): return sys.stdin.readline().rstrip() def rand_N(ran1, ran2): return random.randint(ran1,...
Traceback (most recent call last): File "/tmp/tmpcly7z_dj/tmpqvzu0rgf.py", line 36, in <module> from fractions import gcd ImportError: cannot import name 'gcd' from 'fractions' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/fractions.py)
s980068032
p02574
u216928054
1598741776
Python
PyPy3 (7.3.0)
py
Runtime Error
903
181156
4188
#!/usr/bin/env python3 import sys sys.setrecursionlimit(10**6) INF = 10 ** 9 + 1 # sys.maxsize # float("inf") MOD = 10 ** 9 + 7 def debug(*x): print(*x, file=sys.stderr) def solve(N, AS): num_division = 0 maxAS = max(AS) eratree = [0] * (maxAS + 10) for p in range(2, maxAS + 1): if erat...
Traceback (most recent call last): File "/tmp/tmprnyxgp_d/tmpdf2i1oy6.py", line 122, in <module> main() File "/tmp/tmprnyxgp_d/tmpdf2i1oy6.py", line 49, in main N = int(input()) ^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: b''
s557482146
p02574
u630554891
1598741742
Python
Python (3.8.2)
py
Runtime Error
2208
150392
508
import numpy as np n=int(input()) a=list(map(int, input().split())) if np.gcd.reduce(a) != 1: print('not coprime') exit() N=max(a)+1 A=list(range(2,N)) p=list() while A[0]**2<=N: tmp=A[0] p.append(tmp) A=[e for e in A if e%tmp!=0] l=p+A #print(l) for i in range(len(a)): count=0 for j in range(len...
Traceback (most recent call last): File "/tmp/tmp1vzixok4/tmpsf0teg4m.py", line 2, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s882144574
p02574
u216928054
1598741712
Python
PyPy3 (7.3.0)
py
Runtime Error
89
74856
2107
#!/usr/bin/env python3 import numba import sys sys.setrecursionlimit(10**6) INF = 10 ** 9 + 1 # sys.maxsize # float("inf") MOD = 10 ** 9 + 7 def debug(*x): print(*x, file=sys.stderr) def solve(N, AS): num_division = 0 maxAS = max(AS) eratree = [0] * (maxAS + 10) for p in range(2, maxAS + 1): ...
Traceback (most recent call last): File "/tmp/tmptnhosy4z/tmplkri1ku0.py", line 123, in <module> main() File "/tmp/tmptnhosy4z/tmplkri1ku0.py", line 50, in main N = int(input()) ^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: b''
s061142728
p02574
u349449706
1598741696
Python
PyPy3 (7.3.0)
py
Runtime Error
2211
252632
833
import math from functools import reduce def gcd_list(numbers): return reduce(math.gcd, numbers) def get_primenumber(number): prime_list = [] search_list = list(range(2,number+1)) while search_list[0] <= math.sqrt(number): head_num = search_list.pop(0) prime_list.append(head_num) ...
Traceback (most recent call last): File "/tmp/tmpo8meh2qh/tmpwrepxmxi.py", line 14, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s109942803
p02574
u216928054
1598741633
Python
PyPy3 (7.3.0)
py
Runtime Error
86
74872
2102
#!/usr/bin/env python3 import numba import sys sys.setrecursionlimit(10**6) INF = 10 ** 9 + 1 # sys.maxsize # float("inf") MOD = 10 ** 9 + 7 def debug(*x): print(*x, file=sys.stderr) def solve(N, AS): num_division = 0 maxAS = max(AS) sieved = [0] * (maxAS + 10) for p in range(2, maxAS + 1): ...
Traceback (most recent call last): File "/tmp/tmp_awjmeip/tmpz9fhw9gv.py", line 123, in <module> main() File "/tmp/tmp_awjmeip/tmpz9fhw9gv.py", line 50, in main N = int(input()) ^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: b''
s758417858
p02574
u630554891
1598741579
Python
Python (3.8.2)
py
Runtime Error
2208
150436
507
import numpy as np n=int(input()) a=list(map(int, input().split())) if np.gcd.reduce(a) != 1: print('not coprime') exit() N=max(a)+1 A=list(range(2,N)) p=list() while A[0]**2<=N: tmp=A[0] p.append(tmp) A=[e for e in A if e%tmp!=0] l=p+A print(l) for i in range(len(a)): count=0 for j in range(len(...
Traceback (most recent call last): File "/tmp/tmpodob9anp/tmpej7sn9yi.py", line 2, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s855123332
p02574
u682672120
1598741540
Python
PyPy3 (7.3.0)
py
Runtime Error
85
74768
1098
from collections import defaultdict import math def gcd(a, b): if a < b: return gcd(b, a) while b > 0: a, b = b, a % b return a def sieve_of_eratosthenes(n): sieve = list(range(n+1)) m = int(math.sqrt(n)) for i in range(2, m + 1): if sieve[i] < i: continue ...
File "/tmp/tmp0tlj1ul_/tmpy3dj0oyg.py", line 43 pairwise = primes.isdisjoint(factor): ^ SyntaxError: invalid syntax
s953251865
p02574
u627600101
1598740834
Python
Python (3.8.2)
py
Runtime Error
851
126960
1127
from math import gcd # = map(int, input().split()) N = int(input()) A = list(map(int, input().split())) mA = max(A) primenum = [2] sgn = [-1 for _ in range(int(mA**0.5)+1)] k = 3 while k**2 <= mA: if sgn[k] == -1: primenum.append(k) add = k*k ok = k while ok**2 <= mA: sgn[ok] = 1 ok += ad...
Traceback (most recent call last): File "/tmp/tmpcgnp3ch7/tmpbqqmbch5.py", line 4, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s558665043
p02574
u876438858
1598740708
Python
PyPy3 (7.3.0)
py
Runtime Error
806
203072
1328
#!/usr/bin/env python3 import sys from collections import defaultdict input = sys.stdin.readline def ST(): return input().rstrip() def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(MI()) N = I() A = LI() def pre_fac(n): D = [0] * (n + 1) i...
Traceback (most recent call last): File "/tmp/tmpdzn55trg/tmp1sn675uh.py", line 24, in <module> N = I() ^^^ File "/tmp/tmpdzn55trg/tmp1sn675uh.py", line 13, in I return int(input()) ^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s626141426
p02574
u163320134
1598740642
Python
PyPy3 (7.3.0)
py
Runtime Error
90
68712
752
import collections import sys input=sys.stdin.readline def divisors(n): ret=[] for i in range(2,int(n**0.5)+1): if n%i==0: ret.append(i) while n%i==0: n//=i return ret def gcd(a,b): if b==0: return a else: return gcd(b,a%b) n=int(input()) arr=list(map(int,input().split())) c...
File "/tmp/tmpwmou07yx/tmp0m4oji9t.py", line 31 if cnt[val2]==True ^ SyntaxError: expected ':'
s588882523
p02574
u682672120
1598740362
Python
PyPy3 (7.3.0)
py
Runtime Error
516
197012
1160
from collections import defaultdict def gcd(a, b): if a < b: return gcd(b, a) while b > 0: a, b = b, a % b return a def sieve_of_eratosthenes_max(n): sieve = [0] * (n+1) sieve[0] = 1 #素数でない sieve[1] = 1 #素数でない for i in range(2, n): if sieve[i] == 0: for ...
Traceback (most recent call last): File "/tmp/tmpblkdpcdi/tmpd9nrypla.py", line 28, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s554050345
p02574
u682672120
1598740330
Python
PyPy3 (7.3.0)
py
Runtime Error
400
184092
1156
from collections import defaultdict def gcd(a, b): if a < b: return gcd(b, a) while b > 0: a, b = b, a % b return a def sieve_of_eratosthenes_max(n): sieve = [0] * (n+1) sieve[0] = 1 #素数でない sieve[1] = 1 #素数でない for i in range(2, n): if sieve[i] == 0: for ...
Traceback (most recent call last): File "/tmp/tmpio97q_9d/tmpra5_10zz.py", line 28, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s907504534
p02574
u630554891
1598740304
Python
Python (3.8.2)
py
Runtime Error
2210
150472
466
import numpy as np n=int(input()) a=list(map(int, input().split())) N=max(a)+1 A=list(range(2,N)) p=list() c=[0]*max(a) while A[0]**2<=N: tmp=A[0] p.append(tmp) A=[e for e in A if e%tmp!=0] l=p+A for i in range(len(a)): for j in range(len(l)): if a[i]%l[j]==0: c[l[j]-1]+=1 #print(c) maxco...
Traceback (most recent call last): File "/tmp/tmpe3n4rnn1/tmpr_67dvxl.py", line 2, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s535191918
p02574
u349449706
1598740026
Python
PyPy3 (7.3.0)
py
Runtime Error
2213
252424
833
import math from functools import reduce def gcd_list(numbers): return reduce(math.gcd, numbers) def get_primenumber(number): prime_list = [] search_list = list(range(2,number+1)) while search_list[0] <= math.sqrt(number): head_num = search_list.pop(0) prime_list.append(head_num) ...
Traceback (most recent call last): File "/tmp/tmps7cfai7s/tmpc5vt3ij_.py", line 14, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s762219820
p02574
u935984175
1598739778
Python
PyPy3 (7.3.0)
py
Runtime Error
901
225224
1362
import sys from functools import reduce from math import gcd sys.setrecursionlimit(10 ** 7) rl = sys.stdin.readline def eratosthenes(n): prime = [2] if n == 2: return prime limit = int(n ** 0.5) data = [i + 1 for i in range(2, n, 2)] res = [0] * (n + 1) res[1] = 1 for i in range(2...
Traceback (most recent call last): File "/tmp/tmpvfhvfdr9/tmpld_2096i.py", line 65, in <module> solve() File "/tmp/tmpvfhvfdr9/tmpld_2096i.py", line 32, in solve _ = int(rl()) ^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s110264836
p02574
u935984175
1598739702
Python
PyPy3 (7.3.0)
py
Runtime Error
948
225948
1362
import sys from functools import reduce from math import gcd sys.setrecursionlimit(10 ** 7) rl = sys.stdin.readline def eratosthenes(n): prime = [2] if n == 2: return prime limit = int(n ** 0.5) data = [i + 1 for i in range(2, n, 2)] res = [0] * (n + 1) res[1] = 1 for i in range(2...
Traceback (most recent call last): File "/tmp/tmpoqv7dso9/tmp4fjzbgp4.py", line 65, in <module> solve() File "/tmp/tmpoqv7dso9/tmp4fjzbgp4.py", line 32, in solve _ = int(rl()) ^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s881174884
p02574
u935984175
1598739487
Python
PyPy3 (7.3.0)
py
Runtime Error
933
225688
1358
import sys from functools import reduce from math import gcd sys.setrecursionlimit(10 ** 7) rl = sys.stdin.readline def eratosthenes(n): prime = [2] if n == 2: return prime limit = int(n ** 0.5) data = [i + 1 for i in range(2, n, 2)] res = [0] * (n + 1) res[1] = 1 for i in range(2...
Traceback (most recent call last): File "/tmp/tmpfov0_own/tmprcuq91ub.py", line 65, in <module> solve() File "/tmp/tmpfov0_own/tmprcuq91ub.py", line 32, in solve _ = int(rl()) ^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s720675185
p02574
u935984175
1598739363
Python
PyPy3 (7.3.0)
py
Runtime Error
896
253196
1343
import sys from functools import reduce from math import gcd sys.setrecursionlimit(10 ** 7) rl = sys.stdin.readline def eratosthenes(n): prime = [2] if n == 2: return prime limit = int(n ** 0.5) data = [i + 1 for i in range(2, n, 2)] res = [0] * (n + 1) for i in range(2, n, 2): ...
Traceback (most recent call last): File "/tmp/tmpomb7w8bu/tmpallfty8q.py", line 64, in <module> solve() File "/tmp/tmpomb7w8bu/tmpallfty8q.py", line 31, in solve _ = int(rl()) ^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s326828005
p02574
u348805958
1598739320
Python
PyPy3 (7.3.0)
py
Runtime Error
329
185136
1346
#!python3 import sys iim = lambda: map(int, sys.stdin.readline().rstrip().split()) from math import gcd def factorN(n): n1 = n + 1 A = [2, 0] * ((n1+1)//2) for i in range(3, n1, 2): if A[i]: continue for j in range(i, n1, 2*i): A[j] = i def factor(n): if n == 1: ...
Traceback (most recent call last): File "/tmp/tmpd3usiyqr/tmpmjumgcsq.py", line 68, in <module> resolve() File "/tmp/tmpd3usiyqr/tmpmjumgcsq.py", line 37, in resolve N = next(it) ^^^^^^^^ StopIteration
s009788693
p02574
u401686269
1598739060
Python
Python (3.8.2)
py
Runtime Error
439
127864
733
from functools import reduce from math import gcd def sieve(L,R): if L<2:L=2 flag=[0]*(R+1) for i in range(2, int(R**.5)+5): if flag[i] == 1:continue for j in range(i*2,R+1, i): if flag[j] == 1:continue if j % i == 0: flag[j] = 1 return [i fo...
Traceback (most recent call last): File "/tmp/tmp7nxfk_wq/tmpdx6h0laa.py", line 16, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s969879019
p02574
u212502386
1598739051
Python
PyPy3 (7.3.0)
py
Runtime Error
434
205144
510
N=int(input()) A=list(map(int,input().split())) c=[0]*10**6 isPairwise=True isSetwise=True for i in range(N): c[A[i]]+=1 for i in range(2,1000000): cnt=0 for j in range(2,1000000,i): cnt+=c[j] if cnt>1: isPairwise=False def gcd(a,b): while b: a,b=b,a%b return a ...
Traceback (most recent call last): File "/tmp/tmp334_x94m/tmp3pzsi0yb.py", line 1, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s429814323
p02574
u349449706
1598738910
Python
PyPy3 (7.3.0)
py
Runtime Error
2213
252432
837
import math from functools import reduce def gcbd_list(numbers): return reduce(math.gcd, numbers) def get_primenumber(number): prime_list = [] search_list = list(range(2,number+1)) while search_list[0] <= math.sqrt(number): head_num = search_list.pop(0) prime_list.append(head_num) ...
Traceback (most recent call last): File "/tmp/tmp780nakc7/tmpc1tlyo9p.py", line 14, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s358041595
p02574
u860002137
1598738853
Python
Python (3.8.2)
py
Runtime Error
661
207924
791
import numpy as np from numba import njit n = int(input()) arr = np.array(list(map(int, input().split()))) n = 10**3 primes = set(range(3, n+1, 2)) for i in range(3, int(n**0.5+1)): primes.difference_update(range(i*2, n+1, i)) primes.add(2) @njit def solve(arr, primes): used = [False] * 1000 ans = Tr...
Traceback (most recent call last): File "/tmp/tmp62zkn9zi/tmpk8_zxikz.py", line 5, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s475118197
p02574
u748241164
1598738818
Python
PyPy3 (7.3.0)
py
Runtime Error
2212
252660
1254
import math from functools import reduce N = int(input()) A = list(map(int, input().split())) ans = ["pairwise coprime", "setwise coprime ", "not coprime"] def gcd_list(numbers): return reduce(math.gcd, numbers) if gcd_list(A) != 1: print(ans[2]) quit() def seachPrimeNum(N): max = int(N ** (1 / 2)) ...
Traceback (most recent call last): File "/tmp/tmpyev3g3vv/tmph6qysjv5.py", line 3, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s537725077
p02574
u752774573
1598738807
Python
PyPy3 (7.3.0)
py
Runtime Error
1568
223788
991
D = [10**9+7]*(10**6+1) L = [True]*(10**6+1) L[0] = False L[1] = False D[1] = 1 for i in range(2, 10**6+1): if L[i]: D[i] = i for j in range(i*2, 10**6+1, i): L[j] = False D[j] = min(i, D[j]) def egcd(a, b): if a == 0: return b else: g = egcd(b % a, ...
Traceback (most recent call last): File "/tmp/tmph60x1hjc/tmpv7rrchg9.py", line 31, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s279151584
p02574
u349449706
1598738786
Python
PyPy3 (7.3.0)
py
Runtime Error
2212
252644
836
import math from functools import reduce def gcbd_list(numbers): return reduce(math.gcd, numbers) def get_primenumber(number): prime_list = [] search_list = list(range(2,number+1)) while search_list[0] <= math.sqrt(number): head_num = search_list.pop(0) prime_list.append(head_num) ...
Traceback (most recent call last): File "/tmp/tmpmrx4rr7u/tmpfjnljox6.py", line 14, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s764703918
p02574
u752774573
1598738727
Python
PyPy3 (7.3.0)
py
Runtime Error
1586
243960
1003
D = [10**9+7]*(10**6+1) L = [True]*(10**6+1) L[0] = False L[1] = False D[1] = 1 for i in range(2, 10**6+1): if L[i]: D[i] = i for j in range(i*2, 10**6+1, i): L[j] = False D[j] = min(i, D[j]) def egcd(a, b): if a == 0: return b else: g = egcd(b % a, ...
Traceback (most recent call last): File "/tmp/tmpszm5v62i/tmpt2kmih26.py", line 31, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s390238200
p02574
u748241164
1598738670
Python
PyPy3 (7.3.0)
py
Runtime Error
2212
241384
1207
import math from functools import reduce N = int(input()) A = list(map(int, input().split())) ans = ["pairwise coprime", "setwise coprime ", "not coprime"] def gcd_list(numbers): return reduce(math.gcd, numbers) if gcd_list(A) != 1: print(ans[2]) quit() def seachPrimeNum(N): max = int(N ** (1 / 2)) ...
Traceback (most recent call last): File "/tmp/tmpa9yit1li/tmpg_ebnolm.py", line 3, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s317293775
p02574
u748241164
1598738649
Python
PyPy3 (7.3.0)
py
Runtime Error
1350
240748
1198
import math from functools import reduce N = int(input()) A = list(map(int, input().split())) ans = ["pairwise coprime", "setwise coprime ", "not coprime"] def gcd_list(numbers): return reduce(math.gcd, numbers) if gcd_list(A) != 1: print(ans[2]) quit() def seachPrimeNum(N): max = int(N ** (1 / 2)) ...
Traceback (most recent call last): File "/tmp/tmpfc9erhqn/tmpk_dld8iq.py", line 3, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s823806000
p02574
u922449550
1598738643
Python
PyPy3 (7.3.0)
py
Runtime Error
390
205060
994
from math import gcd N = int(input()) A = list(map(int, input().split())) g_all = A[0] for a in A[1:]: g_all = gcd(g_all, a) if g_all > 1: print('not coprime') quit() def sieve(n): is_prime = [True for _ in range(n+1)] is_prime[0] = False for i in range(2, n+1): if is_prime[i-1]: ...
Traceback (most recent call last): File "/tmp/tmp7tv8vfb9/tmpglloa7_f.py", line 3, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s400562453
p02574
u045089547
1598738426
Python
Python (3.8.2)
py
Runtime Error
83
24456
507
def find_gcd(x, y): while(y): x, y = y, x % y return x def fun(l): num1=l[0] num2=l[1] gcd=find_gcd(num1,num2) for i in range(len(l)-1): gcd=find_gcd(l[i],l[i+1]) if gcd!=1: break; else: print("pairwise coprime") return 1 for i in range(2,len(l)): gcd=find_...
Traceback (most recent call last): File "/tmp/tmpyrsx3355/tmpdb49kkrj.py", line 23, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s160673485
p02574
u388636486
1598738337
Python
Python (3.8.2)
py
Runtime Error
27
9008
564
def hcfnaive(a,b): if(b==0): return a else: return hcfnaive(b,a%b) n=int(input()) l=list(map(int,input().split())) f={} for i in range(n): x=l[i] for i in range(2,int(x**(0.5))+1): if x%i==0: f[i]=f.get(i,0)+1 while x%i==0: x=x//i ...
File "/tmp/tmp0z19nm3g/tmpvryu5kgn.py", line 25 else g>1: ^ SyntaxError: expected ':'
s102197990
p02574
u045089547
1598738181
Python
Python (3.8.2)
py
Runtime Error
76
24516
505
def find_gcd(x, y): while(y): x, y = y, x % y return x def fun(l): num1=l[0] num2=l[1] gcd=find_gcd(num1,num2) for i in range(2,len(l)): gcd=find_gcd(gcd,l[i]) if gcd==1: print("setwise coprime") return 1 for i in range(len(l)-1): gcd=find_gcd(l[i],l[i+1]) if gcd...
Traceback (most recent call last): File "/tmp/tmpky5htztb/tmpg73oftrg.py", line 22, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s237491563
p02574
u935558307
1598738176
Python
PyPy3 (7.3.0)
py
Runtime Error
81
74656
805
from collections import Counter N = int(input()) A = list(map(int,input().split())) setA = set(A) #pairwiseかどうかを調べる memo = [1]*(10**6+1) memo[0] = 0 memo[1] = 0 for i in range(2,10**6+1): if memo[i] == 1: flag = False if i in setA: flag = True for j in range(i*2,10**6+1,i): ...
File "/tmp/tmpecppnefe/tmp30vn9r4h.py", line 25 elif len(setA) == len(A): ^^^^ SyntaxError: invalid syntax
s489351027
p02574
u629454253
1598738134
Python
PyPy3 (7.3.0)
py
Runtime Error
392
206148
564
import math from functools import reduce N = int(input()) A = list(map(int, input().split())) MAX = max(A) cut = [0 for _ in range(MAX+1)] for i in range(2, MAX+1, 2): if cut[i] != 0: continue for j in range(i, MAX+1, i): cut[j] = i if reduce(math.gcd, A) != 1: print('not coprime') ex...
Traceback (most recent call last): File "/tmp/tmp8nyzjmf_/tmpceb1_i6d.py", line 4, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s224510486
p02574
u342563578
1598738079
Python
PyPy3 (7.3.0)
py
Runtime Error
101
68536
595
n = int(input()) a = list(map(int,input().split())) a.sort() dp = [0 for i in range(a[-1])] p = [0 for i in range(a[-1])] for i in range(n): p[a[i]-1] = 1 ans = 1 for i in range(2,a[-1]+1): if dp[i-1] == 1: continue u = 0 k = 1 while i*k <= a[-1]: dp[i*k-1] = 1 if p[i*k-1] ==...
File "/tmp/tmp30bt65rn/tmpn6_cmhf6.py", line 23 elif ans == 1: ^^^^ SyntaxError: invalid syntax
s445248183
p02574
u366482170
1598738072
Python
PyPy3 (7.3.0)
py
Runtime Error
2208
186452
3575
#import sys MOD = 10 ** 9 + 7 INFI = 10**10 #input = sys.stdin.readline import math from collections import deque import itertools import heapq #import bisect from fractions import Fraction import copy from functools import lru_cache from collections import defaultdict import pprint #oo=list("ABCDEFGHIJKLMNOPQRSTUVWXY...
Traceback (most recent call last): File "/tmp/tmpzhdm6x4t/tmp8ed1serp.py", line 170, in <module> main() File "/tmp/tmpzhdm6x4t/tmp8ed1serp.py", line 118, in main n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s726208869
p02574
u045089547
1598737981
Python
Python (3.8.2)
py
Runtime Error
31
8996
537
def find_gcd(x, y): while(y): x, y = y, x % y return x def fun(l): num1=l[0] num2=l[1] gcd=find_gcd(num1,num2) for i in range(2,len(l)): gcd=find_gcd(gcd,l[i]) if gcd==1: print("setwise coprime") return 1 for i range(len(l)-1): gcd=find_gcd(l[i],l[i+1]) if gcd!=1...
File "/tmp/tmp3ydm4t4z/tmpz1e4fu4c.py", line 16 for i range(len(l)-1): ^^^^^ SyntaxError: invalid syntax
s413455677
p02574
u752774573
1598737948
Python
PyPy3 (7.3.0)
py
Runtime Error
327
199016
1018
# ABC_177_E_3.py # 解説を見て高速素因数分解を実装する D = [0]*(10**6+1) L = [True]*(10**6+1) L[0] = False L[1] = False D[1] = 1 for i in range(2, 10**6+1): if L[i]: D[i] = i for j in range(i*2, 10**6+1, i): L[j] = False D[j] = i def egcd(a, b): if a == 0: return b else: ...
Traceback (most recent call last): File "/tmp/tmptzp_l8zr/tmpjtj69dum.py", line 35, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s553217527
p02574
u260216890
1598737936
Python
PyPy3 (7.3.0)
py
Runtime Error
730
232256
606
n = int(input()) *a,=map(int, input().split()) mapa=[0]*(10**6+1) n0 = 10**6 primes = [0]*(n0+1) for i in range(2, int(n0**0.5+1)): if primes[i]==0: x=i multi=1 while x<=n0: if primes[x]==0: primes[x]=i x//=multi multi+=1 x*=mu...
Traceback (most recent call last): File "/tmp/tmpq7y9acbt/tmpdpsu668l.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s385036345
p02574
u607075479
1598737704
Python
PyPy3 (7.3.0)
py
Runtime Error
568
236008
2213
import sys import math import fractions from collections import deque from collections import defaultdict 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 ...
Traceback (most recent call last): File "/tmp/tmpzc0kkiu7/tmpy3srkzcl.py", line 106, in <module> main() File "/tmp/tmpzc0kkiu7/tmpy3srkzcl.py", line 58, in main N = NI() ^^^^ File "/tmp/tmpzc0kkiu7/tmpy3srkzcl.py", line 10, in <lambda> NI = lambda: int(input()) ^^^^^^^^^^^^ Va...
s265996015
p02574
u348805958
1598737654
Python
PyPy3 (7.3.0)
py
Runtime Error
316
194608
1321
#!python3 import sys iim = lambda: map(int, sys.stdin.readline().rstrip().split()) from math import gcd def factorN(n): n1 = n + 1 A = [2, 0] * ((n1+1)//2) for i in range(3, n1, 2): if A[i]: continue for j in range(i, n1, 2*i): A[j] = i def factor(n): if n == 1: ...
Traceback (most recent call last): File "/tmp/tmpcm0jz5ou/tmpmm4uec9i.py", line 65, in <module> resolve() File "/tmp/tmpcm0jz5ou/tmpmm4uec9i.py", line 37, in resolve N = next(it) ^^^^^^^^ StopIteration
s633104226
p02574
u348805958
1598737518
Python
PyPy3 (7.3.0)
py
Runtime Error
306
194944
1289
#!python3 import sys iim = lambda: map(int, sys.stdin.readline().rstrip().split()) from math import gcd def factorN(n): n1 = n + 1 A = [2, 0] * ((n1+1)//2) for i in range(3, n1, 2): if A[i]: continue for j in range(i, n1, 2*i): A[j] = i def factor(n): if n == 1: ...
Traceback (most recent call last): File "/tmp/tmppcgmsfmk/tmp98smlc8_.py", line 64, in <module> resolve() File "/tmp/tmppcgmsfmk/tmp98smlc8_.py", line 37, in resolve N = next(it) ^^^^^^^^ StopIteration
s948235957
p02574
u348805958
1598737491
Python
PyPy3 (7.3.0)
py
Runtime Error
311
180224
1242
#!python3 import sys iim = lambda: map(int, sys.stdin.readline().rstrip().split()) from math import gcd def factorN(n): n1 = n + 1 A = [2, 0] * ((n1+1)//2) for i in range(3, n1, 2): if A[i]: continue for j in range(i, n1, 2*i): A[j] = i def factor(n): ans = [] ...
Traceback (most recent call last): File "/tmp/tmprn8kzwmp/tmp884l8p9f.py", line 62, in <module> resolve() File "/tmp/tmprn8kzwmp/tmp884l8p9f.py", line 35, in resolve N = next(it) ^^^^^^^^ StopIteration
s972714126
p02574
u812354010
1598737442
Python
PyPy3 (7.3.0)
py
Runtime Error
2210
205428
695
n=int(input()) a=[int(x) for x in input().split()] insu_list=[0]*(10**6) iti=True for i in a: if i!=1: iti=False if iti: print("pairwise coprime") exit() # n以下の素数リスト def prime_list(n): a=[2] k=3 while k<=n: for i in a: if k%i==0: break if k<...
Traceback (most recent call last): File "/tmp/tmpamyd_5wa/tmpbyrbddx_.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s333244226
p02574
u793868662
1598737405
Python
PyPy3 (7.3.0)
py
Runtime Error
573
224976
324
def resolve(): import math n = int(input()) a = list(map(int, input().split())) a = list(set(a)) a = sorted(a) for i in range(1, len(a)): ggcd = math.gcd(ggcd, a[i]) if ggcd == 1: break if ggcd != 1: print("not coprime") else: print("test") resol...
Traceback (most recent call last): File "/tmp/tmpivpz0bm6/tmprvxtely1.py", line 15, in <module> resolve() File "/tmp/tmpivpz0bm6/tmprvxtely1.py", line 3, in resolve n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s258972907
p02574
u260216890
1598737353
Python
PyPy3 (7.3.0)
py
Runtime Error
683
231956
617
n = int(input()) *a,=map(int, input().split()) mapa=[0]*(10**6+1) n0 = 10**6 primes = [0]*(n0+1) for i in range(2, int(n0**0.5+1)): if primes[i]==0: x=i multi=1 while x<=n0: if primes[x]==0: primes[x]=i x//=multi multi+=1 x*=mu...
Traceback (most recent call last): File "/tmp/tmpw4jx6dvg/tmpfj71ki2d.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s398375686
p02574
u666550725
1598737231
Python
PyPy3 (7.3.0)
py
Runtime Error
2211
213136
781
from math import sqrt from fractions import gcd N = int(input()) A = list(map(int, input().split())) M = 10 ** 6 num = [i+1 for i in range(M)] num[0] = 0 for i in range(1, M): if num[i] == i + 1: if i + 1 > sqrt(M): break n = 2 * (i + 1) while n <= M: num[n-1] = min(num[n-1], i + 1) n +=...
Traceback (most recent call last): File "/tmp/tmplq55yrbs/tmpsaa10c3d.py", line 2, in <module> from fractions import gcd ImportError: cannot import name 'gcd' from 'fractions' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/fractions.py)
s730483204
p02574
u391589398
1598737203
Python
PyPy3 (7.3.0)
py
Runtime Error
2212
229260
960
N = int(input()) A = tuple(map(int, input().split())) def p(n): is_prime = [True if i%2 == 1 else False for i in range(0, n+1) ] is_prime[0] = False is_prime[1] = False is_prime[2] = True # 2は素数 for i in range(3, int(n**0.5) + 1, 2): if not is_prime[i]: continue # iの倍数は素数...
Traceback (most recent call last): File "/tmp/tmpq6ngmrbv/tmpt3w1cmne.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s487620858
p02574
u761320129
1598737093
Python
Python (3.8.2)
py
Runtime Error
409
132220
609
from math import gcd N = int(input()) A = list(map(int,input().split())) g = 0 for a in A: g = gcd(g,a) if g > 1: print('not coprime') exit() MAXN = 100#10**6+10 sieve = [i for i in range(MAXN+1)] p = 2 while p*p <= MAXN: if sieve[p] == p: for q in range(2*p,MAXN+1,p): if sieve[q] ...
Traceback (most recent call last): File "/tmp/tmp78oe31vv/tmp1qbkzr_2.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s698964730
p02574
u607075479
1598736844
Python
PyPy3 (7.3.0)
py
Runtime Error
2212
186872
2213
import sys import math import fractions from collections import deque from collections import defaultdict 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 ...
Traceback (most recent call last): File "/tmp/tmpy3mif4va/tmp21ytudam.py", line 105, in <module> main() File "/tmp/tmpy3mif4va/tmp21ytudam.py", line 58, in main N = NI() ^^^^ File "/tmp/tmpy3mif4va/tmp21ytudam.py", line 10, in <lambda> NI = lambda: int(input()) ^^^^^^^^^^^^ Va...
s099803375
p02574
u607075479
1598736803
Python
PyPy3 (7.3.0)
py
Runtime Error
344
188316
2191
import sys import math from collections import deque from collections import defaultdict 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 make_grid(h, w, n...
Traceback (most recent call last): File "/tmp/tmpwly3gws1/tmpnectyou4.py", line 104, in <module> main() File "/tmp/tmpwly3gws1/tmpnectyou4.py", line 57, in main N = NI() ^^^^ File "/tmp/tmpwly3gws1/tmpnectyou4.py", line 9, in <lambda> NI = lambda: int(input()) ^^^^^^^^^^^^ Val...
s285950794
p02574
u666550725
1598736721
Python
PyPy3 (7.3.0)
py
Runtime Error
2211
206568
731
from math import sqrt N = int(input()) A = list(map(int, input().split())) M = 10 ** 6 num = [i+1 for i in range(M)] num[0] = 0 for i in range(1, M): if num[i] == i + 1: if i + 1 > sqrt(M): break n = 2 * (i + 1) while n <= M: num[n-1] = min(num[n-1], i + 1) n += (i + 1) primes = [p+1 for...
Traceback (most recent call last): File "/tmp/tmphdqzoe2q/tmpzzajefmz.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s325600374
p02574
u726285999
1598736623
Python
PyPy3 (7.3.0)
py
Runtime Error
95
68652
1280
import numpy as np import sys from collections import defaultdict def first_prime_list(N): D = [1] * (N + 1) for i in range(2, N + 1): if D[i] != 1: continue for j in range(1, N // i + 1): if D[i * j] == 1: D[i * j] = i return D def factorization...
Traceback (most recent call last): File "/tmp/tmpiiqht_x6/tmpvp6x2z96.py", line 39, in <module> N = int(sys.stdin.readline().rstrip()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s573952607
p02574
u651109406
1598736613
Python
PyPy3 (7.3.0)
py
Runtime Error
674
317364
977
N = int(input()) A = list(map(int, input().split())) def gcd(x, y): if y == 0: return x return gcd(y, x % y) def erat(): end = 10 ** 6 t = [False if i == 0 or i == 1 else True for i in range(end)] ret = [0 for i in range(end)] for i in range(2, end): if t[i]: for j...
Traceback (most recent call last): File "/tmp/tmp47h5lmaf/tmpmzoi_5ab.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s644762329
p02574
u651109406
1598736575
Python
PyPy3 (7.3.0)
py
Runtime Error
731
317600
977
N = int(input()) A = list(map(int, input().split())) def gcd(x, y): if y == 0: return x return gcd(y, x % y) def erat(): end = 10 ** 6 t = [False if i == 0 or i == 1 else True for i in range(end)] ret = [0 for i in range(end)] for i in range(2, end): if t[i]: for j...
Traceback (most recent call last): File "/tmp/tmpcmjqr7uj/tmp41tfy60m.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s853570229
p02574
u724687935
1598736554
Python
PyPy3 (7.3.0)
py
Runtime Error
101
68660
496
from math import gcd N = int(input()) A = list(map(int, input().split())) # setwise validation tmp = 0 for a in A: tmp = gcd(tmp, a) isSetwise = (tmp == 1) # pairwise validation M = 10 ** 6 A = set(A) isPairwise = True for i in range(2, M): cnt = 0 ni = 0 while (ni := ni + i) <= M: cnt += (...
Traceback (most recent call last): File "/tmp/tmpr24jrlmd/tmp3vm416fb.py", line 4, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s533010020
p02574
u578464015
1598736434
Python
PyPy3 (7.3.0)
py
Runtime Error
429
76092
1876
#ceilevenoddformula import math import bisect import copy import time from collections import Counter from itertools import combinations #map(int,input().split()) #int(x) for x in input().split() def gcd(a, b) : if (a == 0) : return b if (b == 0) : return a k = 0 whi...
File "/tmp/tmpobt117fv/tmpdasq75c7.py", line 63 while n % i== 0: TabError: inconsistent use of tabs and spaces in indentation
s065871548
p02574
u607075479
1598736373
Python
PyPy3 (7.3.0)
py
Runtime Error
301
188808
2116
import sys import math from collections import deque from collections import defaultdict 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 make_grid(h, w, n...
Traceback (most recent call last): File "/tmp/tmpubupgdfv/tmp2551kjjw.py", line 99, in <module> main() File "/tmp/tmpubupgdfv/tmp2551kjjw.py", line 58, in main N = NI() ^^^^ File "/tmp/tmpubupgdfv/tmp2551kjjw.py", line 9, in <lambda> NI = lambda: int(input()) ^^^^^^^^^^^^ Valu...
s274100569
p02574
u645487439
1598736320
Python
Python (3.8.2)
py
Runtime Error
2206
127716
618
import math from functools import reduce n = int(input()) a_list = list(map(int, input().split())) prime_list = [0] * math.floor(a_list[n - 1] ** 0.5) def is_coprime(num): for i in range(2, math.ceil(num ** 0.5)): if num % i == 0: if prime_list[i] == 1: return True ...
Traceback (most recent call last): File "/tmp/tmp0ug6bvl0/tmpxbnwidyv.py", line 4, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s982089250
p02574
u348805958
1598736220
Python
PyPy3 (7.3.0)
py
Runtime Error
333
180452
1242
#!python3 import sys iim = lambda: map(int, sys.stdin.readline().rstrip().split()) from math import gcd def factorN(n): n1 = n + 1 A = [2, 0] * ((n1+1)//2) for i in range(3, n1, 2): if A[i]: continue for j in range(i, n1, 2*i): A[j] = i def factor(n): ans = [] ...
Traceback (most recent call last): File "/tmp/tmp6yn0b_go/tmpfyi5ux7o.py", line 62, in <module> resolve() File "/tmp/tmp6yn0b_go/tmpfyi5ux7o.py", line 35, in resolve N = next(it) ^^^^^^^^ StopIteration
s272314291
p02574
u401487574
1598736192
Python
PyPy3 (7.3.0)
py
Runtime Error
310
201848
1386
ma = lambda :map(int,input().split()) lma = lambda :list(map(int,input().split())) tma = lambda :tuple(map(int,input().split())) ni = lambda:int(input()) yn = lambda fl:print("Yes") if fl else print("No") import collections import math def is_primes(n): primes = [1]*n primes[0] =0 primes[1] =0 for i in ...
Traceback (most recent call last): File "/tmp/tmp6t31fev5/tmp5_lpbufy.py", line 36, in <module> n =ni() ^^^^ File "/tmp/tmp6t31fev5/tmp5_lpbufy.py", line 4, in <lambda> ni = lambda:int(input()) ^^^^^^^ EOFError: EOF when reading a line
s092646532
p02574
u693173434
1598735962
Python
Python (3.8.2)
py
Runtime Error
2209
127420
950
import math n=int(input()) a=list(map(int,input().split())) mxa=max(a) def get_sieve_of_eratosthenes(mxa): fact = [0]*(mxa+1) limit = math.sqrt(mxa) data = [i + 1 for i in range(1, mxa)] while True: p = data[0] if limit <= p: return fact fact[p]=p for i in da...
Traceback (most recent call last): File "/tmp/tmpw9jif5sz/tmpzi9cw116.py", line 2, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line