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
s202681642
p02574
u525571359
1600290687
Python
PyPy3 (7.3.0)
py
Runtime Error
2213
222164
2431
import sys import math from io import StringIO import unittest def resolve(): N, = map(int, input().split()) As = list(map(int, input().split())) # allprimes = [] common_primes = None all_primes = set() all_uniq_primes_n = 0 d = get_d(1000000) for i, a in enumerate(As): primes...
Traceback (most recent call last): File "/tmp/tmpqr6ud7r1/tmp7s7787go.py", line 100, in <module> resolve() File "/tmp/tmpqr6ud7r1/tmp7s7787go.py", line 8, in resolve N, = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s036735922
p02574
u170324846
1600264341
Python
PyPy3 (7.3.0)
py
Runtime Error
2212
251260
1016
def get_sieve_of_eratosthenes(n): table = [i if i % 2 else 2 for i in range(n + 1)] prime = [2] limit = int(n ** 0.5) data = [i + 1 for i in range(2, n, 2)] while True: p = data[0] if limit <= p: return table, prime + data prime.append(p) next_data = [] ...
Traceback (most recent call last): File "/tmp/tmp1joh727t/tmpn7zpaqe_.py", line 20, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s542443860
p02574
u087295942
1600196084
Python
Python (3.8.2)
py
Runtime Error
2208
126668
1700
# coding:UTF-8 import sys from math import factorial MOD = 10 ** 9 + 7 INF = 10000000000 # 約数 倍数 def gcb(a, b): if b == 0: return a else: return gcb(b, a % b) def lcm(a, b): d = gcb(a, b) return int(a / d * b) def divisorList(a): l = [] for i in range(1, int(a**0.5)+1): ...
Traceback (most recent call last): File "/tmp/tmpigoxqabd/tmpn713hmfl.py", line 70, in <module> main() File "/tmp/tmpigoxqabd/tmpn713hmfl.py", line 47, in main n = int(input()) # 数字 ^^^^^^^ EOFError: EOF when reading a line
s370453874
p02574
u842939260
1600095657
Python
Python (3.8.2)
py
Runtime Error
28
9004
2380
//#pragma GCC target("avx2,avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using pii = pair<int, int>; using pll = pair<long long, long long>; #define rep(i, n) for(int i = 0; i < (n); ++i) #define ...
File "/tmp/tmpg59t06if/tmpd1wue8_5.py", line 1 //#pragma GCC target("avx2,avx") ^^ SyntaxError: invalid syntax
s377135104
p02574
u692657167
1600086707
Python
PyPy3 (7.3.0)
py
Runtime Error
862
250800
1265
def f1(n): max_p = int(n ** 0.5) p = 0 # 素数 pl = [] # 素数リスト el = [i for i in range(2, n + 1)] # 探索リスト D = [i for i in range(n + 1)] while p <= max_p: nxt = [] p = el[0] pl.append(p) for e in el: if e % p == 0: D[e] = p el...
Traceback (most recent call last): File "/tmp/tmp3que0rnb/tmp7a4b9t98.py", line 61, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s482237540
p02574
u692657167
1600086481
Python
PyPy3 (7.3.0)
py
Runtime Error
902
232196
1265
def f1(n): max_p = int(n ** 0.5) p = 0 # 素数 pl = [] # 素数リスト el = [i for i in range(2, n + 1)] # 探索リスト D = [i for i in range(n + 1)] while p <= max_p: nxt = [] p = el[0] pl.append(p) for e in el: if e % p == 0: D[e] = p el...
Traceback (most recent call last): File "/tmp/tmpuiwlw0hq/tmpe69bblqv.py", line 61, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s255015066
p02574
u692657167
1600085731
Python
PyPy3 (7.3.0)
py
Runtime Error
847
252020
1281
def get_prime(n): max_p = int(n ** 0.5) p = 0 # 素数 pl = [] # 素数リスト el = [i for i in range(2, n + 1)] # 探索リスト D = [i for i in range(n + 1)] while p <= max_p: nxt = [] p = el[0] pl.append(p) for e in el: if e % p == 0: D[e] = p ...
Traceback (most recent call last): File "/tmp/tmpuhrcsior/tmptryi2n_l.py", line 60, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s213124389
p02574
u222668979
1600082374
Python
Python (3.8.2)
py
Runtime Error
501
132732
342
from math import gcd n = int(input()) a = list(map(int, input().split())) # 解説AC(a*loga) ans = 0 cnt = [0] * (max(a) + 1) for ai in a: ans = gcd(ans, ai) cnt[ai] += 1 if ans != 1: print('not coprime') elif any(sum(cnt[i::i]) > 1 for i in range(max(a) + 1)): print('setwise coprime') else: print('p...
Traceback (most recent call last): File "/tmp/tmp8dha4154/tmprr9ceh8c.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s507589429
p02574
u769694158
1600049212
Python
PyPy3 (7.3.0)
py
Runtime Error
301
189220
912
n=int(input()) m=list(map(int,input().split())) a=max(m) s=[-1]*(a+1) for i in range(2,a+1): if s[i]==-1: for j in range(i,a+1,i): s[j]=i import math if a==1: print("pairwise coprime") else: g=math.gcd(m[0],m[1]) for i in range(2,n): g=math.gcd(g,m[i]) if g==1: ...
Traceback (most recent call last): File "/tmp/tmpf52_pylb/tmpbfpdw8ot.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s264207712
p02574
u815763296
1600010456
Python
Python (3.8.2)
py
Runtime Error
771
127016
1011
import sys def LI(): return list(map(int, input().split())) def gcd(x, y): if x == 0: return y else: return gcd(y % x, x) N = LI() A = LI() g = 0 for a in A: g = gcd(g, a) if g != 1: print("not coprime") sys.exit() sosu = [True]*(10**6) sosu[0] = sosu[1] = False for i in r...
Traceback (most recent call last): File "/tmp/tmp_c0pl3ab/tmpu_qwdg1p.py", line 15, in <module> N = LI() ^^^^ File "/tmp/tmp_c0pl3ab/tmpu_qwdg1p.py", line 5, in LI return list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s462544023
p02574
u991713078
1599988020
Python
Python (3.8.2)
py
Runtime Error
2207
127376
322
def gcd(U,Q): if Q==0: return U return gcd(Q,U%Q) def lcm(U,Q): return U/gcd(U,Q)*Q N=input() N=int(N) a=list(map(int,input().split())) b,c,d=0,1,1 for i in range(N): b=gcd(a[i],b) c=lcm(a[i],c) d*=a[i] if b!=1: print("not coprime") elif c!=d: print("setwise coprime") else: print("pairwise coprime...
Traceback (most recent call last): File "/tmp/tmprssz80zg/tmpucj5llvo.py", line 7, in <module> N=input() ^^^^^^^ EOFError: EOF when reading a line
s453311224
p02574
u991713078
1599958665
Python
Python (3.8.2)
py
Runtime Error
235
127404
320
def gcd(U,Q): if Q==0: return U return gcd(Q,U//Q) def lcm(U,Q): return U/gcd(U,Q)*Q N=input() a=list(map(int,input().split())) b,c,d=0,0,1 for i in range(1,N): b=gcd(a[i],b) c=lcm(a[i],c) d*=a[i] if b!=1: print("not coprime") elif c!=d: print("setwise coprime") else: print("pairwise coprime")
Traceback (most recent call last): File "/tmp/tmp0mj01yme/tmpjlgo8qmc.py", line 9, in <module> N=input() ^^^^^^^ EOFError: EOF when reading a line
s186036378
p02574
u188228787
1599957762
Python
Python (3.8.2)
py
Runtime Error
2206
129116
440
import math N = int(input()) vals = [int(x) for x in input().split(" ")] M = max(vals) M_sqrt = int(math.sqrt(M)) count_list = [0 for _ in range(M_sqrt+1)] S = 1 for i in range(2, M_sqrt+1): k = 0 for v in vals: if v%i==0: count_list[i]+=1 count_list[v//i]+=1 if N in count_list: pri...
Traceback (most recent call last): File "/tmp/tmplkiteq95/tmpu3xdehy9.py", line 3, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s689768927
p02574
u068727970
1599903790
Python
Python (3.8.2)
py
Runtime Error
944
272144
1950
import math # エラトステネスの古いで高速化してるけど、O(AloglolgA + NlogA)なので、 # 普通に計算してもO(NlogA)で計算できいるので門d内ないのでは? # sエラトステネスの篩は頭の中に出てきたけど、一定の値までの素数を列挙するという問題だったので、活用できないと思ってしまsった。 N = int(input()) TOP = 10**6+1 D = [i for i in range(100)] def get_sieve_of_eratosthenes(n): if not isinstance(n, int): raise TypeError('n is ...
Traceback (most recent call last): File "/tmp/tmpiwrllvwd/tmpx8jap5q5.py", line 7, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s007536763
p02574
u002663801
1599858366
Python
PyPy3 (7.3.0)
py
Runtime Error
1276
277728
1169
import math import collections import copy import sys n = int(input()) a = list(map(int,input().split())) sCheck = math.gcd(a[0],a[1]) if n == 2: if sCheck == 1: print("pairwise coprime") else: print("not coprime") sys.exit() else: for i in range(2,n): sCheck = math.gcd(sCheck...
Traceback (most recent call last): File "/tmp/tmp0873a59u/tmp49bwr5pt.py", line 6, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s321158442
p02574
u002663801
1599857764
Python
PyPy3 (7.3.0)
py
Runtime Error
1307
277640
1136
import math import collections import copy import sys n = int(input()) a = list(map(int,input().split())) sCheck = math.gcd(a[0],a[1]) if n == 2: if sCheck == 1: print("pairwise coprime") else: print("not coprime") sys.exit() else: for i in range(2,n): sCheck = math.gcd(sCheck...
Traceback (most recent call last): File "/tmp/tmp92aeuh37/tmptylzk3gj.py", line 6, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s629873937
p02574
u002663801
1599857521
Python
PyPy3 (7.3.0)
py
Runtime Error
1299
277640
1126
import math import collections import copy import sys n = int(input()) a = list(map(int,input().split())) sCheck = math.gcd(a[0],a[1]) if n == 2: if sCheck == 1: print("pairwise coprime") else: print("not coprime") sys.exit() else: for i in range(2,n): sCheck = math.gcd(sCheck...
Traceback (most recent call last): File "/tmp/tmp6_cgr8y8/tmppvzg2gte.py", line 6, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s494786875
p02574
u002663801
1599857016
Python
PyPy3 (7.3.0)
py
Runtime Error
1292
277436
1123
import math import collections import copy import sys n = int(input()) a = list(map(int,input().split())) sCheck = math.gcd(a[0],a[1]) if n == 2: if sCheck == 1: print("pairwise coprime") else: print("not coprime") sys.exit() else: for i in range(2,n): sCheck = math.gcd(sCheck...
Traceback (most recent call last): File "/tmp/tmpj4pmkfcf/tmpa1k2u_nd.py", line 6, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s633196465
p02574
u166340293
1599856689
Python
Python (3.8.2)
py
Runtime Error
26
8948
403
import numpy as np N=int(input()) A=list(map(int,input().split())) flag=0 if np.gcd.reduce(A)!=1: flag=1 print("not comprime") if flag=0: flag1=0 for i in range (N): for j in range (N): if i!=j and np.gcd(A[i],A[j])!=1: flag1=1 if flag1: break if flag1: break if flag==0...
File "/tmp/tmpxvkd6fl9/tmp2zb9rgqk.py", line 8 if flag=0: ^^^^^^ SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
s314571163
p02574
u002663801
1599851644
Python
PyPy3 (7.3.0)
py
Runtime Error
1709
277024
1050
import math import collections import copy n = int(input()) a = list(map(int,input().split())) beforeQ = collections.deque([i for i in range(2,10**6 + 1)]) D = dict() p = 2 D[2] = 2 D[1] = 1 while p < math.sqrt(10**6): afterQ = collections.deque() while len(beforeQ) > 0: k = beforeQ.pople...
Traceback (most recent call last): File "/tmp/tmpv9u6e_99/tmpf9z10s8j.py", line 5, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s650283706
p02574
u367794409
1599764139
Python
Python (3.8.2)
py
Runtime Error
2210
128612
1128
import math import fractions def get_prime(number): prime_list = [] search_list = list(range(2,number + 1)) i = 0 while search_list[i] <= math.sqrt(number): head_num = search_list[i] search_list = [(num if num % head_num != 0 else head_num) for num in search_list] i += 1 ret...
Traceback (most recent call last): File "/tmp/tmp5ejlctef/tmp1wh16ckz.py", line 25, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s800520762
p02574
u367794409
1599763029
Python
Python (3.8.2)
py
Runtime Error
2209
128664
1000
import math import fractions def get_prime(number): prime_list = [] search_list = list(range(2,number + 1)) i = 0 while search_list[i] <= math.sqrt(number): head_num = search_list[i] search_list = [(num if num % head_num != 0 else head_num) for num in search_list] i += 1 ret...
Traceback (most recent call last): File "/tmp/tmpyipdqath/tmpp7g41gbt.py", line 25, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s298034223
p02574
u367794409
1599761410
Python
Python (3.8.2)
py
Runtime Error
2209
128520
940
import math import fractions def get_prime(number): prime_list = [] search_list = list(range(2,number + 1)) i = 0 while search_list[i] <= math.sqrt(number): head_num = search_list[i] search_list = [(num if num % head_num != 0 else head_num) for num in search_list] i += 1 ret...
Traceback (most recent call last): File "/tmp/tmph8abvcse/tmpgf6fppwm.py", line 25, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s581502803
p02574
u367794409
1599761313
Python
Python (3.8.2)
py
Runtime Error
28
8912
942
import math import fractions def get_prime(number): prime_list = [] search_list = list(range(2,number + 1)) i = 0 while search_list[i] <= math.sqrt(number): head_num = search_list[i] search_list = [(num if num % head_num != 0 else head_num) for num in search_list] i += 1 ret...
File "/tmp/tmp6lz5bk37/tmp_9cc00ir.py", line 38 else if ans == 1: ^^ SyntaxError: expected ':'
s173592782
p02574
u056358163
1599756866
Python
Python (3.8.2)
py
Runtime Error
696
150592
955
import numpy as np import math from functools import reduce def getD(num): input_list = [2 if i % 2 == 0 else i for i in range(num+1)] bool_list = [False if i % 2 == 0 else True for i in range(num+1)] sqrt = np.sqrt(num) for serial in range(3, num, 2): if serial > sqrt: return...
Traceback (most recent call last): File "/tmp/tmpbn3110sb/tmpu70be8jy.py", line 20, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s391976950
p02574
u056358163
1599756111
Python
Python (3.8.2)
py
Runtime Error
1002
150444
934
import numpy as np import math from functools import reduce def getD(num): input_list = [2 if i % 2 == 0 else i for i in range(num+1)] bool_list = [False if i % 2 == 0 else True for i in range(num+1)] sqrt = np.sqrt(num) for serial in range(3, num, 2): if serial >= sqrt: retur...
Traceback (most recent call last): File "/tmp/tmpubp52z7t/tmp5pv4m9u2.py", line 20, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s035479900
p02574
u667084803
1599677335
Python
Python (3.8.2)
py
Runtime Error
919
127388
1381
N = int(input()) A = list(map(int, input().split())) # number_to_prime[i]: i の最小の素因数, iが素数ならば0 number_to_prime = [0] * (10**6 + 1) # preprocess for i in range(2, 10**6+1): if not number_to_prime[i]: j = 1 while j*i <= 10**6: number_to_prime[j*i] = i j += 1 def is_pair_cop...
Traceback (most recent call last): File "/tmp/tmp9t4h253m/tmpvdn8dnyb.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s768019761
p02574
u667084803
1599677087
Python
PyPy3 (7.3.0)
py
Runtime Error
2212
204824
1060
N = int(input()) A = list(map(int, input().split())) # number_to_prime[i]: i の最小の素因数, iが素数ならば0 number_to_prime = [0] * (10**6 + 1) # preprocess for i in range(2, 10**6+1): if not number_to_prime[i]: j = 2 while j*i <= 10**6: number_to_prime[j*i] = i j += 1 def is_pairwis...
Traceback (most recent call last): File "/tmp/tmpccnod0nm/tmp1unha143.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s982119572
p02574
u667084803
1599676611
Python
PyPy3 (7.3.0)
py
Runtime Error
284
189732
1055
N = int(input()) A = list(map(int, input().split())) # number_to_prime[i]: i の最小の素因数, iが素数ならば0 number_to_prime = [0] * (10**6 + 1) # preprocess for i in range(2, 10**6+1): if not number_to_prime[i]: j = 2 while j*i <= 10**6: number_to_prime[j*i] = i j += 1 def is_pairwis...
Traceback (most recent call last): File "/tmp/tmp7uj52t3g/tmporzwluqy.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s809600973
p02574
u248996551
1599650710
Python
PyPy3 (7.3.0)
py
Runtime Error
2210
181644
708
N=int(input()) A=list(map(int,input().split())) from functools import lru_cache @lru_cache(None) def gcd(x,y): if y>x: x,y=y,x if y==0: return x else: return gcd(y,x-y) pairwise=True setwise=True gcds=[] for i in range(N): for j in range(i+1,N): g=gcd(A[i],A[j]) ...
Traceback (most recent call last): File "/tmp/tmplrju_y01/tmpjgxb0df_.py", line 1, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s063360087
p02574
u248996551
1599650592
Python
PyPy3 (7.3.0)
py
Runtime Error
2258
208028
771
N=int(input()) A=list(map(int,input().split())) from functools import lru_cache @lru_cache(None) def gcd(x,y): if y>x: x,y=y,x if y==0: return x else: return gcd(y,x-y) pairwise=True setwise=True gcds=[] for i in range(N): for j in range(i+1,N): g=gcd(A[i],A[j]) ...
Traceback (most recent call last): File "/tmp/tmptoq_m4ll/tmpwpp92skq.py", line 1, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s081155414
p02574
u056358163
1599591906
Python
Python (3.8.2)
py
Runtime Error
2207
150772
946
import numpy as np import math from functools import reduce def getD(num): input_list = [2 if i % 2 == 0 else i for i in range(num+1)] bool_list = [False if i % 2 == 0 else True for i in range(num+1)] sqrt = np.sqrt(num) for serial in range(3, num, 2): if serial >= sqrt: retur...
Traceback (most recent call last): File "/tmp/tmp87men5af/tmpsgklu9o0.py", line 20, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s628718436
p02574
u056358163
1599590436
Python
Python (3.8.2)
py
Runtime Error
677
145056
935
import numpy as np def getD(num): input_list = [2 if i % 2 == 0 else i for i in range(num+1)] bool_list = [False if i % 2 == 0 else True for i in range(num+1)] sqrt = np.sqrt(num) for serial in range(3, num, 2): if serial >= sqrt: return input_list for s in range(seri...
Traceback (most recent call last): File "/tmp/tmprll6nmx6/tmpcqqoia4d.py", line 18, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s708182415
p02574
u056358163
1599589932
Python
Python (3.8.2)
py
Runtime Error
670
150732
936
import numpy as np def getD(num): input_list = [2 if i % 2 == 0 else i for i in range(num+1)] bool_list = [False if i % 2 == 0 else True for i in range(num+1)] sqrt = np.sqrt(num) for serial in range(3, num, 2): if serial >= sqrt: return input_list for s in range(seri...
Traceback (most recent call last): File "/tmp/tmpyvoczowv/tmp7f1j886k.py", line 18, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s105519359
p02574
u648212584
1599479770
Python
PyPy3 (7.3.0)
py
Runtime Error
387
190568
483
import sys input = sys.stdin.buffer.readline def main(): N = int(input()) a = list(map(int,input().split())) pr = [0]*(max(a)+1) for num in a: pr[num] += 1 for i in range(2, max(a)+1): count = sum(pr[i::i]) if count == N: print("not coprime") elif co...
Traceback (most recent call last): File "/tmp/tmp4cae6psi/tmp5f22c6am.py", line 23, in <module> main() File "/tmp/tmp4cae6psi/tmp5f22c6am.py", line 5, in main N = int(input()) ^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: b''
s861088470
p02574
u609061751
1599468877
Python
PyPy3 (7.3.0)
py
Runtime Error
91
74692
2999
def main(): import os import sys from io import BytesIO, IOBase BUFSIZE = 8192 class FastIO(IOBase): newlines = 0 def __init__(self, file): self._fd = file.fileno() self.buffer = BytesIO() self.writable = "x" in file.mode o...
File "/tmp/tmpxhc5wlm3/tmp470wwm2o.py", line 4 import sys ^ IndentationError: unindent does not match any outer indentation level
s835242491
p02574
u347203174
1599458839
Python
Python (3.8.2)
py
Runtime Error
442
132692
728
import math N = int(input()) num = list(map(int, input().split())) MAXX = 10**6 + 1 MAXZ = int(math.sqrt(MAXX)+1) furui = [[] for _ in range(MAXZ)] furui[1].append(1) count = [0]*MAXX for i in range(2, MAXZ): if len(furui[i]) == 0: for k in range(i, MAXZ, i): furui[k].append(i) setwise = True...
Traceback (most recent call last): File "/tmp/tmpjosu4rr0/tmppnqnarad.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s294264294
p02574
u347203174
1599458767
Python
PyPy3 (7.3.0)
py
Runtime Error
262
189780
728
import math N = int(input()) num = list(map(int, input().split())) MAXX = 10**6 + 1 MAXZ = int(math.sqrt(MAXX)+1) furui = [[] for _ in range(MAXZ)] furui[1].append(1) count = [0]*MAXX for i in range(2, MAXZ): if len(furui[i]) == 0: for k in range(i, MAXZ, i): furui[k].append(i) setwise = True...
Traceback (most recent call last): File "/tmp/tmpsj5ll8xh/tmphjast1sh.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s571242491
p02574
u347203174
1599458710
Python
PyPy3 (7.3.0)
py
Runtime Error
300
204752
733
from math import sqrt N = int(input()) num = list(map(int, input().split())) MAXX = 10**6 + 1 MAXZ = int(sqrt(MAXX)+1) furui = [[] for _ in range(MAXZ)] furui[1].append(1) count = [0]*MAXX for i in range(2, MAXZ): if len(furui[i]) == 0: for k in range(i, MAXZ, i): furui[k].append(i) setwise =...
Traceback (most recent call last): File "/tmp/tmpvl9r98me/tmpwyjh_zlb.py", line 2, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s872697419
p02574
u952467214
1599432589
Python
PyPy3 (7.3.0)
py
Runtime Error
2210
244788
1303
import sys sys.setrecursionlimit(10 ** 7) input = sys.stdin.readline from math import gcd n = int(input()) a = list( map(int, input().split())) g = 0 for aa in a: g = gcd(g,aa) if g > 1: print('not coprime') exit() def eratosthenes(limit): import math if not isinstance(limit, int): raise...
Traceback (most recent call last): File "/tmp/tmp3wqezy93/tmpsowvfm9y.py", line 6, in <module> n = int(input()) ^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s511727609
p02574
u586639900
1599426460
Python
PyPy3 (7.3.0)
py
Runtime Error
1148
410844
699
from math import gcd MAX = 10**6 sieve = [i for i in range(MAX+1)] p = 2 while p * p <= MAX: if sieve[p] == p: for i in range(p*2, MAX+1, p): if sieve[i] == i: sieve[i] = p p += 1 N = int(input()) A = list(map(int, input().split())) pf = [] for a in A: tmp = set() ...
Traceback (most recent call last): File "/tmp/tmpbc07r7hz/tmpz5wi78im.py", line 15, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s231611601
p02574
u586639900
1599426275
Python
PyPy3 (7.3.0)
py
Runtime Error
85
68640
655
import numpy as np MAX = 10**6 sieve = [i for i in range(MAX+1)] p = 2 while p * p <= MAX: if sieve[p] == p: for i in range(p*2, MAX+1, p): if sieve[i] == i: sieve[i] = p p += 1 N = int(input()) A = list(map(int, input().split())) pf = [] for a in A: tmp = set() ...
Traceback (most recent call last): File "/tmp/tmpcw4_u9pt/tmpuct1uww0.py", line 15, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s710621691
p02574
u623231048
1599422253
Python
PyPy3 (7.3.0)
py
Runtime Error
2210
197108
737
n = int(input()) a = list(map(int,input().split())) li = [0] * 10**3 def factorization(n): arr = [] temp = n for i in range(2, int(-(-n**0.5//1))+1): if temp%i==0: cnt=0 while temp%i==0: cnt+=1 temp //= i arr.append([i, cnt]) ...
Traceback (most recent call last): File "/tmp/tmpwb2qab5p/tmpqffkq0im.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s434465397
p02574
u608007704
1599415236
Python
PyPy3 (7.3.0)
py
Runtime Error
797
213376
885
def gen_factorization(N): tables=[-1]*(N+1) for i in range(2,N+1): if tables[i]!=-1:continue tmp=i while tmp<=N: tables[tmp]=i tmp+=i def fuctorization(n): if n==1:return 1 elif n<0:n=abs(n) if n>N:return {} ans={} whil...
Traceback (most recent call last): File "/tmp/tmpbofsl0eb/tmp20jlts3q.py", line 25, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s788441041
p02574
u608007704
1599415113
Python
PyPy3 (7.3.0)
py
Runtime Error
889
213356
887
def gen_factorization(N): tables=[-1]*(N+1) for i in range(2,N+1): if tables[i]!=-1:continue tmp=i while tmp<=N: tables[tmp]=i tmp+=i def fuctorization(n): if n==1:return 1 elif n<0:n=abs(n) elif n>N:return -1 ans={} wh...
Traceback (most recent call last): File "/tmp/tmpsd2usrgh/tmpiz_qri7d.py", line 25, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s179093210
p02574
u608007704
1599415008
Python
PyPy3 (7.3.0)
py
Runtime Error
798
213564
884
def gen_factorization(N): tables=[-1]*(N+1) for i in range(2,N+1): if tables[i]!=-1:continue tmp=i while tmp<=N: tables[tmp]=i tmp+=i def fuctorization(n): if n==1:return 1 elif n<0:n=abs(n) elif n>N:return -1 ans={} wh...
Traceback (most recent call last): File "/tmp/tmpomg760if/tmpifw1bkob.py", line 25, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s961498523
p02574
u608007704
1599414820
Python
PyPy3 (7.3.0)
py
Runtime Error
803
213340
886
isPair=True isSet=True def gen_factorization(N): tables=[-1]*(N+1) for i in range(2,N): if tables[i]!=-1:continue tmp=i while tmp<=N: tables[tmp]=i tmp+=i def fuctorization(n): if n==1:return 1 elif n<0:n=abs(n) elif n>N:return -1 ...
Traceback (most recent call last): File "/tmp/tmptg3acexu/tmps592mr1h.py", line 27, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s434419380
p02574
u608007704
1599414749
Python
PyPy3 (7.3.0)
py
Runtime Error
1037
213656
909
isPair=True isSet=True def gen_factorization(N): tables=[-1]*(N+1) for i in range(2,N): if tables[i]!=-1:continue tmp=i while tmp<=N: tables[tmp]=i tmp+=i def fuctorization(n): if n==1:return 1 elif n<0:n=abs(n) elif n>N:return -1 ...
Traceback (most recent call last): File "/tmp/tmp0kmpzy55/tmpwmax4hez.py", line 27, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s724281617
p02574
u459419927
1599406640
Python
Python (3.8.2)
py
Runtime Error
1942
126976
856
import math n=int(input()) a=list(map(int,input().split())) soin = [0]*(10**5+1) if a.count(1)==n: print("pairwise coprime") exit() def factorization(n): arr = [] temp = n for i in range(2, int(-(-n ** 0.5 // 1)) + 1): if temp % i == 0: while temp % i == 0: temp ...
Traceback (most recent call last): File "/tmp/tmp5posw2lt/tmp59mrxhm8.py", line 2, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s020848476
p02574
u459419927
1599406504
Python
Python (3.8.2)
py
Runtime Error
1949
126920
852
import math n=int(input()) a=list(map(int,input().split())) soin = [0]*(10**5+1) if sum(a)==n: print("pairwise coprime") exit() def factorization(n): arr = [] temp = n for i in range(2, int(-(-n ** 0.5 // 1)) + 1): if temp % i == 0: while temp % i == 0: temp //= ...
Traceback (most recent call last): File "/tmp/tmpaaw_pdg6/tmp9hvkmgoj.py", line 2, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s713368075
p02574
u459419927
1599406295
Python
Python (3.8.2)
py
Runtime Error
1967
126900
837
import math n=int(input()) a=list(map(int,input().split())) soin = [0]*(10**5+1) if sum(a)==n: print("pairwise coprime") exit() def factorization(n): arr = [] temp = n for i in range(2, int(-(-n ** 0.5 // 1)) + 1): if temp % i == 0: while temp % i == 0: temp //= ...
Traceback (most recent call last): File "/tmp/tmp6k_8altl/tmppexrjy5g.py", line 2, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s254023335
p02574
u427427681
1599406184
Python
Python (3.8.2)
py
Runtime Error
25
8948
966
N = int(input()) Alist = list(map(int,input().split())) def GCD(a,b): if a>b: a = a%b if a == 0: return(b) else: return GCD(a,b) else: b = b%a if b == 0: return(a) el...
File "/tmp/tmp9xp563gg/tmpmui7gill.py", line 1 N = int(input()) IndentationError: unexpected indent
s358719875
p02574
u459419927
1599406177
Python
Python (3.8.2)
py
Runtime Error
1933
134564
783
import math n=int(input()) a=list(map(int,input().split())) soin = [0]*(10**5+1) def factorization(n): arr = [] temp = n for i in range(2, int(-(-n ** 0.5 // 1)) + 1): if temp % i == 0: while temp % i == 0: temp //= i arr.append(i) if temp != 1: ...
Traceback (most recent call last): File "/tmp/tmp3t4hyc5x/tmpwhknftbb.py", line 2, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s532847622
p02574
u459419927
1599406158
Python
Python (3.8.2)
py
Runtime Error
1934
127836
812
import math from functools import reduce n=int(input()) a=list(map(int,input().split())) soin = [0]*(10**5+1) def factorization(n): arr = [] temp = n for i in range(2, int(-(-n ** 0.5 // 1)) + 1): if temp % i == 0: while temp % i == 0: temp //= i arr.append(...
Traceback (most recent call last): File "/tmp/tmp8d7p6zkx/tmpbcy3vkob.py", line 3, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s190785303
p02574
u687044304
1599383795
Python
PyPy3 (7.3.0)
py
Runtime Error
2216
389800
1252
# -*- coding:utf-8 -*- def prime_factor(n): """因数分解して因数のみを取得する""" if n <= 1: return {} ans = set() i = 2 while i*i <= n: while n%i == 0: if not i in ans: ans.add(i) n //= i i += 1 if n != 1: ans.add(n) return ans def solve()...
Traceback (most recent call last): File "/tmp/tmp3gvx64r3/tmpmx45kji7.py", line 61, in <module> solve() File "/tmp/tmp3gvx64r3/tmpmx45kji7.py", line 21, in solve N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s334308223
p02574
u687044304
1599382794
Python
Python (3.8.2)
py
Runtime Error
2221
453796
1252
# -*- coding:utf-8 -*- def prime_factor(n): """因数分解して因数のみを取得する""" if n <= 1: return {} ans = set() i = 2 while i*i <= n: while n%i == 0: if not i in ans: ans.add(i) n //= i i += 1 if n != 1: ans.add(n) return ans def solve()...
Traceback (most recent call last): File "/tmp/tmp_jcb2j_u/tmpi675h5ja.py", line 61, in <module> solve() File "/tmp/tmp_jcb2j_u/tmpi675h5ja.py", line 21, in solve N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s576770934
p02574
u687044304
1599382577
Python
Python (3.8.2)
py
Runtime Error
2220
462356
1330
# -*- coding:utf-8 -*- def prime_factor(n): """因数分解して因数のみを取得する""" if n <= 1: return {} ans = set() i = 2 while i*i <= n: while n%i == 0: if not i in ans: ans.add(i) n //= i i += 1 if n != 1: ans.add(n) return ans def solve()...
Traceback (most recent call last): File "/tmp/tmp5uu5xhdh/tmpqbxvh4mr.py", line 62, in <module> solve() File "/tmp/tmp5uu5xhdh/tmpqbxvh4mr.py", line 21, in solve N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s956506711
p02574
u693566873
1599380557
Python
PyPy3 (7.3.0)
py
Runtime Error
2242
280252
1133
import sys input = sys.stdin.readline N = int(input()) A = map(int, input().split()) is_prime = [1] * 1001 is_prime[0] = 0 is_prime[1] = 0 for current in range(2, 1001): if is_prime[current]: for i in range(2, 1 + 1000//current): is_prime[i*current] = 0 primes = [] for i in range(2, 1001): if is_prime[i]...
Traceback (most recent call last): File "/tmp/tmprx8gbgnt/tmpsjctxoj7.py", line 3, in <module> N = int(input()) ^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s006341701
p02574
u658181634
1599349902
Python
Python (3.8.2)
py
Runtime Error
2209
155004
1026
N = int(input()) A = list(map(int, input().split(" "))) """ エラトステネスの篩 1. 探索リストに2からxまでの整数を昇順で入れる。 2. 探索リストの先頭の数を素数リストに移動し、その倍数を探索リストから篩い落とす。 3. 上記の篩い落とし操作を探索リストの先頭値がxの平方根に達するまで行う。 4. 探索リストに残った数を素数リストに移動して処理終了。 """ A_max = max(A) P = [] arr = list(range(2, A_max + 1)) while len(arr) > 0: i = arr.pop(0) P.append...
Traceback (most recent call last): File "/tmp/tmp8s0sj3j1/tmp9t5q99q6.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s983839485
p02574
u658181634
1599348854
Python
Python (3.8.2)
py
Runtime Error
2211
175200
971
N = int(input()) A = list(map(int, input().split(" "))) """ エラトステネスの篩 1. 探索リストに2からxまでの整数を昇順で入れる。 2. 探索リストの先頭の数を素数リストに移動し、その倍数を探索リストから篩い落とす。 3. 上記の篩い落とし操作を探索リストの先頭値がxの平方根に達するまで行う。 4. 探索リストに残った数を素数リストに移動して処理終了。 """ A_max = max(A) P = [] arr = list(range(2, A_max + 1)) while len(arr) > 0: i = arr.pop(0) P.append...
Traceback (most recent call last): File "/tmp/tmpb8g3xmnc/tmpr90srlb9.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s686975404
p02574
u892797057
1599329769
Python
PyPy3 (7.3.0)
py
Runtime Error
98
74604
1206
import math import numpy as np def get_pseudo_input(): N = 3 A = np.array([6, 10, 16]) return N, A def get_input(): N = int(input()) A = np.array([int(x) for x in input().split()]) return N, A def sieve_of_eratosthenes(x: int): ret = np.full(x + 1, -1) for i in range(1, x + 1): ...
Traceback (most recent call last): File "/tmp/tmpaxk6plhz/tmpu0b51mxt.py", line 35, in <module> N, A = get_input() ^^^^^^^^^^^ File "/tmp/tmpaxk6plhz/tmpu0b51mxt.py", line 13, in get_input N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s442867496
p02574
u585963734
1599321876
Python
Python (3.8.2)
py
Runtime Error
2207
127752
626
from functools import reduce from math import gcd N=int(input()) A=list(map(int, input().split())) c=max(A)+1 D=[0]*c div=[0]*c P=[] for i in range(2,c): if D[i]==0: P.append(i) D[i]=i for j in P: if i*j>=c or j>D[i] : break D[i*j]=j for i in A: if i==1: ...
Traceback (most recent call last): File "/tmp/tmp9mw_5hil/tmpffb2cf_w.py", line 4, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s458461220
p02574
u585963734
1599320588
Python
Python (3.8.2)
py
Runtime Error
2208
127632
640
from functools import reduce from math import gcd N=int(input()) A=list(map(int, input().split())) c=max(A)+1 D=[0]*c div=[0]*c P=[] for i in range(2,c): if D[i]==0: P.append(i) D[i]=i for j in P: if i*j>=c or j>D[i] : break D[i*j]=j for i in A: if i==1: ...
Traceback (most recent call last): File "/tmp/tmp72v_dczh/tmp7d0r65ec.py", line 4, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s412258885
p02574
u881141729
1599315261
Python
Python (3.8.2)
py
Runtime Error
361
127324
955
N = int(input()) A = list(map(int, input().split())) maxn = 105 prime = [0 for _ in range(maxn)] for i in range(2, maxn): if prime[i] == 0: for j in range(i, maxn, i): prime[j] = i #最大質因數 st = set() #目前出現過的所有質因數,一開始為A[0]的所有質因數 a = A[0] while prime[a]: st.add(prime[a]) x = prime[a] ...
Traceback (most recent call last): File "/tmp/tmpexzapq_5/tmpu1rtq9q2.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s158141136
p02574
u585963734
1599313993
Python
Python (3.8.2)
py
Runtime Error
760
128060
776
from functools import reduce from math import gcd N=int(input()) A=list(map(int, input().split())) c=max(A)+1 D=[0]*c div=[0]*c P=[] for i in range(2,c): if D[i]==0: P.append(i) D[i]=i for j in P: if i*j>=c or j>D[i] : break D[i*j]=j g=c f=0 for i in A: if i==1...
Traceback (most recent call last): File "/tmp/tmp4n57pdcl/tmpwng5s80m.py", line 4, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s540962855
p02574
u585963734
1599313886
Python
Python (3.8.2)
py
Runtime Error
804
128284
776
from functools import reduce from math import gcd N=int(input()) A=list(map(int, input().split())) c=max(A)+1 D=[0]*c div=[0]*c P=[] for i in range(2,c): if D[i]==0: P.append(i) D[i]=i for j in P: if i*j>=c or j>D[i] : break D[i*j]=j g=c f=0 for i in A: if i==1...
Traceback (most recent call last): File "/tmp/tmphctt92yo/tmpefl60lfq.py", line 4, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s342506263
p02574
u585963734
1599313024
Python
Python (3.8.2)
py
Runtime Error
242
128000
770
from functools import reduce from math import gcd N=int(input()) A=list(map(int, input().split())) c=10**4+1 D=[0]*c div=[0]*c P=[] for i in range(2,c): if D[i]==0: P.append(i) D[i]=i for j in P: if i*j>c-1 or j>D[i] : break D[i*j]=j g=A[0] f=0 for i in A: if i...
Traceback (most recent call last): File "/tmp/tmp6gyhskqc/tmp0bjdihje.py", line 4, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s183772641
p02574
u658181634
1599311381
Python
Python (3.8.2)
py
Runtime Error
2209
151504
796
N = int(input()) A = list(map(int, input().split(" "))) A_max = max(A) P = [] arr = list(range(2, A_max + 1)) while True: i = arr.pop(0) P.append(i) arr = [j for j in arr if j % i != 0] if i > A_max ** 0.5: P.extend(arr) break def factorize(x): f = [] for p in P: rest ...
Traceback (most recent call last): File "/tmp/tmpae5te54g/tmpprh2wxx0.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s614187525
p02574
u658181634
1599311308
Python
Python (3.8.2)
py
Runtime Error
2211
142248
1536
import math N = int(input()) A = list(map(int, input().split(" "))) """ エラトステネスの篩 1. 探索リストに2からxまでの整数を昇順で入れる。 2. 探索リストの先頭の数を素数リストに移動し、その倍数を探索リストから篩い落とす。 3. 上記の篩い落とし操作を探索リストの先頭値がxの平方根に達するまで行う。 4. 探索リストに残った数を素数リストに移動して処理終了。 """ A_max = max(A) P = [] arr = list(range(2, A_max+1)) while True: i = arr.pop(0) P.app...
Traceback (most recent call last): File "/tmp/tmp8kv58wd7/tmpuhfxk3_b.py", line 3, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s005383074
p02574
u966584145
1599310289
Python
Python (3.8.2)
py
Runtime Error
597
126412
741
n = int(input()) A = list(map(int, input().split())) maxV = (10 ** 6 + 1) sieve = [i for i in range(maxV)] p = 2 while p*p < maxV: if sieve[p] == p: for q in range(p*2, maxV, p): if sieve[q] == q: sieve[q] = p p += 1 from math import gcd g = 0 primes = set() for a in A: ...
Traceback (most recent call last): File "/tmp/tmptuoru__j/tmpkgc5de81.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s855938061
p02574
u585963734
1599307934
Python
Python (3.8.2)
py
Runtime Error
2208
134556
590
from math import gcd N=int(input()) A=list(map(int, input().split())) c=max(A) D=[0]*(c+1) div=[0]*(c+1) P=[] for i in range(2,c+1): if D[i]==0: P.append(i) D[i]=i for j in P: if i*j>c and i>D[j]: break D[i*j]=j for i in A: c=gcd(c,i) if i==1: conti...
Traceback (most recent call last): File "/tmp/tmpsc5kbc6t/tmplis3kt1p.py", line 3, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s797206024
p02574
u585963734
1599307859
Python
Python (3.8.2)
py
Runtime Error
929
127220
568
N=int(input()) A=list(map(int, input().split())) c=max(A) D=[0]*(c+1) div=[0]*(c+1) P=[] for i in range(2,c+1): if D[i]==0: P.append(i) D[i]=i for j in P: if i*j>c and i>D[j]: break D[i*j]=j for i in A: c=gcd(c,i) if i==1: continue temp=i if ...
Traceback (most recent call last): File "/tmp/tmp_ux2jmfa/tmpttbkq3i2.py", line 1, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s932769795
p02574
u585963734
1599298264
Python
Python (3.8.2)
py
Runtime Error
2208
134440
549
from math import gcd N=int(input()) A=list(map(int, input().split())) c=max(A) D=[0]*(c+1) div=[0]*(c+1) P=[] for i in range(2,c+1): if D[i]==0: P.append(i) D[i]=i for j in P: if i*j>c: break D[i*j]=j for i in A: c=gcd(c,i) temp=i if temp==D[temp]: ...
Traceback (most recent call last): File "/tmp/tmp0breeo7e/tmpk8aatr_j.py", line 3, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s547219854
p02574
u585963734
1599297475
Python
Python (3.8.2)
py
Runtime Error
2208
132584
499
from math import gcd N=int(input()) A=list(map(int, input().split())) c=max(A) g=max(A) D=[0]*(c+1) yak=[0]*(c+1) P=[] for i in range(2,c+1): if D[i]==0: P.append(i) D[i]=i for j in P: if i*j>c: break D[i*j]=j for i in A: g=gcd(g,i) temp=i while temp!=...
Traceback (most recent call last): File "/tmp/tmp8a7iiwee/tmpto35ox9p.py", line 3, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s637420426
p02574
u935558307
1599296748
Python
PyPy3 (7.3.0)
py
Runtime Error
88
74732
936
from math import gcd """ pairwise coprimeであるための条件は、全てのAに関して素因数に重複がないことである。 したがって、各Aに関して素因数分解を行う⇒各数の素因数の種類数をカウントし総和する。⇒全体の素因数の種類数をカウントし、先ほどの総和と比較する。 """ N = int(input()) A = list(map(int,input().split())) primes = set() cnt = 0 for i in range(N): a = A[i] d = 2 ceil = int(a**0.5)+1 for d in range(2,ceil...
File "/tmp/tmppa4igwcx/tmpgj6jkdt5.py", line 15 for d in range(2,ceil) ^ SyntaxError: expected ':'
s739538520
p02574
u018679195
1599265684
Python
Python (3.8.2)
py
Runtime Error
27
8880
2143
#include <bits/stdc++.h> using namespace std; #define soort(v) sort(v.begin(),v.end()) #define foor(i,n) for(int i=0; i<n; i++) #define vecprint(v){for(int i=0; i<v.size(); i++)cout << v[i] << " ";} #define arrprint(v, n){for(int i=0; i<n; i++)cout << v[i] << " ";} long long int gcd(long long int a, long long int b){if...
File "/tmp/tmp4kvqx1vd/tmpzaj4g_19.py", line 2 using namespace std; ^^^^^^^^^ SyntaxError: invalid syntax
s533033060
p02574
u326609687
1599244265
Python
Python (3.8.2)
py
Runtime Error
27
8840
18893
# compiled by pythran """ #pythran export main2() import numpy as np i4 = np.int32 i8 = np.int64 def get_primes(N): n_max = int(np.sqrt(N)) + 1 p = np.zeros(N + 1, i8) p[0] = 1 p[1] = 1 for i in range(2, n_max): if p[i] == 0: j = i * 2 while j <= N: ...
File "/tmp/tmpmin7805w/tmpy9drrg_8.py", line 25 Euclid's Algorithm. ^ SyntaxError: unterminated string literal (detected at line 25)
s544360416
p02574
u802977614
1599241644
Python
PyPy3 (7.3.0)
py
Runtime Error
949
217072
2074
# region header import sys, bisect, math, itertools, heapq, collections from operator import itemgetter # a.sort(key=itemgetter(i)) # i番目要素でsort from functools import lru_cache import copy # @lru_cache(maxsize=None) sys.setrecursionlimit(10**8) input = sys.stdin.readline INF = float('inf') mod = 10**9 + 7 eps = 10**-7 ...
Traceback (most recent call last): File "/tmp/tmp8dgbrshe/tmp7jb7q08n.py", line 75, in <module> n = inp() ^^^^^ File "/tmp/tmp8dgbrshe/tmp7jb7q08n.py", line 21, in inp return int(input()) ^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s330102844
p02574
u802977614
1599241355
Python
PyPy3 (7.3.0)
py
Runtime Error
808
216888
2023
# region header import sys, bisect, math, itertools, heapq, collections from operator import itemgetter # a.sort(key=itemgetter(i)) # i番目要素でsort from functools import lru_cache import copy # @lru_cache(maxsize=None) sys.setrecursionlimit(10**8) input = sys.stdin.readline INF = float('inf') mod = 10**9 + 7 eps = 10**-7 ...
Traceback (most recent call last): File "/tmp/tmpcktl22dx/tmp3uatefdw.py", line 75, in <module> n = inp() ^^^^^ File "/tmp/tmpcktl22dx/tmp3uatefdw.py", line 21, in inp return int(input()) ^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s532995377
p02574
u196455939
1599234857
Python
Python (3.8.2)
py
Runtime Error
931
127668
1324
#E_Coprime import math import functools # エラトステネスの篩 def primes(n): is_prime = [1] * (n + 1) is_prime[0] = 0 is_prime[1] = 0 D_prime = [i for i in range(n+1)] D_prime[0] = 0 D_prime[1] = 1 for i in range(2, int(n**0.5) + 1): if not is_prime[i]: D_prime[i] = i ...
Traceback (most recent call last): File "/tmp/tmpl74qv8l1/tmpgeleiwa2.py", line 27, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s937338680
p02574
u785697410
1599230472
Python
PyPy3 (7.3.0)
py
Runtime Error
291
177344
1662
import sys from collections import defaultdict as dd from collections import deque from functools import * from fractions import Fraction as f from copy import * from bisect import * from heapq import * from math import * from itertools import permutations ,product def eprint(*args): print(*args, file=sys.stderr...
Traceback (most recent call last): File "/tmp/tmp5bn41bvi/tmpi4ebhtvd.py", line 77, in <module> n=fi() ^^^^ File "/tmp/tmp5bn41bvi/tmpi4ebhtvd.py", line 37, in fi return int(input()) ^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s167210453
p02574
u531599639
1599215036
Python
Python (3.8.2)
py
Runtime Error
1626
134632
672
import math n = int(input()) a = list(map(int,input().split())) def generate_D(maxA): seq = [i for i in range(maxA+1)] p = 2 while p*p <= maxA: if seq[p]==p: for q in range(p*2,maxA+1,p): if seq[q]==q: seq[q] = p p += 1 return seq cur = a[0] for v in a[1:]: cur = math.gcd(c...
Traceback (most recent call last): File "/tmp/tmpksihg9c4/tmpwv8c8g4u.py", line 2, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s605395233
p02574
u531599639
1599214891
Python
Python (3.8.2)
py
Runtime Error
580
132148
673
import math n = int(input()) a = list(map(int,input().split())) def generate_D(maxA): seq = [i for i in range(maxA+1)] p = 2 while p*p <= maxA: if seq[p]==p: for q in range(p*2,maxA+1,p): if seq[q]==q: seq[q] = p p += 1 return seq cur = a[0] for v in a[1:]: cur = math.gcd(c...
Traceback (most recent call last): File "/tmp/tmp5t3bap5o/tmpn86gxwll.py", line 2, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s422288795
p02574
u177370876
1599214372
Python
PyPy3 (7.3.0)
py
Runtime Error
707
189492
681
n = int(input()) a = list(map(int, input().split())) maxn = 10 ** 6 + 1 numl = [0] * maxn flag = 0 for i in a: for j in range(2, maxn): if(j*j > i): if(numl[i] == 0): numl[i]+=1 else: flag = 1 break if(i % j == 0): if(nu...
Traceback (most recent call last): File "/tmp/tmptky7_y_u/tmpnh5x_cn9.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s808501934
p02574
u181412342
1599166589
Python
PyPy3 (7.3.0)
py
Runtime Error
2210
290988
2087
import sys, io, os, re from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right from pprint import pprint from math import sin, cos, pi, radians, sqrt, floor, ceil from copy import copy, deepcopy from collections import deque, defaultdict from fractions import gcd from functools import re...
Traceback (most recent call last): File "/tmp/tmpwh_l43kq/tmpuy1oc7i6.py", line 7, in <module> from fractions import gcd ImportError: cannot import name 'gcd' from 'fractions' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/fractions.py)
s335195021
p02574
u603958124
1599157469
Python
Python (3.8.2)
py
Runtime Error
770
135724
1058
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement from collections import deque,defaultdict,Counter from bisect import bisect_left,bisect_right from operator impor...
Traceback (most recent call last): File "/tmp/tmpvz4aks0u/tmpq4o5zz5q.py", line 21, in <module> n = INT() ^^^^^ File "/tmp/tmpvz4aks0u/tmpq4o5zz5q.py", line 15, in INT def INT() : return int(input()) ^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s346164406
p02574
u323315992
1599146449
Python
Python (3.8.2)
py
Runtime Error
1802
127348
486
def eratosthenes2(n): lim=int(n**0.5) d=[i+1 for i in range(2,n,2)] D=[2]*(n+1) D[0]=D[1]=-1 while True: p=d[0] if lim<p: for x in d: D[x]=x break D[p]=p d2=[] for x in d: if x%p!=0: d2.append...
Traceback (most recent call last): File "/tmp/tmp5w7jmzhn/tmpmtg8vjot.py", line 22, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s536504603
p02574
u323315992
1599145870
Python
Python (3.8.2)
py
Runtime Error
2209
150520
653
import numpy as np N=int(input()) A=list(map(int,input().split())) maxA=max(A) lim=int(np.sqrt(maxA)) d=[i+1 for i in range(2,maxA,2)] D=[2]*(maxA+1) D[0]=D[1]=-1 while True: p=d[0] if lim<p: for x in d: D[x]=x break D[p]=p d2=[] for x in d: if x%p!=0: ...
Traceback (most recent call last): File "/tmp/tmp30py9_am/tmpt2ps_625.py", line 2, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s844342583
p02574
u334712262
1599145081
Python
PyPy3 (7.3.0)
py
Runtime Error
375
204508
2226
# -*- coding: utf-8 -*- import bisect import heapq import math import random from collections import Counter, defaultdict, deque from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal from functools import lru_cache, reduce from itertools import combinations, combinations_with_replacement, product, permutations from...
Traceback (most recent call last): File "/tmp/tmporr8ad_p/tmpwb6zflbc.py", line 124, in <module> main() File "/tmp/tmporr8ad_p/tmpwb6zflbc.py", line 111, in main N = read_int() ^^^^^^^^^^ File "/tmp/tmporr8ad_p/tmpwb6zflbc.py", line 23, in read_int return int(buff_readline()) ^^^^^^...
s123228602
p02574
u334712262
1599145048
Python
PyPy3 (7.3.0)
py
Runtime Error
366
204512
2244
# -*- coding: utf-8 -*- import bisect import heapq import math import random from collections import Counter, defaultdict, deque from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal from functools import lru_cache, reduce from itertools import combinations, combinations_with_replacement, product, permutations from...
Traceback (most recent call last): File "/tmp/tmpld5avla7/tmp_egefl54.py", line 125, in <module> main() File "/tmp/tmpld5avla7/tmp_egefl54.py", line 112, in main N = read_int() ^^^^^^^^^^ File "/tmp/tmpld5avla7/tmp_egefl54.py", line 23, in read_int return int(buff_readline()) ^^^^^^...
s924390066
p02574
u334712262
1599144882
Python
PyPy3 (7.3.0)
py
Runtime Error
321
204348
2225
# -*- coding: utf-8 -*- import bisect import heapq import math import random from collections import Counter, defaultdict, deque from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal from functools import lru_cache, reduce from itertools import combinations, combinations_with_replacement, product, permutations from...
Traceback (most recent call last): File "/tmp/tmpgn2fr6l0/tmp5ix7eh_h.py", line 125, in <module> main() File "/tmp/tmpgn2fr6l0/tmp5ix7eh_h.py", line 112, in main N = read_int() ^^^^^^^^^^ File "/tmp/tmpgn2fr6l0/tmp5ix7eh_h.py", line 23, in read_int return int(buff_readline()) ^^^^^^...
s646393896
p02574
u323315992
1599143868
Python
Python (3.8.2)
py
Runtime Error
2208
127048
725
def eratosthenes2(n): lim=int(n**0.5) d=[i+1 for i in range(2,n,2)] D=[2]*(n+1) D[0]=0 D[1]=1 while True: p=d[0] if lim<p: for x in d: D[x]=x break D[p]=p for x in d: if x%p==0: D[x]=p d=[...
Traceback (most recent call last): File "/tmp/tmpv_6_k9kr/tmpdfuptdrv.py", line 20, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s018431802
p02574
u323315992
1599143060
Python
Python (3.8.2)
py
Runtime Error
2208
126848
764
def eratosthenes2(n): lim=int(n**0.5) d=[i+1 for i in range(2,n,2)] D=[2]*(n+1) D[0]=0 D[1]=1 while True: p=d[0] if lim<p: for x in d: D[x]=x break D[p]=p d2=[] for x in d: if x%p!=0: d2.a...
Traceback (most recent call last): File "/tmp/tmpx6p_t3_q/tmpixvg4uem.py", line 23, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s454951634
p02574
u323315992
1599141953
Python
Python (3.8.2)
py
Runtime Error
2208
126928
837
def eratosthenes2(n): prime=[2] lim=int(n**0.5) d=[i+1 for i in range(2,n,2)] D=[2]*(n+1) D[0]=0 D[1]=1 while True: p=d[0] if lim<p: for x in d: D[x]=x prime=prime+d break prime.append(p) D[p]=p d2=[]...
Traceback (most recent call last): File "/tmp/tmp69zd23tc/tmpa5x9irti.py", line 26, in <module> N=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s116188360
p02574
u845573105
1599141730
Python
Python (3.8.2)
py
Runtime Error
668
127404
590
N = int(input()) A = list(map(int, input().split())) B = [0 for i in range(max(A)+1)] for i in range(2, len(B)): if B[i] != -1: continue for j in range(i, len(B), i): B[j] = i def func(X): buf = set() while X>1: x = B[X] buf.add(x) while X%x==0: X = X//x return buf set1 = func(A[...
Traceback (most recent call last): File "/tmp/tmpxj1c8nol/tmp2zz_37ng.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s494455784
p02574
u556069480
1599134278
Python
PyPy3 (7.3.0)
py
Runtime Error
2212
262836
993
import math,sys n=int(input()) Ns=list(map(int, input().split())) ans_p="pairwise coprime" ans_s="setwise coprime" ans_n="not coprime" max_n= 10**6+100 count=[0 for _ in range(max_n)] def Era(nn): prime = [] limit = math.sqrt(nn) data = [i + 1 for i in range(1, nn)] while True: p = data.pop(...
Traceback (most recent call last): File "/tmp/tmpjfzq55em/tmpuobpyivh.py", line 3, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s239876068
p02574
u556069480
1599133969
Python
PyPy3 (7.3.0)
py
Runtime Error
1144
331232
916
import math,sys n=int(input()) Ns=list(map(int, input().split())) ans_p="pairwise coprime" ans_s="setwise coprime" ans_n="not coprime" max_n= 10**7+100 count=[0 for _ in range(max_n)] def Era(nn): prime = [] limit = math.sqrt(nn) data = [i + 1 for i in range(1, nn)] while True: p = data.pop(...
Traceback (most recent call last): File "/tmp/tmp1gotbfa0/tmp38_9a8m3.py", line 3, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s624957052
p02574
u556069480
1599133818
Python
PyPy3 (7.3.0)
py
Runtime Error
749
250316
889
import math,sys n=int(input()) Ns=list(map(int, input().split())) ans_p="pairwise coprime" ans_s="setwise coprime" ans_n="not coprime" max_n= 10**6+100 count=[0 for _ in range(max_n)] def Era(n): prime = [] limit = math.sqrt(n) data = [i + 1 for i in range(1, n)] while True: p = data.pop(0) ...
Traceback (most recent call last): File "/tmp/tmp51h_nxv5/tmp9w9em53b.py", line 3, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s378199987
p02574
u556069480
1599133674
Python
Python (3.8.2)
py
Runtime Error
1673
134636
903
import math,sys n=int(input()) Ns=list(map(int, input().split())) ans_p="pairwise coprime" ans_s="setwise coprime" ans_n="not coprime" max_n=int(math.sqrt(10**6))+20 count=[0 for _ in range(max_n)] def Era(n): prime = [] limit = math.sqrt(n) data = [i + 1 for i in range(1, n)] while True: p...
Traceback (most recent call last): File "/tmp/tmpv_bhvu6v/tmpr8ounqc3.py", line 3, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s562681158
p02574
u556069480
1599133497
Python
PyPy3 (7.3.0)
py
Runtime Error
721
250956
903
import math,sys n=int(input()) Ns=list(map(int, input().split())) ans_p="pairwise coprime" ans_s="setwise coprime" ans_n="not coprime" max_n=int(math.sqrt(10**6))+20 count=[0 for _ in range(max_n)] def Era(n): prime = [] limit = math.sqrt(n) data = [i + 1 for i in range(1, n)] while True: p...
Traceback (most recent call last): File "/tmp/tmplepcqcz2/tmpz2_dmqgm.py", line 3, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line