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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s458039695 | p02574 | u446782476 | 1598829426 | Python | Python (3.8.2) | py | Runtime Error | 2210 | 150880 | 1561 | # In[]:
import math
from functools import reduce
# In[]:
def gcd_list(numbers):
return reduce(math.gcd, numbers)
# In[]:
N = int(input())
input_str = input()
input_list = input_str.split()
input_int = [int(x) for x in input_list]
# In[]:
def get_sieve_of_eratosthenes(n):
if not isinstance(n, int):
... | Traceback (most recent call last):
File "/tmp/tmphl_q3puc/tmpy20_n99s.py", line 12, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s318011880 | p02574 | u920977317 | 1598829418 | Python | Python (3.8.2) | py | Runtime Error | 2209 | 126976 | 1080 | import math
import sys
def main():
N=int(input())
A=list(map(int,input().split()))
#pairwise
A_max=max(A)
D=[-1 for _ in range(A_max+1)]
F=[i for i in range(2,A_max+1)]
bound=math.sqrt(A_max)
n=F[0]
while len(F)>0:
temp=[]
for f in F:
if f%n!=0:
... | Traceback (most recent call last):
File "/tmp/tmp6j90nuiv/tmpiqskfmzz.py", line 55, in <module>
main()
File "/tmp/tmp6j90nuiv/tmpiqskfmzz.py", line 5, in main
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s956907481 | p02574 | u522293645 | 1598829013 | Python | Python (3.8.2) | py | Runtime Error | 1189 | 134644 | 1013 | from math import gcd # Python3.6以降
# --------------------------------------------------------------
# n以下の素数列挙: O-nlogn
def primes(n):
prs = []
is_prime = [True] * (n + 1)
is_prime[0] = False
is_prime[1] = False
for i in range(2, int(n**0.5)+1):
if not is_prime[i]:
continue
... | Traceback (most recent call last):
File "/tmp/tmpne0m7d5u/tmp893_nkhr.py", line 20, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s463173824 | p02574 | u522293645 | 1598828832 | Python | Python (3.8.2) | py | Runtime Error | 1228 | 126792 | 1085 | from math import gcd # Python3.6以降
# --------------------------------------------------------------
# n以下の素数列挙: O-nlogn
def primes(n):
prs = []
is_prime = [True] * (n + 1)
is_prime[0] = False
is_prime[1] = False
for i in range(2, int(n**0.5)+1):
if not is_prime[i]:
continue
... | Traceback (most recent call last):
File "/tmp/tmpvtxsahri/tmpluk9b4b4.py", line 20, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s984818656 | p02574 | u699089116 | 1598828468 | Python | Python (3.8.2) | py | Runtime Error | 329 | 127768 | 667 | import functools
from math import gcd
N = int(input())
A = list(map(int, input().split()))
MAX = 10 * 6 + 10
if functools.reduce(gcd, A) != 1:
print("not coprime")
exit()
prime_list = [i for i in range(MAX + 1)]
p = 2
while p * p <= MAX:
if prime_list[p] == p:
for q in range(2*p, MAX+1, p):
... | Traceback (most recent call last):
File "/tmp/tmpg99s2lyz/tmpnjv8w39j.py", line 3, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s713294795 | p02574 | u699089116 | 1598828308 | Python | Python (3.8.2) | py | Runtime Error | 288 | 127668 | 671 | import functools
from math import gcd
N = int(input())
A = list(map(int, input().split()))
MAX = 10 * 6 + 10
if functools.reduce(gcd, A) == 1:
print("setwise coprime")
exit()
prime_list = [i for i in range(MAX + 1)]
p = 2
while p * p <= MAX:
if prime_list[p] == p:
for q in range(2*p, MAX+1, p):
... | Traceback (most recent call last):
File "/tmp/tmp8uyt44zd/tmpux1cf65k.py", line 3, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s538958900 | p02574 | u699089116 | 1598827872 | Python | Python (3.8.2) | py | Runtime Error | 490 | 127896 | 643 | import functools
from math import gcd
N = int(input())
A = list(map(int, input().split()))
MAX = 10 * 6 + 10
prime_list = [i for i in range(MAX + 1)]
p = 2
while p * p <= MAX:
if prime_list[p] == p:
for q in range(2*p, MAX+1, p):
if prime_list[q] == q:
prime_list[q] = p
p +=... | Traceback (most recent call last):
File "/tmp/tmpcu10vyra/tmpuzd707wt.py", line 3, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s342653924 | p02574 | u699089116 | 1598827633 | Python | Python (3.8.2) | py | Runtime Error | 484 | 127664 | 641 | import functools
from math import gcd
N = int(input())
A = list(map(int, input().split()))
MAX = 10 * 6 + 10
prime_list = [i for i in range(MAX + 1)]
p = 2
while p * p <= MAX:
if prime_list[p] == p:
for q in range(2*p, MAX+1, p):
if prime_list[q] == q:
prime_list[q] = p
p +=... | Traceback (most recent call last):
File "/tmp/tmplpn2zut9/tmp0dg0ste1.py", line 3, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s084617138 | p02574 | u107639613 | 1598824953 | Python | PyPy3 (7.3.0) | py | Runtime Error | 435 | 237768 | 1564 | import sys
from math import gcd
def input(): return sys.stdin.readline().strip()
def fast_prime_factorization(A, max_num):
"""
リストAに現れる自然数全てをO(NlogN)で素因数分解する(NはリストAの長さ)
max_numはAに現れる自然数の上界。
"""
# エラトステネスの篩でprimes[i] = (iを割り切る最小の素数)を記録する
primes = [0] * (max_num + 1)
for i in range(2, int(max... | Traceback (most recent call last):
File "/tmp/tmpzd_sia4f/tmpd4o5dnb5.py", line 55, in <module>
main()
File "/tmp/tmpzd_sia4f/tmpd4o5dnb5.py", line 31, in main
N = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s456301045 | p02574 | u645487439 | 1598824332 | Python | Python (3.8.2) | py | Runtime Error | 376 | 127576 | 422 | import math
from functools import reduce
n = int(input())
a_list = list(map(int, input().split()))
max = a_list[n - 1] + 100
memo = [0] * max
for a in a_list:
memo[a] += 1
for i in range(2, max):
if sum(memo[i::i]) > 1:
if reduce(math.gcd, a_list) == 1:
print("setwise coprime")
... | Traceback (most recent call last):
File "/tmp/tmp_cgzmnot/tmp1sbl4g38.py", line 4, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s028770617 | p02574 | u645487439 | 1598824288 | Python | Python (3.8.2) | py | Runtime Error | 2357 | 182476 | 451 | import math
from functools import reduce
n = int(input())
a_list = list(map(int, input().split()))
max = a_list[n - 1] + 100
memo = [0] * max
for a in a_list:
print(a)
print(memo)
memo[a] += 1
for i in range(2, max):
if sum(memo[i::i]) > 1:
if reduce(math.gcd, a_list) == 1:
print(... | Traceback (most recent call last):
File "/tmp/tmp07fychh5/tmpueb_thu9.py", line 4, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s066985743 | p02574 | u625046108 | 1598824183 | Python | PyPy3 (7.3.0) | py | Runtime Error | 480 | 200388 | 513 | from fractions import gcd
N = int(input())
As = list(map(int, input().split()))
A = max(As)
lst = [0]*(A+1)
rlt = [0]*(A+1)
for i in range(2, len(lst)//2):
if lst[i] > 0:
continue
j = 1
while i*j <= A:
if lst[i*j] == 0:
lst[i*j] = i
j += 1
for a in As:
tmp = -1
while a > 1:
if tm... | Traceback (most recent call last):
File "/tmp/tmp7pm_b4sp/tmpjdll63bt.py", line 1, in <module>
from fractions import gcd
ImportError: cannot import name 'gcd' from 'fractions' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/fractions.py)
| |
s464665835 | p02574 | u645487439 | 1598823991 | Python | Python (3.8.2) | py | Runtime Error | 242 | 127608 | 416 | import math
from functools import reduce
n = int(input())
a_list = list(map(int, input().split()))
max = a_list[n - 1]
memo = [0] * max
for a in a_list:
memo[a] += 1
for i in range(2, max):
if sum(memo[i::i]) > 1:
if reduce(math.gcd, a_list) == 1:
print("setwise coprime")
exit... | Traceback (most recent call last):
File "/tmp/tmpaubrdiyq/tmpx_i5316x.py", line 4, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s644988786 | p02574 | u645487439 | 1598823947 | Python | Python (3.8.2) | py | Runtime Error | 371 | 127588 | 420 | import math
from functools import reduce
n = int(input())
a_list = list(map(int, input().split()))
max = a_list[n - 1] + 1
memo = [0] * max
for a in a_list:
memo[a] += 1
for i in range(2, max):
if sum(memo[i::i]) > 1:
if reduce(math.gcd, a_list) == 1:
print("setwise coprime")
... | Traceback (most recent call last):
File "/tmp/tmpkim4v717/tmpl8pgnogd.py", line 4, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s019560984 | p02574 | u645487439 | 1598823893 | Python | Python (3.8.2) | py | Runtime Error | 387 | 127980 | 417 | import math
from functools import reduce
n = int(input())
a_list = list(map(int, input().split()))
max = a_list[-1] + 2
memo = [0] * max
for a in a_list:
memo[a] += 1
for i in range(2, max):
if sum(memo[i::i]) > 1:
if reduce(math.gcd, a_list) == 1:
print("setwise coprime")
exi... | Traceback (most recent call last):
File "/tmp/tmpk3t2djpb/tmp6w6pmg6l.py", line 4, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s040585600 | p02574 | u645487439 | 1598823599 | Python | Python (3.8.2) | py | Runtime Error | 372 | 127896 | 417 | import math
from functools import reduce
n = int(input())
a_list = list(map(int, input().split()))
max = a_list[-1] + 1
memo = [0] * max
for a in a_list:
memo[a] += 1
for i in range(2, max):
if sum(memo[i::i]) > 1:
if reduce(math.gcd, a_list) == 1:
print("setwise coprime")
exi... | Traceback (most recent call last):
File "/tmp/tmpvl4szu29/tmptyjtf53q.py", line 4, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s096743225 | p02574 | u645487439 | 1598823207 | Python | Python (3.8.2) | py | Runtime Error | 376 | 127724 | 420 | import math
from functools import reduce
n = int(input())
a_list = list(map(int, input().split()))
memo = [0] * (a_list[-1] + 1)
for a in a_list:
memo[a] += 1
for i in range(2, a_list[-1] + 1):
if sum(memo[i::i]) > 1:
if reduce(math.gcd, a_list) == 1:
print("setwise coprime")
... | Traceback (most recent call last):
File "/tmp/tmpy1jecthb/tmp0k05iofb.py", line 4, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s651402670 | p02574 | u645487439 | 1598821721 | Python | Python (3.8.2) | py | Runtime Error | 331 | 127828 | 878 | import math
from functools import reduce
n = int(input())
a_list = list(map(int, input().split()))
prime_list = list(range(math.ceil(a_list[n - 1] ** 0.5) + 1))
for i in range(2, prime_list[-1] + 1):
if prime_list[i] != -1:
for j in range(i * 2, prime_list[-1] + 1, i):
prime_list[index] = -1
p... | Traceback (most recent call last):
File "/tmp/tmp96spq53q/tmp18zkzr58.py", line 4, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s168548212 | p02574 | u645487439 | 1598821667 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9036 | 877 | import math
from functools import reduce
n = int(input())
a_list = list(map(int, input().split()))
prime_list = list(range(math.ceil(a_list[n - 1] ** 0.5) + 1))
for i in range(2, prime_list[-1] + 1):
if prime_list[i] != -1:
for j in range(i * 2, prime_list[-1] + 1, i)
prime_list[index] = -1
pr... | File "/tmp/tmp8m493hug/tmp7o850thn.py", line 10
for j in range(i * 2, prime_list[-1] + 1, i)
^
SyntaxError: expected ':'
| |
s319657165 | p02574 | u437351386 | 1598821502 | Python | PyPy3 (7.3.0) | py | Runtime Error | 332 | 181768 | 918 | 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/tmpt82uwy0m/tmp5xnfzk_v.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s978812650 | p02574 | u107639613 | 1598820454 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2207 | 188920 | 680 | import sys
from math import gcd
def input(): return sys.stdin.readline().strip()
def main():
N = int(input())
A =list(map(int, input().split()))
A.sort()
idx = 0
while A[idx] == 1: idx += 1
A = A[idx:]
if idx == N:
print("pairwise coprime")
return
all_gcd = A[0]
fo... | Traceback (most recent call last):
File "/tmp/tmpil0cvc84/tmpaxrmrkuf.py", line 37, in <module>
main()
File "/tmp/tmpil0cvc84/tmpaxrmrkuf.py", line 6, in main
N = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s405517050 | p02574 | u107639613 | 1598820408 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2207 | 189188 | 614 | import sys
from math import gcd
def input(): return sys.stdin.readline().strip()
def main():
N = int(input())
A =list(map(int, input().split()))
A.sort()
idx = 0
while A[idx] == 1: idx += 1
A = A[idx:]
all_gcd = A[0]
for a in A:
all_gcd = gcd(all_gcd, a)
if all_gcd != 1:
... | Traceback (most recent call last):
File "/tmp/tmp5gwfixvn/tmpc9l072rl.py", line 34, in <module>
main()
File "/tmp/tmp5gwfixvn/tmpc9l072rl.py", line 6, in main
N = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s129768328 | p02574 | u216928054 | 1598820266 | Python | Python (3.8.2) | py | Runtime Error | 237 | 111056 | 2345 | #!/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 precompute():
maxAS = 1000000
eratree = [0] * (maxAS + 10)
for p in range(2, maxAS + 1):
if eratree[p]:
c... | Traceback (most recent call last):
File "/tmp/tmpie99g8fb/tmpvo_1ca54.py", line 134, in <module>
main()
File "/tmp/tmpie99g8fb/tmpvo_1ca54.py", line 58, in main
N = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: b''
| |
s367303398 | p02574 | u645487439 | 1598819505 | Python | Python (3.8.2) | py | Runtime Error | 1962 | 127844 | 904 | import math
from functools import reduce
n = int(input())
a_list = list(map(int, input().split()))
prime_list = list(range(math.ceil(a_list[n - 1] ** 0.5)))
for i in range(2, prime_list[-1] + 1):
if prime_list[i] != -1:
index = i
while index + i <= prime_list[-1]:
index += i
... | Traceback (most recent call last):
File "/tmp/tmps_3x9x3a/tmprlj5doxn.py", line 4, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s833924310 | p02574 | u887142477 | 1598818756 | Python | Python (3.8.2) | py | Runtime Error | 793 | 133208 | 1459 | N = int(input())
A = [int(x) for x in input().split()]
# M以下の整数の素因数分解を高速に
# 前処理O(MloglogM)
# 一計算O(logK)
def mae_syori(M):
D = [0] * (M + 1)
for i in range(2, M+1):
if D[i] != 0: continue
# print(i, list(range(i*2, M + 1, i)))
for j in range(i*2, M+1, i):
if D[j] == 0:
... | Traceback (most recent call last):
File "/tmp/tmpam44of54/tmplpcu48pl.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s730168543 | p02574 | u698901270 | 1598818432 | Python | Python (3.8.2) | py | Runtime Error | 461 | 127292 | 516 | def gcd(a,b):
# Everything divides 0
if (a == 0):
return b
if (b == 0):
return a
# base case
if (a == b):
return a
# a is greater
if (a > b):
return gcd(a-b, b)
return gcd(a, b-a)
n = int(input())
a = list(map(int, input().split... | Traceback (most recent call last):
File "/tmp/tmpd9e6rsh1/tmp40dah0xb.py", line 18, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s647853653 | p02574 | u586759271 | 1598816303 | Python | PyPy3 (7.3.0) | py | Runtime Error | 375 | 220676 | 916 | N=int(input())
A=list(map(int,input().split()) )
import math
se = A[0]
for i in range(1,N):
se = math.gcd(se,A[i])
set_wise = se==1
NMAX = 10**6+2
divisors = [i for i in range(NMAX+1)]
p=2
while p*p <=NMAX:
if divisors[p]==p:
for r in range(2*p,NMAX+1,p):
if divisors[r]==r:
... | Traceback (most recent call last):
File "/tmp/tmpi3jr8o70/tmpuh0cff44.py", line 1, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s377434697 | p02574 | u216015528 | 1598816117 | Python | Python (3.8.2) | py | Runtime Error | 1597 | 135104 | 686 | #!/usr/bin/env python3
def main():
from math import gcd
N = int(input())
A = []
INF = 10 ** 6
frequency = [0] * INF
for a in [int(x) for x in input().split()]:
A.append(a)
frequency[a] += 1
pairwise = True
for i in range(2, INF):
cnt = 0
for j in ran... | Traceback (most recent call last):
File "/tmp/tmp0cqeulhp/tmp9h72j945.py", line 35, in <module>
main()
File "/tmp/tmp0cqeulhp/tmp9h72j945.py", line 5, in main
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s388696894 | p02574 | u311379832 | 1598812593 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 97816 | 1014 | import numpy as np
from collections import defaultdict
import sys
read = sys.stdin.buffer.read
INF = 10 ** 6 + 1
is_prime = [1] * INF
def eratorasu():
is_prime[0] = 0
is_prime[1] = 0
for i in range(2, INF):
if is_prime[i] == 0:
continue
for j in range(i * 2, INF, i):
... | Traceback (most recent call last):
File "/tmp/tmp1ktwp69k/tmpbmov3yub.py", line 38, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s037351442 | p02574 | u358254559 | 1598810020 | Python | PyPy3 (7.3.0) | py | Runtime Error | 93 | 74680 | 745 | n = int(input())
a = list(map(int, input().split()))
M = max(a)
biggest_prime = [0] * (M+10)
for i in range(2, M+10):
if biggest_prime[i] == 0:
biggest_prime[i] = i
for j in range(i*i, M+1, i):
... | File "/tmp/tmpptmebrrm/tmptza6a3gv.py", line 3
M = max(a)
IndentationError: unexpected indent
| |
s320593232 | p02574 | u967442619 | 1598808023 | Python | PyPy3 (7.3.0) | py | Runtime Error | 430 | 230272 | 1185 | import math
def sieve_of_erastosthenes(num):
print(num)
input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num+1)]
input_list[0] = input_list[1] = False
input_list[2] = input_list[3] = input_list[5] = True
sqrt = math.sqrt(num)
for serial in range(3, num, 2)... | Traceback (most recent call last):
File "/tmp/tmp3ebbeq33/tmp78dfjxyy.py", line 18, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s826229800 | p02574 | u874644572 | 1598805280 | Python | PyPy3 (7.3.0) | py | Runtime Error | 371 | 197032 | 1208 | from math import gcd
from functools import reduce
from sys import exit
# O(A+N)解
MAX_A = 1000000
lowerst_prime = [0] * (MAX_A + 1) # 最小の素因数をいれる(2以上をみていけばいい)
primes = [] # MAX_A以下の素数の集合
count = [0] * (MAX_A + 1) # 約数として出てくる回数を数える
for i in range(2, MAX_A + 1): # 線形時間で処理してくれる
if lowerst_prime[i] == 0:
continu... | Traceback (most recent call last):
File "/tmp/tmpvphwqbqm/tmpz_wk2y__.py", line 19, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s182473985 | p02574 | u388164885 | 1598804652 | Python | Python (3.8.2) | py | Runtime Error | 647 | 135420 | 380 | from math import gcd
from functools import reduce
M = 10 ** 6
ret = [0] * M
n = int(input())
nums = list(map(int, input().split()))
flag = 1
for i in nums:
ret[i] += 1
for i in range(2, M):
if sum(ret[i::i]) > 1:
flag = 0
break
if flag:
print("pairwise coprime")
elif reduce(gcd, nums) == 1:... | Traceback (most recent call last):
File "/tmp/tmpn494k4lt/tmp7um_yq__.py", line 6, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s707757457 | p02574 | u511824539 | 1598803423 | Python | PyPy3 (7.3.0) | py | Runtime Error | 663 | 197288 | 821 | N = int(input())
A = list(map(int, input().split()))
A_MAX = max(A)
def eratosthenes(n):
is_prime = [True] * (n+1)
is_prime[0] = False
is_prime[1] = False
for i in range(2, int(n**0.5) + 1):
if not is_prime[i]:
continue
for j in range(i*2, n+1, i):
is_prime[j] = ... | Traceback (most recent call last):
File "/tmp/tmp9jx2_yy4/tmpzhde2wux.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s507191875 | p02574 | u517348254 | 1598802262 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9016 | 2538 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
/* clang-format off */
#define MOD 1000000007
#define INF 1000000000
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(a) (a).begin(), (a).end()
#define __DEBUG__
#ifdef __DEBUG__
#define CH_P(a) cout <<"check_point("<<#a<<"... | File "/tmp/tmp_vokzzde/tmpgfd4pjq5.py", line 2
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s253601668 | p02574 | u420105436 | 1598800181 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8928 | 2777 | #include <algorithm>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <vector>
#include <array>
#include <stack>
#include <list>
#include <queue>
#include <deque>
#include <climits>
#include <utility>
#include <map>
#include <unordered_map>
#includ... | File "/tmp/tmpr9r4_qi2/tmppp8z9qg7.py", line 26
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s023238341 | p02574 | u420105436 | 1598800137 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9000 | 2833 | #include <algorithm>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <vector>
#include <array>
#include <stack>
#include <list>
#include <queue>
#include <deque>
#include <climits>
#include <utility>
#include <map>
#include <unordered_map>
#includ... | File "/tmp/tmpowf9ac1h/tmp09m1lq8u.py", line 26
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s577829882 | p02574 | u380524497 | 1598800027 | Python | PyPy3 (7.3.0) | py | Runtime Error | 727 | 179532 | 1482 | from collections import defaultdict
import sys
input = sys.stdin.readline
class Osak:
def __init__(self, max_number=10 ** 6):
self.max_number = max_number
self.table = list(range(max_number + 1))
self.calc_minimum_prime()
def calc_minimum_prime(self):
self.table[1] = 0
... | Traceback (most recent call last):
File "/tmp/tmpecteq59b/tmpu2eg7h6a.py", line 62, in <module>
main()
File "/tmp/tmpecteq59b/tmpu2eg7h6a.py", line 41, in main
n = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s569807091 | p02574 | u654470292 | 1598798678 | Python | PyPy3 (7.3.0) | py | Runtime Error | 745 | 250540 | 913 | import bisect, copy, heapq, math, sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
return sys.stdin.readline()[:-1]
def ruiseki(lst):
return [0]+list(accumulate(lst))
def celi(a,b):
return -(-a//b)
sys.setrecursi... | Traceback (most recent call last):
File "/tmp/tmpa90uboef/tmpyiiv4cn6.py", line 16, in <module>
n=int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s219579093 | p02574 | u970109776 | 1598796262 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 127620 | 867 | #coding: utf-8
from collections import defaultdict
from functools import reduce
from math import gcd
import sys
N = int(input())
maxA = 0
A = []
for a in (int(x) for x in input().split()):
if a > maxA:
maxA = a
A.append(a)
D = [0] * (maxA + 1)
i = 2
primes = [2]
for i in range(2, maxA+1):
for p i... | Traceback (most recent call last):
File "/tmp/tmp4dnl7tls/tmpul6tnvok.py", line 8, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s427613808 | p02574 | u997641430 | 1598795531 | Python | Python (3.8.2) | py | Runtime Error | 740 | 127208 | 275 | n = int(input())
*A, = map(int, input().split())
m = max(A)
C = [0 for a in range(m + 1)]
for a in A:
C[a] += 1
s = max(sum(C[a::a]) for a in range(2, m + 1))
if s < 2:
print('pairwise coprime')
elif s < n:
print('setwise coprime')
else:
print('not coprime')
| Traceback (most recent call last):
File "/tmp/tmpyilkrfki/tmplnmmcen0.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s136342203 | p02574 | u423624748 | 1598794129 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9012 | 1295 | #include<bits/stdc++.h>
template<uint32_t N = 10'000'000>
struct Sieve_of_Eratosthenes{
using u32 = uint32_t;
std::vector<u32> factor;
Sieve_of_Eratosthenes(){
factor.resize(N+1);
for(u32 p=2;p<=N;++p){
if(factor[p])continue;
factor[p] = p;
for(u32 x=p+p;x<=N;x+=p){
if(factor[x]... | File "/tmp/tmpjdemg5ib/tmpjst3qa8n.py", line 3
template<uint32_t N = 10'000'000>
^
SyntaxError: invalid syntax
| |
s937377264 | p02574 | u922487073 | 1598793790 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2212 | 200448 | 850 | def main():
N = int(input())
A_list = list(map(int, input().split()))
maxa = max(A_list)
lim = maxa
primes_table = [True] * lim
primes_table[0] = primes_table[1] = False
primes = set()
for i in range(2,lim):
if primes_table[i] == False:
continue
primes.add(i... | Traceback (most recent call last):
File "/tmp/tmpib5drycg/tmpohv9v1cd.py", line 36, in <module>
main()
File "/tmp/tmpib5drycg/tmpohv9v1cd.py", line 2, in main
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s055003363 | p02574 | u844789719 | 1598793345 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 127764 | 1892 | import collections
N = int(input())
A = [int(_) for _ in input().split()]
class Prime:
@staticmethod
def trial_division(x):
if x % 2 == 0:
return True
for p in range(3, int(x**0.5 + 1), 2):
if x % p == 0:
return False
return True
@staticmeth... | Traceback (most recent call last):
File "/tmp/tmpa_v62ryd/tmpgig8yez8.py", line 2, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s501532395 | p02574 | u408262366 | 1598792177 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2213 | 270408 | 957 | import math
n = int(input())
a = list(map(int, input().split()))
soinsuu = []
def get_sieve_of_eratosthenes(n):
if not isinstance(n, int):
raise TypeError('n is int type.')
if n < 2:
raise ValueError('n is more than 2')
prime = [2]
limit = int(n**0.5)
data = [i + 1 for i in range(... | Traceback (most recent call last):
File "/tmp/tmp6n4dxbg2/tmpzocesqys.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s166241902 | p02574 | u970109776 | 1598791512 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 128520 | 854 | #coding: utf-8
from collections import defaultdict
from functools import reduce
from math import gcd
import sys
N = int(input())
maxA = 0
A = []
for a in (int(x) for x in input().split()):
if a > maxA:
maxA = a
A.append(a)
D = [0] * (maxA + 1)
i = 2
primes = [2]
for i in range(2, maxA+1):
for p i... | Traceback (most recent call last):
File "/tmp/tmp1ssmw88x/tmpubqs_15a.py", line 8, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s440805659 | p02574 | u970109776 | 1598791449 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 128684 | 854 | #coding: utf-8
from collections import defaultdict
from functools import reduce
from math import gcd
import sys
N = int(input())
maxA = 0
A = []
for a in (int(x) for x in input().split()):
if a > maxA:
maxA = a
A.append(a)
D = [0] * (maxA + 1)
i = 2
primes = [2]
for i in range(2, maxA+1):
for p i... | Traceback (most recent call last):
File "/tmp/tmpb8tof2bl/tmp7qc8md1n.py", line 8, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s143018702 | p02574 | u941753895 | 1598791384 | Python | PyPy3 (7.3.0) | py | Runtime Error | 273 | 189104 | 972 | import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy
sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
# def LF(): return [float(x) for x in s... | Traceback (most recent call last):
File "/tmp/tmp43r82lbb/tmpmqrvacw9.py", line 51, in <module>
print(main())
^^^^^^
File "/tmp/tmp43r82lbb/tmpmqrvacw9.py", line 17, in main
N=I()
^^^
File "/tmp/tmp43r82lbb/tmpmqrvacw9.py", line 11, in I
def I(): return int(sys.stdin.readline())
... | |
s188906106 | p02574 | u546338822 | 1598790159 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 134484 | 715 | def main():
import math
n = int(input())
a = sorted(list(map(int,input().split())))
d = [-1 for i in range(a[-1])]
d[0] = 1
for i in range(2,a[-1]):
for j in range(1,a[-1]//i+1):
if d[i*j-1] == -1:
d[i*j-1] = i
Dic = [0 for i in range(a[-1])]
flg = 0
... | Traceback (most recent call last):
File "/tmp/tmp5ctl7xm2/tmp2zcdqb9e.py", line 31, in <module>
main()
File "/tmp/tmp5ctl7xm2/tmp2zcdqb9e.py", line 3, in main
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s321145665 | p02574 | u257162238 | 1598790038 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 127952 | 934 | import sys
input = sys.stdin.readline
from math import gcd
from functools import reduce
from collections import Counter
def read():
N = int(input().strip())
A = list(map(int, input().strip().split()))
return N, A
def prime_factorization(n):
"""
nの素因数分解を求める
"""
c = Counter()
i = 2
... | Traceback (most recent call last):
File "/tmp/tmpf066w3xl/tmprzswbd59.py", line 44, in <module>
inputs = read()
^^^^^^
File "/tmp/tmpf066w3xl/tmprzswbd59.py", line 9, in read
N = int(input().strip())
^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s058943582 | p02574 | u985929170 | 1598789096 | Python | PyPy3 (7.3.0) | py | Runtime Error | 357 | 199352 | 433 | N = int(input())
li = list(map(int,input().split()))
L = [0] * 10**6
import math
from functools import reduce
if reduce(math.gcd,li)!=1:
print('not coprime')
exit()
if 1 in li:
print('setwise coprime')
exit()
for i in li:
L[i] = 1
for k in range(2,10**6//2+1):
t = 0
for j in range(0,10... | Traceback (most recent call last):
File "/tmp/tmpd8sz22va/tmp5_6bx_1o.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s066247380 | p02574 | u985929170 | 1598788829 | Python | PyPy3 (7.3.0) | py | Runtime Error | 344 | 189440 | 390 | N = int(input())
li = list(map(int,input().split()))
L = [0] * 10**6
import math
from functools import reduce
if reduce(math.gcd,li)!=1:
print('not coprime')
exit()
for i in li:
L[i] = 1
#print(L)
for k in range(2,10**6//2+1):
t = 0
for j in range(0,10**6,k):
t += L[j]
if t > 1:
... | Traceback (most recent call last):
File "/tmp/tmpwxrgb2mt/tmpa2dsx9v4.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s439596477 | p02574 | u392319141 | 1598787108 | Python | PyPy3 (7.3.0) | py | Runtime Error | 88 | 74732 | 1352 | import sys
sys.setrecursionlimit(10**7)
from collections import Counter
class Prime:
def __init__(self, N):
smallestPrime = [1] * (N + 1)
primes = []
for i in range(2, N + 1):
if smallestPrime[i] != 1:
continue
primes.append(i)
for p in ... | Traceback (most recent call last):
File "/tmp/tmpogqzy3ke/tmpt9a43bsq.py", line 34, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s761126067 | p02574 | u392319141 | 1598787033 | Python | PyPy3 (7.3.0) | py | Runtime Error | 93 | 74724 | 1311 | from collections import Counter
class Prime:
def __init__(self, N):
smallestPrime = [1] * (N + 1)
primes = []
for i in range(2, N + 1):
if smallestPrime[i] != 1:
continue
primes.append(i)
for p in range(i * 2, N + 1, i):
i... | Traceback (most recent call last):
File "/tmp/tmpoil7ml6m/tmpmmjwoltj.py", line 31, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s922143532 | p02574 | u392319141 | 1598786978 | Python | PyPy3 (7.3.0) | py | Runtime Error | 95 | 74744 | 1274 | from collections import Counter
from math import gcd
class Prime:
def __init__(self, N):
smallestPrime = [1] * (N + 1)
primes = []
for i in range(2, N + 1):
if smallestPrime[i] != 1:
continue
primes.append(i)
for p in range(i * 2, N + 1, ... | Traceback (most recent call last):
File "/tmp/tmpyspiapm3/tmpq807hwl2.py", line 32, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s950771169 | p02574 | u988402778 | 1598786585 | Python | PyPy3 (7.3.0) | py | Runtime Error | 419 | 199540 | 26684 | def main(sample_file = ''):
""" convenient functions
# for i, a in enumerate(iterable)
# q, mod = divmod(a, b)
# divmod(x, y) returns the tuple (x//y, x%y)
# Higher-order function: reduce(operator.mul, xyz_count, 1)
# manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc... | Traceback (most recent call last):
File "/tmp/tmple2wou2g/tmpqbfpwdzx.py", line 759, in <module>
main()
File "/tmp/tmple2wou2g/tmpqbfpwdzx.py", line 561, in main
N = r_int()
^^^^^^^
File "/tmp/tmple2wou2g/tmpqbfpwdzx.py", line 508, in <lambda>
r_int = lambda: int(r())
^^^^^... | |
s167061067 | p02574 | u941047297 | 1598786081 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2127 | 184116 | 819 | from collections import defaultdict
def enumerate_primes(n):
if n == 1: return []
primes = [2] + list(range(3, n + 1, 2))
i, p = 0, 1
while p * p <= n:
if primes[i] != 0:
p = primes[i]
primes = [prime if (prime % p != 0 or prime == p) else 0 for prime in primes]
i... | Traceback (most recent call last):
File "/tmp/tmp52pl0d4z/tmpq0sb9j03.py", line 31, in <module>
main()
File "/tmp/tmp52pl0d4z/tmpq0sb9j03.py", line 14, in main
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s524472391 | p02574 | u981931040 | 1598785696 | Python | PyPy3 (7.3.0) | py | Runtime Error | 255 | 182404 | 1280 | def gcd(a, b):
while b: a, b = b, a % b
return a
def prime_factorize(n):
'''
素因数分解のリストを返す。n == 1のとき[]になるので注意。
:param n:int
素因数分解する自然数
:return: list
素因数分解した結果。
例
n : 10
primes : [[2, 1], [5, 1]]
'''
primes = []
for i in range(2, int(n ** (1 / 2)) + 1):
if ... | Traceback (most recent call last):
File "/tmp/tmpd0828aqy/tmp0j7f5qj5.py", line 29, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s401493086 | p02574 | u021019433 | 1598785432 | Python | PyPy3 (7.3.0) | py | Runtime Error | 90 | 74828 | 341 | d = None
u = set()
r = 'pairwise'
for x in map(int, input().split()):
d = math.gcd(d or x, x)
s = set()
i = 2
while i * i <= x:
while x % i == 0:
if i in u:
r = 'setwise'
s.add(i)
x //= i
i += 1
if x > 1:
if x in u:
r = 'setwise'
s.add(x)
u |= s
print((r, 'not... | Traceback (most recent call last):
File "/tmp/tmpgrpjoi3k/tmp_9n37ttm.py", line 4, in <module>
for x in map(int, input().split()):
^^^^^^^
EOFError: EOF when reading a line
| |
s612425560 | p02574 | u021019433 | 1598785358 | Python | PyPy3 (7.3.0) | py | Runtime Error | 196 | 164680 | 365 | import math
input()
d = None
u = set()
r = 'pairwise'
for x in map(int, input().split()):
d = math.gcd(d or x, x)
s = set()
i = 2
while i * i <= n:
while n % i == 0:
if i in u:
r = 'setwise'
s.add(i)
n //= i
i += 1
if n > 1:
if n in u:
r = 'setwise'
s.add(n)
... | Traceback (most recent call last):
File "/tmp/tmpgex79td5/tmpwt8a_h1f.py", line 3, in <module>
input()
EOFError: EOF when reading a line
| |
s747320107 | p02574 | u970109776 | 1598784479 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 127588 | 671 | #coding: utf-8
from collections import defaultdict
from functools import reduce
from math import gcd
N = int(input())
A = [int(x) for x in input().split()]
def primeFac(N):
ret = set()
i = 2
while i*i <= N:
if N % i == 0:
ret.add(i)
while N % i == 0:
N //= ... | Traceback (most recent call last):
File "/tmp/tmpb5d_768c/tmpe6ed5jsj.py", line 7, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s402056818 | p02574 | u580433316 | 1598784418 | Python | PyPy3 (7.3.0) | py | Runtime Error | 101 | 74844 | 527 | # coding: utf-8
# Your code here!
import sympy
n = int(input())
ab = list(map(int, input().split()))
fd = set([1])
flag = 'pairwise coprime'
mimm = set(sympy.divisors(min(ab)))
for a in ab:
if fd & set(sympy.divisors(a)) != {1}:
flag = 'setwise coprime'
fd = fd | set(sympy.divisors(a))
if flag == ... | Traceback (most recent call last):
File "/tmp/tmp1kwsy995/tmpz_3qkxp1.py", line 5, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s262903152 | p02574 | u311379832 | 1598783976 | Python | PyPy3 (7.3.0) | py | Runtime Error | 306 | 194968 | 922 | from collections import defaultdict
import math
INF = 10 ** 5
is_prime = [1] * INF
def eratorasu():
is_prime[0] = 0
is_prime[1] = 0
for i in range(2, INF):
if is_prime[i] == 0:
continue
for j in range(i * 2, INF, i):
is_prime[j] = 0
return
def f(n):
yakusu ... | Traceback (most recent call last):
File "/tmp/tmpj7vj9p9u/tmpq1glrve4.py", line 33, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s877148546 | p02574 | u311379832 | 1598783911 | Python | PyPy3 (7.3.0) | py | Runtime Error | 275 | 191964 | 917 | from collections import defaultdict
import math
INF = 10 ** 5
is_prime = [1] * INF
def eratorasu():
is_prime[0] = 0
is_prime[1] = 0
for i in range(2, INF):
if is_prime[i] == 0:
continue
for j in range(i * 2, INF, i):
is_prime[j] = 0
return
def f(n):
yakusu ... | Traceback (most recent call last):
File "/tmp/tmpzksrw4op/tmpldjd19r_.py", line 33, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s104492220 | p02574 | u908763441 | 1598783663 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2237 | 1392256 | 924 | import bisect
import math
n = int(input())
As = list(map(int, input().split()))
As.sort()
cons = 10 ** 6
is_prime = [True] * (cons + 1)
Ds = [i for i in range(cons + 1)]
is_prime[0] = False
is_prime[1] = False
for i in range(2, int(cons**0.5) + 1):
if not is_prime[i]:
continue
for j in range(i * 2, co... | Traceback (most recent call last):
File "/tmp/tmprrfe9h46/tmpv4m8fw6e.py", line 4, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s581316259 | p02574 | u383713431 | 1598783558 | Python | PyPy3 (7.3.0) | py | Runtime Error | 428 | 209032 | 2354 | class Sieve:
"""
N以下の素数を列挙するエラトステネスのふるいです。
O(NloglogN)でできます。
Attributes
sieveList : その数の素因数のうち最小のものの配列
primes : N以下の素因数のリスト
"""
def __init__(self, N):
self.sieveList = [-1 for _ in range(N+1)]
self.sieveList[1] = 1
self.primes = []
for i in range(2, N+1)... | Traceback (most recent call last):
File "/tmp/tmpnort31yj/tmpoo8k3ctp.py", line 60, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s434062038 | p02574 | u021019433 | 1598783358 | Python | PyPy3 (7.3.0) | py | Runtime Error | 219 | 179368 | 812 | import math
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()
d = None
p = 1
for x in map(int, input().split()):
d = math.gcd(d or x, x)
s = set()
while x > 1:
p = spf[x]
i... | Traceback (most recent call last):
File "/tmp/tmpauij9gyt/tmpdpvq3s0x.py", line 16, in <module>
input()
EOFError: EOF when reading a line
| |
s525083648 | p02574 | u021019433 | 1598783306 | Python | PyPy3 (7.3.0) | py | Runtime Error | 222 | 179416 | 428 | import math
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()
d = None
p = 1
for x in map(int, input().split()):
d = math.gcd(d or x, x)
e = maths = set()
while x > 1:
p = spf[... | Traceback (most recent call last):
File "/tmp/tmpn3fhxu3n/tmpannnjh_s.py", line 16, in <module>
input()
EOFError: EOF when reading a line
| |
s179998740 | p02574 | u892797057 | 1598782762 | Python | Python (3.8.2) | py | Runtime Error | 285 | 135672 | 963 | import math
def get_input():
N = int(input())
A = [int(x) for x in input().split()]
return N, A
def sieve_of_eratosthenes(x: int):
ret = [-1] * (x + 1)
for i in range(1, x + 1):
ret[i] = i
p_max = int(math.sqrt(x))
for p in range(2, p_max + 1):
if ret[p] < p: # p is not ... | Traceback (most recent call last):
File "/tmp/tmpkd2voqst/tmp1l50hguy.py", line 27, in <module>
N, A = get_input()
^^^^^^^^^^^
File "/tmp/tmpkd2voqst/tmp1l50hguy.py", line 5, in get_input
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s188714539 | p02574 | u892797057 | 1598782263 | Python | Python (3.8.2) | py | Runtime Error | 321 | 135796 | 1184 | import math
# def get_pseudo_input():
# N = 3
# A = [3, 4, 5]
# return N, A
def get_input():
N = int(input())
A = [int(x) for x in input().split()]
return N, A
def sieve_of_eratosthenes(x: int):
ret = [-1] * (x + 1)
for i in range(1, x + 1):
ret[i] = i
p_max = int(math.... | Traceback (most recent call last):
File "/tmp/tmpc7f8lwlc/tmpek16w4_8.py", line 33, in <module>
N, A = get_input()
^^^^^^^^^^^
File "/tmp/tmpc7f8lwlc/tmpek16w4_8.py", line 11, in get_input
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s309126061 | p02574 | u523087093 | 1598780592 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9044 | 443 | import math
L = 10**6 + 1
N = int(input())
A = list(map(int, input().split()))
memo = [0] * L
flag = 0 # 0をpairwise coprime
for a in A:
memo[a] = 1
for i in range(2, L):
if sum(memo[i::i]) > 1:
flag = 1:
break
g = 0
for i in range(N):
g = math.gcd(g, A[i])
if flag == 0:
answer = 'pa... | File "/tmp/tmpbxguebsz/tmpury81h3o.py", line 14
flag = 1:
^
SyntaxError: invalid syntax
| |
s744727012 | p02574 | u222668979 | 1598780112 | Python | PyPy3 (7.3.0) | py | Runtime Error | 85 | 74756 | 1117 | from math import gcd
class Eratosthenes(): # エラトステネスの篩
def __init__(self, N) # 素数リスト生成 O(n*log(log n))
is_prime = [0, 0] + [1] * (N - 1)
for i in range(int(N**0.5) + 1):
if is_prime[i] == 0:
continue
for j in range(i * 2, N + 1, i):
is_prime[... | File "/tmp/tmp6vf59hla/tmpbieck5fv.py", line 5
def __init__(self, N) # 素数リスト生成 O(n*log(log n))
^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: expected ':'
| |
s666971416 | p02574 | u222668979 | 1598780042 | Python | PyPy3 (7.3.0) | py | Runtime Error | 86 | 74732 | 1115 | from math import gcd
class Eratosthenes: # エラトステネスの篩
def __init__(self, N) # 素数リスト生成 O(n*log(log n))
is_prime = [0, 0] + [1] * (N - 1)
for i in range(int(N**0.5) + 1):
if is_prime[i] == 0:
continue
for j in range(i * 2, N + 1, i):
is_prime[j]... | File "/tmp/tmpqxvr983c/tmpv4a719h0.py", line 5
def __init__(self, N) # 素数リスト生成 O(n*log(log n))
^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: expected ':'
| |
s977855949 | p02574 | u222668979 | 1598779615 | Python | PyPy3 (7.3.0) | py | Runtime Error | 88 | 74716 | 1127 | from math import gcd
class Eratosthenes: # エラトステネスの篩
def __init__(self, N) # 素数リスト生成 O(n*log(log n))
is_prime = [0, 0] + [1] * (N - 1)
for i in range(int(N**0.5) + 1):
if is_prime[i] == 0:
continue
for j in range(i * 2, N + 1, i):
is_prime[j]... | File "/tmp/tmpa1khjhdu/tmpu_hfk295.py", line 35
print(‘not coprime’)
^
SyntaxError: invalid character '‘' (U+2018)
| |
s984805741 | p02574 | u704284486 | 1598778276 | Python | Python (3.8.2) | py | Runtime Error | 2208 | 127508 | 1433 | # pairwise coprime <= setwise coprime の順に判定するのが効率が良い。
# 問題は pairwise をどのように効率よく計算するか。全探索は計算量の観点から厳しい。数字の設定的に O(N logN) 程度のアルゴリズムを想定していそう。
# エラトステネスで素数列挙 => 全て素因数分解し、各素因数の出現回数を数える。
# もし各一回ずつなら、pairwise、ある素因数でn回出現するものがあれば、どちらでもない
def sieve(N):
if N < 2:
return None
elif N == 2:
return [2]
dat... | Traceback (most recent call last):
File "/tmp/tmp9a1au36k/tmp063qzo6q.py", line 28, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s557101042 | p02574 | u498487134 | 1598778070 | Python | PyPy3 (7.3.0) | py | Runtime Error | 281 | 182064 | 1864 | import sys
input = sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def main():
from math import gcd
# 篩の応用でnまでの数全部を素因数分解する
# nまでの素数を列挙(n loglogn)
n = 10**4 + 5
D=[1]*(n+1) # 篩をしたときに初めて割った数
... | Traceback (most recent call last):
File "/tmp/tmpr4qucv96/tmpfr6cpl4o.py", line 80, in <module>
main()
File "/tmp/tmpr4qucv96/tmpfr6cpl4o.py", line 49, in main
N=I()
^^^
File "/tmp/tmpr4qucv96/tmpfr6cpl4o.py", line 4, in I
def I(): return int(input())
^^^^^^^^^^^^
ValueError:... | |
s767252386 | p02574 | u227020436 | 1598777840 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 127960 | 662 | # E - Coprime
import math
from functools import reduce
from itertools import chain
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
assert len(a) == n
if reduce(math.gcd, a) > 1:
print("not coprime")
exit()
def factors(n):
"""Return the list of prime factors of n."""
... | Traceback (most recent call last):
File "/tmp/tmp78apmhx9/tmpjtjxgavx.py", line 8, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s093408918 | p02574 | u364693468 | 1598777499 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2211 | 224256 | 1511 | import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): r... | Traceback (most recent call last):
File "/tmp/tmpoldu5s4q/tmp36qv23na.py", line 58, in <module>
main()
File "/tmp/tmpoldu5s4q/tmp36qv23na.py", line 29, in main
N = I()
^^^
File "/tmp/tmpoldu5s4q/tmp36qv23na.py", line 3, in I
def I(): return int(sys.stdin.readline().rstrip())
... | |
s919163375 | p02574 | u014800961 | 1598777307 | Python | Python (3.8.2) | py | Runtime Error | 1399 | 215016 | 1438 | import math
from numba import njit, i8
import numpy as np
n = int(input())
alist = list(map(int,input().split()))
alist = np.array(alist)
a_max = max(alist)
D = [i for i in range(a_max+1)]
D = np.array(D)
D[0] = 1
D[1] = 1
@njit(i8[:](i8,i8[:]),cache=True)
def factor(n,D):
f = set()
f.add(n)
while n > 1... | Traceback (most recent call last):
File "/tmp/tmpq99azpow/tmpv15vvzfd.py", line 5, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s094170640 | p02574 | u364693468 | 1598777116 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2211 | 224084 | 1458 | import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): r... | Traceback (most recent call last):
File "/tmp/tmp1jlqgm72/tmpf5_v9itc.py", line 56, in <module>
main()
File "/tmp/tmp1jlqgm72/tmpf5_v9itc.py", line 29, in main
N = I()
^^^
File "/tmp/tmp1jlqgm72/tmpf5_v9itc.py", line 3, in I
def I(): return int(sys.stdin.readline().rstrip())
... | |
s172160982 | p02574 | u179169725 | 1598777040 | Python | PyPy3 (7.3.0) | py | Runtime Error | 346 | 194596 | 2280 | import sys
sys.setrecursionlimit(1 << 25)
readline = sys.stdin.buffer.readline
read = sys.stdin.readline # 文字列読み込む時はこっち
ra = range
enu = enumerate
def exit(*argv, **kwarg):
print(*argv, **kwarg)
sys.exit()
def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))
# 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開... | Traceback (most recent call last):
File "/tmp/tmputggddhj/tmpvl8n47_g.py", line 66, in <module>
N = a_int()
^^^^^^^
File "/tmp/tmputggddhj/tmpvl8n47_g.py", line 18, in a_int
def a_int(): return int(readline())
^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10... | |
s661150035 | p02574 | u179169725 | 1598776756 | Python | PyPy3 (7.3.0) | py | Runtime Error | 298 | 187920 | 2288 | import sys
sys.setrecursionlimit(1 << 25)
readline = sys.stdin.buffer.readline
read = sys.stdin.readline # 文字列読み込む時はこっち
ra = range
enu = enumerate
def exit(*argv, **kwarg):
print(*argv, **kwarg)
sys.exit()
def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))
# 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開... | Traceback (most recent call last):
File "/tmp/tmp3befi5cy/tmpel8sf_k9.py", line 66, in <module>
N = a_int()
^^^^^^^
File "/tmp/tmp3befi5cy/tmpel8sf_k9.py", line 18, in a_int
def a_int(): return int(readline())
^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10... | |
s490733393 | p02574 | u179169725 | 1598776433 | Python | PyPy3 (7.3.0) | py | Runtime Error | 316 | 193644 | 2255 | import sys
sys.setrecursionlimit(1 << 25)
readline = sys.stdin.buffer.readline
read = sys.stdin.readline # 文字列読み込む時はこっち
ra = range
enu = enumerate
def exit(*argv, **kwarg):
print(*argv, **kwarg)
sys.exit()
def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))
# 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開... | Traceback (most recent call last):
File "/tmp/tmp070cctj5/tmpw9d2xnz4.py", line 65, in <module>
N = a_int()
^^^^^^^
File "/tmp/tmp070cctj5/tmpw9d2xnz4.py", line 18, in a_int
def a_int(): return int(readline())
^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10... | |
s684654651 | p02574 | u844789719 | 1598776341 | Python | PyPy3 (7.3.0) | py | Runtime Error | 1640 | 184264 | 583 | import collections
N = int(input())
A = [int(_) for _ in input().split()]
def prime_factorize(n):
a = set()
while n % 2 == 0:
a.add(2)
n //= 2
f = 3
while f * f <= n:
if n % f == 0:
a.add(f)
n //= f
else:
f += 2
if n != 1:
... | Traceback (most recent call last):
File "/tmp/tmpa4hrejza/tmp8o43ckfd.py", line 2, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s458694662 | p02574 | u844789719 | 1598776093 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2209 | 179404 | 4661 | import collections
N = int(input())
A = [int(_) for _ in input().split()]
class Prime:
# https://qiita.com/daikw/items/f48d6ac374255763463d
seed_primes = [
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67,
71, 73, 79, 83, 89, 97
]
def is_prime(self, n):
"... | Traceback (most recent call last):
File "/tmp/tmpr975yu17/tmpygksi3nn.py", line 2, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s423722699 | p02574 | u380524497 | 1598775616 | Python | Python (3.8.2) | py | Runtime Error | 772 | 150436 | 685 | import numpy as np
def get_primes(a=10 ** 6):
table = np.ones(a + 1)
table[:2] = False
for i in range(2, a):
table[i + i::i] = False
primes = np.where(table == True)[0]
return primes
def main():
n = int(input())
A = np.array(input().split(), dtype=np.int64)
primes = get_prime... | Traceback (most recent call last):
File "/tmp/tmpizw8fpe0/tmpa0w4mj9e.py", line 33, in <module>
main()
File "/tmp/tmpizw8fpe0/tmpa0w4mj9e.py", line 14, in main
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s156909458 | p02574 | u380524497 | 1598775534 | Python | Python (3.8.2) | py | Runtime Error | 762 | 150712 | 681 | import numpy as np
def get_primes(a=10**6):
table = np.ones(a+1)
table[:2] = False
for i in range(2, a):
table[i+i::i] = False
primes = np.where(table==True)[0]
return primes
def main():
n = int(input())
A = np.array(input().split(), dtype=np.int64)
primes = get_primes(A.max(... | Traceback (most recent call last):
File "/tmp/tmpcago5_qb/tmpg17ognxc.py", line 33, in <module>
main()
File "/tmp/tmpcago5_qb/tmpg17ognxc.py", line 14, in main
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s970371004 | p02574 | u726285999 | 1598775452 | Python | Python (3.8.2) | py | Runtime Error | 770 | 133332 | 1200 | import sys
import math
N_MAX = 200000 + 5
INF = 10**9 + 7
sys.setrecursionlimit(N_MAX)
MOD = 10**9 + 7
def eatosthenes(N):
prime = []
D = [1] * (N + 1)
for i in range(2, N + 1):
if D[i] != 1:
continue
for j in range(N // i + 1):
if D[i * j] == 1:
... | Traceback (most recent call last):
File "/tmp/tmpn9cvkqfz/tmpedbviczc.py", line 62, in <module>
main()
File "/tmp/tmpn9cvkqfz/tmpedbviczc.py", line 24, in main
N = int(sys.stdin.readline().rstrip())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s629972711 | p02574 | u380524497 | 1598774959 | Python | Python (3.8.2) | py | Runtime Error | 750 | 145204 | 698 | import numpy as np
import sys
input = sys.stdin.readline
def get_primes(a=10**6):
table = np.ones(a+1)
table[:2] = False
for i in range(2, a):
table[i+i::i] = False
primes = np.where(table==True)[0]
return primes
def main():
n = int(input())
A = np.array(input().split(), dtype=np... | Traceback (most recent call last):
File "/tmp/tmp65sh4bg8/tmpkw18ng2r.py", line 35, in <module>
main()
File "/tmp/tmp65sh4bg8/tmpkw18ng2r.py", line 16, in main
n = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s327288674 | p02574 | u380524497 | 1598774918 | Python | Python (3.8.2) | py | Runtime Error | 760 | 145392 | 675 | import numpy as np
import sys
input = sys.stdin.readline
def get_primes(a=10**6):
table = np.ones(a+1)
table[:2] = False
for i in range(2, a):
table[i+i::i] = False
primes = np.where(table==True)[0]
return primes
def main():
n = int(input())
A = np.array(input().split(), dtype=np... | Traceback (most recent call last):
File "/tmp/tmpyyw5peae/tmpogvug33d.py", line 34, in <module>
main()
File "/tmp/tmpyyw5peae/tmpogvug33d.py", line 16, in main
n = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s126238598 | p02574 | u380524497 | 1598774806 | Python | Python (3.8.2) | py | Runtime Error | 761 | 145296 | 721 | import numpy as np
import sys
input = sys.stdin.readline
def get_primes(a=10**6):
table = np.ones(a+1)
table[:2] = False
for i in range(2, a):
table[i+i::i] = False
primes = np.where(table==True)[0]
return primes
def main():
n = int(input())
A = np.array(input().split(), dtype=np... | Traceback (most recent call last):
File "/tmp/tmpukyc9cic/tmpng_dblcw.py", line 35, in <module>
main()
File "/tmp/tmpukyc9cic/tmpng_dblcw.py", line 16, in main
n = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s644643288 | p02574 | u380524497 | 1598774303 | Python | Python (3.8.2) | py | Runtime Error | 760 | 145084 | 659 | import numpy as np
import sys
input = sys.stdin.readline
def get_primes(a=10**6):
table = np.ones(a+1)
table[:2] = False
for i in range(2, a):
table[i+i::i] = False
primes = np.where(table==True)[0]
return primes
def main():
n = int(input())
A = np.array(input().split(), dtype=np... | Traceback (most recent call last):
File "/tmp/tmpdhztgtsn/tmpyc16d4ve.py", line 32, in <module>
main()
File "/tmp/tmpdhztgtsn/tmpyc16d4ve.py", line 16, in main
n = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s757478407 | p02574 | u707124227 | 1598773425 | Python | PyPy3 (7.3.0) | py | Runtime Error | 735 | 206280 | 884 | n=int(input())
aa=list(map(int,input().split()))
a=[x for x in aa if x!=1]
n=len(a)
# 素因数分解
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])
if temp!=1:
arr.appen... | Traceback (most recent call last):
File "/tmp/tmpo2vv6yi_/tmpmg2fsup3.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s245521171 | p02574 | u814781830 | 1598773167 | Python | PyPy3 (7.3.0) | py | Runtime Error | 259 | 181896 | 579 | import math
NOTCOM = "not coprime"
SETWISE = "setwise coprime"
PAIRWISE = "pairwise coprime"
MAX_A = 100
def main():
N = int(input())
A = list(map(int, input().split()))
c = [0] * MAX_A
for a in A:
c[a] += 1
pairwse = True
for i in range(2, MAX_A):
cnt = 0
for j in range... | Traceback (most recent call last):
File "/tmp/tmpphi040i8/tmplf90ch0q.py", line 28, in <module>
print(main())
^^^^^^
File "/tmp/tmpphi040i8/tmplf90ch0q.py", line 8, in main
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s216286486 | p02574 | u707124227 | 1598773044 | Python | PyPy3 (7.3.0) | py | Runtime Error | 703 | 220532 | 871 | n=int(input())
aa=list(map(int,input().split()))
a=[x for x in aa if x!=1]
n=len(a)
# 素因数分解
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])
if temp!=1:
arr.appen... | Traceback (most recent call last):
File "/tmp/tmpqvoa21h9/tmp4tq6kzd_.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s163949614 | p02574 | u380524497 | 1598771621 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 127664 | 826 | from collections import defaultdict
import sys
input = sys.stdin.readline
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.appe... | Traceback (most recent call last):
File "/tmp/tmpk41tq0we/tmp61x50fr4.py", line 42, in <module>
main()
File "/tmp/tmpk41tq0we/tmp61x50fr4.py", line 24, in main
n = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s348780353 | p02574 | u046158516 | 1598767193 | Python | Python (3.8.2) | py | Runtime Error | 478 | 126904 | 554 | import sys,math
n=int(input())
a=list(map(int,input().split()))
numbers={}
flag=0
for i in range(n):
if a[i] in numbers:
numbers[a[i]]+=1
else:
numbers[a[i]]=1
while pointer in range(2,10**6+1):
count=0
pointer2=pointer
while pointer2<10**6+1:
if pointer2 in numbers:
count+=numbers[pointer2]... | Traceback (most recent call last):
File "/tmp/tmpgqea0bdn/tmpys5d58ro.py", line 2, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s082738310 | p02574 | u906501980 | 1598762276 | Python | Python (3.8.2) | py | Runtime Error | 1743 | 208748 | 627 | from collections import defaultdict
from numba import njit, b1, i4, i8, f8
@njit(cache = True)
def get_prime_factors(x):
return [2, 3]
@njit
def main():
df = {"2":0, "3":0}
for ai in a:
primes = get_prime_factors(ai)
for prime in primes:
df[prime] += 1
if df.value... | Traceback (most recent call last):
File "/tmp/tmpr930c_pv/tmptrrfv02c.py", line 28, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s945975226 | p02574 | u906501980 | 1598762195 | Python | Python (3.8.2) | py | Runtime Error | 816 | 208160 | 636 | from collections import defaultdict
from numba import njit, b1, i4, i8, f8
@njit(cache = True)
def get_prime_factors(x):
return [2, 3]
@njit
def main():
df = defaultdict(lambda : 0)
for ai in a:
primes = get_prime_factors(ai)
for prime in primes:
df[prime] += 1
if... | Traceback (most recent call last):
File "/tmp/tmprgfcm2q8/tmprucdoncf.py", line 28, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s543988412 | p02574 | u906501980 | 1598762133 | Python | Python (3.8.2) | py | Runtime Error | 812 | 206340 | 896 | from collections import defaultdict
from numba import njit, b1, i4, i8, f8
@njit(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)
x //= i
... | Traceback (most recent call last):
File "/tmp/tmpcp1g138e/tmp1a5robet.py", line 43, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.