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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s654411588 | p02574 | u983460293 | 1598733127 | Python | Python (3.8.2) | py | Runtime Error | 2208 | 127536 | 599 |
#input routine
n = int(input())
line = [int(x) for x in input().split()]
#euclidean algo
def gcd(a,b):
if (a == 0):
return b
else:
return (gcd(b%a, a))
#get product
prod = 1
for i in range(0, len(line)):
prod *= line[i]
#get lcm
lcm = 1
for i in range(0, len(line)):
g = gcd(lcm, line... | Traceback (most recent call last):
File "/tmp/tmpfm9mi931/tmpwdv0dow1.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s876494171 | p02574 | u729679908 | 1598733107 | Python | Python (3.8.2) | py | Runtime Error | 745 | 127416 | 490 | N = int(input())
A = list(map(int,input().split()))
A.sort()
n = A.count(1)
B = [x for x in A if x != 1]
x = yes
for i in range(0,N-n-1):
for j in range(i+1,N-n):
for k in range(2,B[i]+1):
if B[i]%k == 0 and B[j]%k == 0:
x = no
if x == yes:
print("pairwise coprime")
y = yes
for m in range(2,... | Traceback (most recent call last):
File "/tmp/tmpfr3rci8x/tmpbjyy5r39.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s363225768 | p02574 | u806988802 | 1598733106 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8980 | 504 | import math
n = input()
lis = [int(a) for a in input().split(" ")]
lis_len = len(lis)
p_flag = True
s_flag = True
sqrt_max = int(math.sqrt(max(lis)))
for i in range(2, sqrt_max+1):
mod_lis = [a % i for a in lis]
non_zero_mod_lis = filter(lambda x:x!=0, mod_lis)
if len(non_zero_mod_lis) <= lis_len-2:
p_flag = F... | File "/tmp/tmpq7wt43r7/tmp4dk8wz0o.py", line 14
p_flag = False
TabError: inconsistent use of tabs and spaces in indentation
| |
s099190201 | p02574 | u590107758 | 1598733062 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8836 | 8127 | import java.util.*;
import java.io.*;
import java.math.BigInteger;
import java.text.*;
public class Main {
static int mod = 1000_000_007;
static long lim = (long)1e9 + 6;
static long mod1 = 998244353;
static boolean fileIO = false;
static FastScanner f;
static int inf = 2000_000_000;
static ... | File "/tmp/tmp4npe2a8s/tmp1vgqnps6.py", line 193
static long gcd(long a,long b){if(b==0l)return a;else{return gcd(b,a%b);}}
^
SyntaxError: invalid decimal literal
| |
s476113839 | p02574 | u189806337 | 1598733061 | Python | Python (3.8.2) | py | Runtime Error | 2208 | 127784 | 683 | import math
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
def gcd(*numbers):
return reduce(math.gcd, numbers)
def gcd_list(numbers):
return reduce(math.gcd, numbers)
def gcd(a, b):
if (a == 0 or b == 0):
return False
if (a == b):
return a
if (a > b):
return gcd(a-b, b... | Traceback (most recent call last):
File "/tmp/tmpiwrfi3ue/tmplkwybs93.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s621018241 | p02574 | u560988566 | 1598733046 | Python | Python (3.8.2) | py | Runtime Error | 423 | 132816 | 1067 | import math
n = int(input())
als = list(map(int, input().split()))
ans = "not coprime"
a, b = als[1], als[0]
if a < b:
tmp = b
b = a
a = tmp
while a % b != 0:
a, b = b, a % b
for i in range(2, n):
a = als[i]
if a < b:
tmp = b
b = a
a = tmp
while a % b != 0:
... | Traceback (most recent call last):
File "/tmp/tmpj520ktap/tmpoya3851v.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s858234269 | p02574 | u997641430 | 1598733038 | Python | PyPy3 (7.3.0) | py | Runtime Error | 1222 | 289312 | 642 | n = int(input())
*A, = map(int, input().split())
m = max(A)
is_prime = [True] * (m + 1)
is_prime[0] = False
is_prime[1] = False
for i in range(2, m + 1):
for j in range(i * 2, m + 1, i):
is_prime[j] = False
primes = [i for i in range(m + 1) if is_prime[i]]
Amap = {a: 0 for a in range(1, m + 1)}
for a in A... | Traceback (most recent call last):
File "/tmp/tmp9uar1olu/tmptqu0wgti.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s146791469 | p02574 | u735891571 | 1598733007 | Python | PyPy3 (7.3.0) | py | Runtime Error | 436 | 207396 | 1068 | # -*- coding: utf-8 -*-
from bisect import bisect_right
import math
from functools import reduce
def gcd(*numbers):
return reduce(math.gcd, numbers)
def gcd_list(numbers):
return reduce(math.gcd, numbers)
def primes(n):
is_prime = [True] * (n + 1)
is_prime[0] = False
is_prime[1] = False
for ... | Traceback (most recent call last):
File "/tmp/tmpoch8_qpj/tmpcmke29hy.py", line 26, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s491576158 | p02574 | u560988566 | 1598732999 | Python | Python (3.8.2) | py | Runtime Error | 404 | 132800 | 1051 | import math
n = int(input())
als = list(map(int, input().split()))
ans = "not coprime"
a, b = als[1], als[0]
if a < b:
tmp = b
b = a
a = tmp
while a % b != 0:
a, b = b, a % b
for i in range(2, n):
a = als[i]
if a < b:
tmp = b
b = a
a = tmp
while a % b != 0:
... | Traceback (most recent call last):
File "/tmp/tmp0kthl9xe/tmpqfyt20c1.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s858173836 | p02574 | u089142196 | 1598732999 | Python | Python (3.8.2) | py | Runtime Error | 1371 | 132560 | 555 | #E
import math
from math import gcd
N=int(input())
A=list(map(int,input().split()))
pc = "pairwise coprime"
sc = "setwise coprime"
nc = "not coprime"
maxi=max(A)
sumi=set()
for i in range(2,maxi+1):
if i in sumi:
pass
else:
tmp=maxi//i
for j in range(2,tmp+1):
sumi.add(j*i... | Traceback (most recent call last):
File "/tmp/tmp9hqdu4ly/tmpqtrw_d8a.py", line 4, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s024968672 | p02574 | u560988566 | 1598732972 | Python | PyPy3 (7.3.0) | py | Runtime Error | 314 | 197132 | 1051 | import math
n = int(input())
als = list(map(int, input().split()))
ans = "not coprime"
a, b = als[1], als[0]
if a < b:
tmp = b
b = a
a = tmp
while a % b != 0:
a, b = b, a % b
for i in range(2, n):
a = als[i]
if a < b:
tmp = b
b = a
a = tmp
while a % b != 0:
... | Traceback (most recent call last):
File "/tmp/tmpt9onmq8s/tmp4mdstpjw.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s267257884 | p02574 | u660237354 | 1598732956 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8968 | 1942 | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define scan(a,n) for(long int index=0;index<n;index++) cin>>a[index];
#define print(a,n) for(long int index=0;index<n;index++) cout<<a[index]<<" ";cout<<endl;
#define mo... | File "/tmp/tmpu1oswcgh/tmpn8docaa4.py", line 2
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s156611715 | p02574 | u735891571 | 1598732952 | Python | PyPy3 (7.3.0) | py | Runtime Error | 398 | 197540 | 1069 | # -*- coding: utf-8 -*-
from bisect import bisect_right
import math
from functools import reduce
def gcd(*numbers):
return reduce(math.gcd, numbers)
def gcd_list(numbers):
return reduce(math.gcd, numbers)
def primes(n):
is_prime = [True] * (n + 1)
is_prime[0] = False
is_prime[1] = False
for ... | Traceback (most recent call last):
File "/tmp/tmpsl2c5wca/tmp5396s13p.py", line 26, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s946371841 | p02574 | u211544300 | 1598732952 | Python | Python (3.8.2) | py | Runtime Error | 254 | 127464 | 450 | import sys
import cmath
input = sys.stdin.readline
n = int(input())
p = list(map(int, input().split()))
GCD = p[0]
LCM = p[0]
mul = p[0]
done = False
for i in range(1, n):
GCD = cmath.gcd(GCD, p[i])
if not done:
LCM = cmath.lcm(LCM, p[i])
mul *= p[i]
if LCM != mul:
done = Tru... | Traceback (most recent call last):
File "/tmp/tmpuwre16qy/tmp_kpvln1t.py", line 7, in <module>
n = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s123114021 | p02574 | u001769145 | 1598732900 | Python | Python (3.8.2) | py | Runtime Error | 2208 | 133408 | 653 | import math
N = int(input())
A_L = [int(x) for x in input().split()]
A_L.sort()
def get_sieve_of_eratosthenes(n):
prime = []
limit = math.sqrt(n)
data = [i + 1 for i in range(1, n)]
while True:
p = data[0]
if limit <= p:
return prime + data
prime.append(p)
... | Traceback (most recent call last):
File "/tmp/tmp8ytb929u/tmpo0kxfzgk.py", line 3, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s347244406 | p02574 | u106797249 | 1598732869 | Python | PyPy3 (7.3.0) | py | Runtime Error | 975 | 196632 | 1378 | def prime_factors(n, used):
i = 2
factors = []
fackinds = set()
while i**2 <= n:
if n % i != 0:
i += 1
else:
if i not in fackinds:
used[i] += 1
fackinds.add(i)
factors.append(i)
n = n // i
if n > 1:
i... | Traceback (most recent call last):
File "/tmp/tmp2o7f6k_f/tmphv04cbr0.py", line 57, in <module>
resolve()
File "/tmp/tmp2o7f6k_f/tmphv04cbr0.py", line 33, in resolve
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s637951150 | p02574 | u347640436 | 1598732860 | Python | Python (3.8.2) | py | Runtime Error | 453 | 121952 | 1038 | from math import gcd
from functools import reduce
def make_prime_table(n):
sieve = list(range(n + 1))
sieve[0] = -1
sieve[1] = -1
for i in range(4, n + 1, 2):
sieve[i] = 2
for i in range(3, int(n ** 0.5) + 1, 2):
if sieve[i] != i:
continue
for j in range(i * i, n... | Traceback (most recent call last):
File "/tmp/tmp7y92ajt6/tmpg9_qydyn.py", line 42, in <module>
N, *A = map(int, open(0).read().split())
^^^^^
ValueError: not enough values to unpack (expected at least 1, got 0)
| |
s990585953 | p02574 | u061835391 | 1598732857 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9052 | 542 | def gcd(a,b):
if b==0:
return a
else:
return gcd(b,a%b)
n=int(input())
l=list(map(int,input().split()))
c=0
for i in range(0,n):
t=l[i%n]
y=l[(i+1)%n]
s=min(t,y)
p=max(t,y)
f=gcd(p,s)
if f==1:
c=c+1
if c==3:
print('pairwise coprime')
z=0
else:
f=l[0]
y=l[1]
a=max(f,y)
... | File "/tmp/tmp8ms35ski/tmp93_saz0u.py", line 20
else:
^^^^
SyntaxError: invalid syntax
| |
s408887391 | p02574 | u001769145 | 1598732855 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2212 | 239680 | 653 | import math
N = int(input())
A_L = [int(x) for x in input().split()]
A_L.sort()
def get_sieve_of_eratosthenes(n):
prime = []
limit = math.sqrt(n)
data = [i + 1 for i in range(1, n)]
while True:
p = data[0]
if limit <= p:
return prime + data
prime.append(p)
... | Traceback (most recent call last):
File "/tmp/tmpp115xeaw/tmpppn8_pza.py", line 3, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s916739503 | p02574 | u572026348 | 1598732811 | Python | Python (3.8.2) | py | Runtime Error | 123 | 27072 | 363 |
import numpy as np
def main():
n, m = map(int, input().split())
friends_mat = np.zeros((n, n), dtype=int)
for i in range(m):
a, b = map(int, input().split())
friends_mat[a - 1][b - 1] = 1
friends_mat[b - 1][a - 1] = 1
print(friends_mat)
print(max(friends_mat.sum(axis=0)+1)... | Traceback (most recent call last):
File "/tmp/tmpfo5yztyj/tmppoz97xx2.py", line 17, in <module>
main()
File "/tmp/tmpfo5yztyj/tmppoz97xx2.py", line 6, in main
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s258647166 | p02574 | u304102443 | 1598732810 | Python | PyPy3 (7.3.0) | py | Runtime Error | 140 | 143644 | 3521 | import os
import heapq
import sys,threading
import math as mt
import bisect
import operator
from collections import defaultdict
sys.setrecursionlimit(10**5)
from io import BytesIO, IOBase
def gcd(a,b):
if b==0:
return a
else:
return gcd(b,a%b)
def power(x, p,m):
res = 1
while p:
... | Traceback (most recent call last):
File "/tmp/tmptht2qi9_/tmp70d9h3gi.py", line 140, in <module>
if _name_ == "_main_":
^^^^^^
NameError: name '_name_' is not defined. Did you mean: '__name__'?
| |
s424986125 | p02574 | u560988566 | 1598732781 | Python | PyPy3 (7.3.0) | py | Runtime Error | 291 | 197292 | 989 | import math
n = int(input())
als = list(map(int, input().split()))
ans = "not coprime"
a, b = als[1], als[0]
if a < b:
a, b = b, a
while a % b != 0:
a, b = b, a % b
for i in range(2, n):
a = als[i]
if a < b:
a, b = b, a
while a % b != 0:
a, b = b, a % b
if b == 1:
ans... | Traceback (most recent call last):
File "/tmp/tmprb7ykdkq/tmpblvur5ka.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s195482529 | p02574 | u061835391 | 1598732769 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8960 | 542 | def gcd(a,b):
if b==0:
return a
else:
return gcd(b,a%b)
n=int(input())
l=list(map(int,input().split()))
c=0
for i in range(0,n):
t=l[i%n]
y=l[(i+1)%n]
s=min(t,y)
p=max(t,y)
f=gcd(p,s)
if f==1:
c=c+1
if c==3:
print('pairwise coprime')
z=0
else:
f=l[0]
y=l[1]
a=max(f,y)
... | File "/tmp/tmp1t7ikpwh/tmp7nbp9rok.py", line 20
else:
^^^^
SyntaxError: invalid syntax
| |
s484545692 | p02574 | u607075479 | 1598732716 | Python | PyPy3 (7.3.0) | py | Runtime Error | 279 | 197152 | 1942 | import sys
import math
from collections import deque
from collections import defaultdict
sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()
def make_grid(h, w, n... | Traceback (most recent call last):
File "/tmp/tmpfk85294p/tmpzpwnq94q.py", line 92, in <module>
main()
File "/tmp/tmpfk85294p/tmpzpwnq94q.py", line 58, in main
N = NI()
^^^^
File "/tmp/tmpfk85294p/tmpzpwnq94q.py", line 9, in <lambda>
NI = lambda: int(input())
^^^^^^^^^^^^
Valu... | |
s159864738 | p02574 | u560988566 | 1598732713 | Python | PyPy3 (7.3.0) | py | Runtime Error | 294 | 197228 | 929 | import math
n = int(input())
als = list(map(int, input().split()))
ans = "not coprime"
a, b = als[1], als[0]
while a % b != 0:
a, b = b, a % b
for i in range(2, n):
a = als[i]
while a % b != 0:
a, b = b, a % b
if b == 1:
ans = "setwise coprime"
break
existeven = False
faile... | Traceback (most recent call last):
File "/tmp/tmpddhje8rd/tmpqgddm_s3.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s932509046 | p02574 | u814986259 | 1598732701 | Python | PyPy3 (7.3.0) | py | Runtime Error | 112 | 68456 | 805 | def main():
import sys
input = sys.stdin.buffer.readline
from math import gcd
N = int(input())
A = list(map(int, input().split()))
g = A[0]
def factorization(n):
ret = set()
temp = n
for i in range(2, int(-(-n**0.5//1))+1):
if temp % i == 0:
... | File "/tmp/tmppg9fdb4a/tmpxsql8ak2.py", line 27
flag = False
TabError: inconsistent use of tabs and spaces in indentation
| |
s164921186 | p02574 | u061835391 | 1598732690 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9064 | 542 | def gcd(a,b):
if b==0:
return a
else:
return gcd(b,a%b)
n=int(input())
l=list(map(int,input().split()))
c=0
for i in range(0,n):
t=l[i%n]
y=l[(i+1)%n]
s=min(t,y)
p=max(t,y)
f=gcd(p,s)
if f==1:
c=c+1
if c==3:
print('pairwise coprime')
z=0
else:
f=l[0]
y=l[1]
a=max(f,y)
... | File "/tmp/tmp74trphry/tmp59a_kk48.py", line 20
else:
^^^^
SyntaxError: invalid syntax
| |
s218318144 | p02574 | u089142196 | 1598732688 | Python | Python (3.8.2) | py | Runtime Error | 2209 | 134388 | 868 | #E
import math
from math import gcd
N=int(input())
A=list(map(int,input().split()))
pc = "pairwise coprime"
sc = "setwise coprime"
nc = "not coprime"
maxi=max(A)
def eratosthenes(limit):
A = [i for i in range(2, limit+1)]
P = []
time = 0
while True:
prime = min(A)
if pri... | Traceback (most recent call last):
File "/tmp/tmp1twsv4ec/tmpuishghzs.py", line 4, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s293091023 | p02574 | u607075479 | 1598732681 | Python | PyPy3 (7.3.0) | py | Runtime Error | 314 | 196992 | 1941 | import sys
import math
from collections import deque
from collections import defaultdict
sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()
def make_grid(h, w, n... | Traceback (most recent call last):
File "/tmp/tmpwp7e3rmf/tmpd1jpriue.py", line 91, in <module>
main()
File "/tmp/tmpwp7e3rmf/tmpd1jpriue.py", line 58, in main
N = NI()
^^^^
File "/tmp/tmpwp7e3rmf/tmpd1jpriue.py", line 9, in <lambda>
NI = lambda: int(input())
^^^^^^^^^^^^
Valu... | |
s504874602 | p02574 | u631521893 | 1598732645 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8964 | 317 | import numpy
n = int(input())
arr = list(map(int,input().split()))
x = 1
for i in range(n-1):
if all(filter(lambda j: numpy.gcd(arr[i],j == 1, arr[i+1:])):
x = 0
break
if x == 0:
if numpy.gcd.reduce(arr) == 1: print('setwise coprime')
else: print('not coprime')
else : print('pairwise coprime') | File "/tmp/tmpxzzyuctx/tmphowc5h0a.py", line 6
if all(filter(lambda j: numpy.gcd(arr[i],j == 1, arr[i+1:])):
^
SyntaxError: invalid syntax
| |
s350089612 | p02574 | u056277698 | 1598732635 | Python | Python (3.8.2) | py | Runtime Error | 32 | 8856 | 494 | # -*- coding: utf-8 -*-
import sympy
n = int(input())
a = list(map(int, input().split()))
pcf = True
pc = set(sympy.divisors(a[0]))
pcl = len(pc)
sc = set(sympy.divisors(a[0]))
for i in a[1:]:
d = set(sympy.divisors(i))
dl = len(d) - 1
pc = pc.union(d)
pcl2 = len(pc)
if pcl + dl != pcl2:
... | Traceback (most recent call last):
File "/tmp/tmpfg9mmixy/tmp6wihlgpv.py", line 4, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s244341232 | p02574 | u272525952 | 1598732600 | Python | PyPy3 (7.3.0) | py | Runtime Error | 91 | 68660 | 698 | import numpy
import collections
n=int(input())
l=list(map(int,input().split()))
num=numpy.gcd(l[0],l[1])
for i in l:
num=numpy.gcd(num,i)
if num!=1:
print('not coprime')
else:
ll=collections.Counter(l)
if max(ll.values())!=1:
print('setwise coprime')
else:
if len(l)>=8*10**4:
... | Traceback (most recent call last):
File "/tmp/tmpvth2xts4/tmp8rqqifjg.py", line 3, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s640177612 | p02574 | u769876405 | 1598732593 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9156 | 1611 | def find_gcd(x, y):
while(y):
x, y = y, x % y
return x
def findMaxGCD(arr, n) :
# Calculating MAX in
# array
high = 0
for i in range(0, n) :
high = max(high, arr[i])
# Maintaining count array
count = [0] * (high + 1)
for i in range(... | Traceback (most recent call last):
File "/tmp/tmpp7ojhfwv/tmp0ra62b5l.py", line 54, in <module>
pair = findMaxGCD(arr, len(arr))
^^^
NameError: name 'arr' is not defined
| |
s639042794 | p02574 | u408620326 | 1598732585 | Python | PyPy3 (7.3.0) | py | Runtime Error | 370 | 208124 | 2239 | def main():
import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline
N = int(input())
A = [int(x) for x in input().strip().split()]
maxA = max(A)
prime = [i % 2 != 0 for i in range(maxA+1)]
prime[2] = True
f = [False] * (maxA+1)
for i in range(3, int(maxA**.5)+1):
... | Traceback (most recent call last):
File "/tmp/tmpp6hbxmrm/tmpuiyfqznb.py", line 77, in <module>
main()
File "/tmp/tmpp6hbxmrm/tmpuiyfqznb.py", line 5, in main
N = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s150969188 | p02574 | u123872895 | 1598732561 | Python | Python (3.8.2) | py | Runtime Error | 682 | 132832 | 683 | from math import gcd
n = int(input())
a = list(map(int, input().split()))
d = a[0]
m = a[0]
g = True
for i in range(1, n):
d = gcd(d, a[i])
if d != 1:
print("not coprime")
else:
while len(a) > 1:
b = []
for i in range(0, len(a), 2):
#print(i, a)
if i == n-1:
... | Traceback (most recent call last):
File "/tmp/tmptffeynpw/tmp5yxeld8y.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s891985046 | p02574 | u769876405 | 1598732533 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9052 | 1611 | def find_gcd(x, y):
while(y):
x, y = y, x % y
return x
def findMaxGCD(arr, n) :
# Calculating MAX in
# array
high = 0
for i in range(0, n) :
high = max(high, arr[i])
# Maintaining count array
count = [0] * (high + 1)
for i in range(... | Traceback (most recent call last):
File "/tmp/tmp28bdsa00/tmp5fdlua5b.py", line 54, in <module>
pair = findMaxGCD(arr, len(arr))
^^^
NameError: name 'arr' is not defined
| |
s136372242 | p02574 | u061835391 | 1598732521 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8924 | 541 | def gcd(a,b):
if b==0:
return a
else:
return gcd(b,a%b)
n=int(input())
l=list(map(int,input().split()))
c=0
for i in range(0,n):
t=l[i%n]
y=l[(i+1)%n]
s=min(t,y)
p=max(t,y)
f=gcd(p,s)
if f==1:
c=c+1
if c==3:
print('pairwise coprime')
z=0
else:
f=l[0]
y=l[1]
a=max(f,y)
... | File "/tmp/tmptw5n1xfa/tmpu_4x8tzx.py", line 20
else:
^^^^
SyntaxError: invalid syntax
| |
s278612385 | p02574 | u021814034 | 1598732502 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2211 | 191708 | 2513 | import sys
import bisect as bi
import math
from collections import defaultdict as dd
import heapq
import itertools
input=sys.stdin.readline
from random import randint
##import numpy as np
##sys.setrecursionlimit(10**7)
mo=10**9+7
def cin():
return map(int,sin().split())
def ain():
return list(map(in... | Traceback (most recent call last):
File "/tmp/tmpcbnphtl2/tmpn1gbslws.py", line 43, in <module>
n=inin()
^^^^^^
File "/tmp/tmpcbnphtl2/tmpn1gbslws.py", line 19, in inin
return int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s826613198 | p02574 | u408620326 | 1598732496 | Python | PyPy3 (7.3.0) | py | Runtime Error | 377 | 207804 | 2177 | def main():
import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline
N = int(input())
A = [int(x) for x in input().strip().split()]
maxA = max(A)
prime = [i % 2 != 0 for i in range(maxA+1)]
prime[2] = True
f = [False] * (maxA+1)
for i in range(3, int(maxA**.5)+1):
... | Traceback (most recent call last):
File "/tmp/tmp2ex6wt71/tmpy6iec_4s.py", line 75, in <module>
main()
File "/tmp/tmp2ex6wt71/tmpy6iec_4s.py", line 5, in main
N = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s559194588 | p02574 | u089142196 | 1598732471 | Python | Python (3.8.2) | py | Runtime Error | 2209 | 127572 | 903 | #E
import math
from math import gcd
N=int(input())
A=list(map(int,input().split()))
pc = "pairwise coprime"
sc = "setwise coprime"
nc = "not coprime"
maxi=max(A)
def eratosthenes(limit):
A = [i for i in range(2, limit+1)]
P = []
time = 0
while True:
prime = min(A)
if pri... | Traceback (most recent call last):
File "/tmp/tmpczgezny1/tmp7txd0so6.py", line 4, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s217944991 | p02574 | u934953801 | 1598732419 | Python | Python (3.8.2) | py | Runtime Error | 257 | 127312 | 674 | def find_gcd(x, y):
while(y):
x, y = y, x % y
return x
def numOfPairs(arr, n) :
count = 0
for i in range(0, n-1) :
for j in range(i+1, n) :
if (math.gcd(arr[i], arr[j])==1) :
count = count + 1
return count
n=int(input())
arr=list(map(int,... | Traceback (most recent call last):
File "/tmp/tmpsu0gt9yu/tmpnpdr8_u9.py", line 15, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s517025748 | p02574 | u249218427 | 1598732384 | Python | PyPy3 (7.3.0) | py | Runtime Error | 100 | 68468 | 933 | N = int(input())
A = list(map(int, input().split()))
dictA = dict()
for a in A:
if a in dictA.keys():
dictA[a] += 1
else:
dictA[a] = 1
def get_prime(p):
result = []
if p==1:
return result
else:
integers = [1 for _ in range(p+1)]
integers[0] = 0
integers[1] = 0
for i in range(p+1):... | File "/tmp/tmp0geazto0/tmphrrgodm7.py", line 37
break
^^^^^
SyntaxError: 'break' outside loop
| |
s055489055 | p02574 | u177388368 | 1598732329 | Python | Python (3.8.2) | py | Runtime Error | 2210 | 134808 | 806 | n=int(input())
a=list(map(int,input().split()))
from math import gcd
from itertools import combinations as cmb
par=[i for i in range(n)]
def root(i):
if par[i]==i:
return i
else:
r=root(par[i])
par[i]=r
return r
def unite(x,y):
rx=root(x)
ry=root(y)
if rx!=ry:
... | Traceback (most recent call last):
File "/tmp/tmpt2o_6nfk/tmpckxeg3kx.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s112676759 | p02574 | u021814034 | 1598732326 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2211 | 191876 | 2505 | import sys
import bisect as bi
import math
from collections import defaultdict as dd
import heapq
import itertools
input=sys.stdin.readline
from random import randint
##import numpy as np
##sys.setrecursionlimit(10**7)
mo=10**9+7
def cin():
return map(int,sin().split())
def ain():
return list(map(in... | Traceback (most recent call last):
File "/tmp/tmp1n0stf7p/tmpt1dyxon5.py", line 43, in <module>
n=inin()
^^^^^^
File "/tmp/tmp1n0stf7p/tmpt1dyxon5.py", line 19, in inin
return int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s388042005 | p02574 | u574922408 | 1598732308 | Python | PyPy3 (7.3.0) | py | Runtime Error | 780 | 210204 | 1025 | #!/usr/bin/env python3
import collections as cl
import sys
def II():
return int(sys.stdin.readline())
def MI():
return map(int, sys.stdin.readline().split())
def LI():
return list(map(int, sys.stdin.readline().split()))
def main():
N = II()
targets = LI()
MAX_INT = max(targets) + 1
t... | Traceback (most recent call last):
File "/tmp/tmpywty1cbg/tmpuoapn_o5.py", line 57, in <module>
main()
File "/tmp/tmpywty1cbg/tmpuoapn_o5.py", line 19, in main
N = II()
^^^^
File "/tmp/tmpywty1cbg/tmpuoapn_o5.py", line 7, in II
return int(sys.stdin.readline())
^^^^^^^^^^^^^^^^^^^^^^... | |
s896622846 | p02574 | u876742094 | 1598732306 | Python | PyPy3 (7.3.0) | py | Runtime Error | 316 | 205228 | 469 | def gcd(x, y):
if y == 0:
return x
else:
return gcd(y,x%y)
n=int(input())
a=list(map(int,input().split()))
b=gcd(a[0],a[1])
res1=True
c=[1]*n
for i in range(1,n):
c[i]=c[i-1]*a[n-i+1]%a[n-i]
for i in range(n-1):
d=a[i];e=a[i+1];f=c[n-i-1]
if gcd(d,f)==1:
continue
else:
... | Traceback (most recent call last):
File "/tmp/tmp9qv4xyn7/tmpttkc0mhr.py", line 7, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s500696529 | p02574 | u177388368 | 1598732293 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2211 | 208780 | 806 | n=int(input())
a=list(map(int,input().split()))
from math import gcd
from itertools import combinations as cmb
par=[i for i in range(n)]
def root(i):
if par[i]==i:
return i
else:
r=root(par[i])
par[i]=r
return r
def unite(x,y):
rx=root(x)
ry=root(y)
if rx!=ry:
... | Traceback (most recent call last):
File "/tmp/tmprz6jb4nf/tmpqvlnnhn2.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s948772478 | p02574 | u700805562 | 1598732205 | Python | PyPy3 (7.3.0) | py | Runtime Error | 679 | 197520 | 821 | import sys
n = int(input())
a = list(map(int, input().split()))
def prime_decomposition(n):
i = 2
table = []
while i**2 <= n:
while n % i == 0:
n //= i
table.append(i)
i += 1
if n > 1: table.append(n)
return set(table)
pri_0 = prime_decomposition(a[0])
pri_1... | Traceback (most recent call last):
File "/tmp/tmpg449sskz/tmp89xeg2ws.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s244498820 | p02574 | u023229441 | 1598732162 | Python | PyPy3 (7.3.0) | py | Runtime Error | 391 | 191284 | 2109 | import sys
mod=10**9+7 ; inf=float("inf")
from math import sqrt, ceil
from collections import deque, Counter, defaultdict #すべてのkeyが用意されてる defaultdict(int)で初期化
input=lambda: sys.stdin.readline().strip()
sys.setrecursionlimit(11451419)
from decimal import ROUND_HALF_UP,Decimal #変換後の末尾桁を0や0.01で指定
#Decimal((str(0.5)).qu... | Traceback (most recent call last):
File "/tmp/tmpnu_b8fsp/tmp5f_fyoel.py", line 17, in <module>
n=int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s866580179 | p02574 | u408620326 | 1598732154 | Python | PyPy3 (7.3.0) | py | Runtime Error | 357 | 208052 | 2321 | def main():
import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline
N = int(input())
A = [int(x) for x in input().strip().split()]
maxA = max(A)
prime = [i % 2 != 0 for i in range(maxA+1)]
prime[2] = True
f = [False] * (maxA+1)
for i in range(3, int(maxA**.5)+1):
... | Traceback (most recent call last):
File "/tmp/tmpgpu_25kv/tmpn5u67b45.py", line 81, in <module>
main()
File "/tmp/tmpgpu_25kv/tmpn5u67b45.py", line 5, in main
N = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s938673919 | p02574 | u512007680 | 1598732147 | Python | PyPy3 (7.3.0) | py | Runtime Error | 372 | 206184 | 1066 | import sys
from collections import deque
prime = []
for i in range(2,1001):
det = 0
for j in range(2,int(i**(1/2))+1):
if i%j==0:
det = -1
break
if det == 0:
prime.append(i)
N = int(input())
A = list(map(int,input().split()))
B = []###Aのうち1ではないもの
det = False###Aが1を... | Traceback (most recent call last):
File "/tmp/tmp7eciz2da/tmphvvtu753.py", line 15, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s844882614 | p02574 | u255943004 | 1598732144 | Python | PyPy3 (7.3.0) | py | Runtime Error | 509 | 210100 | 945 | from math import gcd
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.append([temp, 1])
if a... | Traceback (most recent call last):
File "/tmp/tmpdsdr3nvr/tmp6fz7j8t2.py", line 18, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s764492260 | p02574 | u491100219 | 1598732107 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8972 | 5347 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
using namespace std;
using ll = long long;
const ll mod = (ll)1e9 + 7;
vector<ll> prime = {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, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151,... | File "/tmp/tmpahigpi1d/tmpeqlfau8z.py", line 3
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s915488364 | p02574 | u869790980 | 1598732091 | Python | PyPy2 (7.3.0) | py | Runtime Error | 247 | 162004 | 694 | pps = []
d = [True for uu in range(100001)]
for u in range(2, 100000):
if d[u]:
c = 2
while(c*u < 100000):
d[c*u] = False
c+=1
for uu in range(2,len(d)):
if d[uu]:
pps.append(uu)
n = raw_input()
def gcd(a,b):
if b == 0:
return a
return gcd(b,a%b)
def f(ais):
seen = set()
bis = ais[::]
flag= T... | File "/tmp/tmpf315h09w/tmplzu931z7.py", line 43
print f(map(int, raw_input().split()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s693524993 | p02574 | u024768467 | 1598732053 | Python | PyPy3 (7.3.0) | py | Runtime Error | 296 | 205116 | 728 | n=int(input())
a_list = list(map(int,input().split()))
def divisor(n):
ass = []
for i in range(1,int(n**0.5)+1):
if n%i == 0:
ass.append(i)
if i**2 == n:
continue
ass.append(n//i)
return ass #sortされていない
set_len_list = [0]*n
set_all = {1}
for i in... | Traceback (most recent call last):
File "/tmp/tmpedkc043x/tmpaq868mii.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s036133383 | p02574 | u332657092 | 1598732023 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2213 | 209960 | 1358 | n = int(input())
A = list(map(int, input().split()))
max_A = max(A)
import math
from collections import Counter
def sieve_of_erastosthenes(num):
input_list = [False if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 else True for i in range(num)]
input_list[0] = input_list[1] = False
input_list[2] = input_list[3] = ... | Traceback (most recent call last):
File "/tmp/tmp11mlkn5f/tmpolcuxfm3.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s676873468 | p02574 | u792078574 | 1598732016 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2211 | 181836 | 1428 | import math
def main():
N = int(input())
As = list(map(int, input().split()))
pairwise_flag = True
setwise_flag = True
if N > 78498:
pairwise_flag = False
L = 1000 + 1
isPrime = [True] * L
isPrime[0] = isPrime[1] = False
primes = []
for n in range(2, L):
if ... | Traceback (most recent call last):
File "/tmp/tmpcop95ou0/tmpwnys_l6n.py", line 58, in <module>
main()
File "/tmp/tmpcop95ou0/tmpwnys_l6n.py", line 4, in main
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s573958089 | p02574 | u366482170 | 1598731999 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2213 | 383772 | 2644 | #import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math
from collections import deque
import itertools
import heapq
#import bisect
from fractions import Fraction
import copy
from functools import lru_cache
from collections import defaultdict
import pprint
#oo=list("ABCDEFGHIJKLMNOPQRSTUVWXY... | Traceback (most recent call last):
File "/tmp/tmpcee_artc/tmpa1fnpg3h.py", line 129, in <module>
main()
File "/tmp/tmpcee_artc/tmpa1fnpg3h.py", line 96, in main
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s711739199 | p02574 | u116002573 | 1598731984 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2211 | 246096 | 1108 | import math
def main():
N = int(input())
A = list(map(int, input().split()))
A = [v for v in A if v != 1]
if len(set(A)) < len(A): return "not coprime"
A = list(set(A))
def searchPrimeNum(N):
max = int(math.sqrt(N))
seachList = [i for i in range(2,N+1)]
primes = []
... | Traceback (most recent call last):
File "/tmp/tmpokifj62x/tmpq89t1ny6.py", line 49, in <module>
print(main())
^^^^^^
File "/tmp/tmpokifj62x/tmpq89t1ny6.py", line 4, in main
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s239102999 | p02574 | u366482170 | 1598731979 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2219 | 471812 | 2641 | #import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math
from collections import deque
import itertools
import heapq
#import bisect
from fractions import Fraction
import copy
from functools import lru_cache
from collections import defaultdict
import pprint
#oo=list("ABCDEFGHIJKLMNOPQRSTUVWXY... | Traceback (most recent call last):
File "/tmp/tmpj5txctt6/tmpno7j87w1.py", line 129, in <module>
main()
File "/tmp/tmpj5txctt6/tmpno7j87w1.py", line 96, in main
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s114772720 | p02574 | u877415670 | 1598731976 | Python | PyPy3 (7.3.0) | py | Runtime Error | 769 | 190236 | 1425 | def sieve_eratosthenes(n):
primes = [0, 1] * (n // 2 + 1)
if n % 2 == 0:
primes.pop()
primes[1] = 0
primes[2] = 1
for p in range(3, n + 1, 2):
if primes[p]:
for q in range(p * p, n + 1, 2 * p):
primes[q] = 0
return primes
def factorization(n):
arr... | Traceback (most recent call last):
File "/tmp/tmpkx91k3pm/tmpcxub_04x.py", line 37, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s633818081 | p02574 | u555767343 | 1598731969 | Python | PyPy3 (7.3.0) | py | Runtime Error | 411 | 205200 | 621 | import math
n = int(input())
A = list(map(int, input().split()))
#A = sorted(A)
ansN = A[0]
for i in range(1, n):
ansN = math.gcd(ansN, A[i])
if ansN > 1:
print('not coprime')
else:
ans2 = True
C = [0 for _ in range(10**6+10)]
for a in A:
F = factorization(a)
# print(F)
for ... | Traceback (most recent call last):
File "/tmp/tmp4w0hzmws/tmp88bxaecp.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s702037908 | p02574 | u023229441 | 1598731959 | Python | PyPy3 (7.3.0) | py | Runtime Error | 581 | 201228 | 2100 | import sys
mod=10**9+7 ; inf=float("inf")
from math import sqrt, ceil
from collections import deque, Counter, defaultdict #すべてのkeyが用意されてる defaultdict(int)で初期化
input=lambda: sys.stdin.readline().strip()
sys.setrecursionlimit(11451419)
from decimal import ROUND_HALF_UP,Decimal #変換後の末尾桁を0や0.01で指定
#Decimal((str(0.5)).qu... | Traceback (most recent call last):
File "/tmp/tmp9de2x1cn/tmpwjlme3x4.py", line 17, in <module>
n=int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s728284093 | p02574 | u873776333 | 1598731950 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2218 | 383760 | 828 | def primeFactors(n):
ret = set()
x = 2
while n > 1:
while n%x == 0:
ret.add(x)
n = n//x
x += 1
return ret
N = int(input())
Arr = list(map(int, input().split()))
factors = [primeFactors(x) for x in Arr]
for factor in factors[0]:
nc = False
this = True
... | Traceback (most recent call last):
File "/tmp/tmparvnuttp/tmp6z8m1814.py", line 11, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s379462001 | p02574 | u651663683 | 1598731950 | Python | Python (3.8.2) | py | Runtime Error | 1668 | 150336 | 946 | import numpy as np
def prime(n):
primes = np.zeros(n + 1, dtype=np.bool)
primes[2] = 1
primes[3::2] = 1
for p in range(3, n + 1, 2):
if primes[p]:
primes[p * p::2 * p] = 0
return primes
pp=prime(10**3)
p=[]
for i in range(2,1001):
if pp[i]:
p.append(i)
n=int(input())
a=li... | /tmp/tmprkbyx51d/tmpfz25sxth.py:4: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.
primes = np.zeros(n + 1, dtype=np.bool)
Traceback (most recent call last):
File "/tmp/tmprkbyx51d/tmpfz25sxth.py", line 11, in <module>
pp=prime(10**3)
^^^^^^^^^^^^
File "/tmp/tm... | |
s253411518 | p02574 | u408620326 | 1598731856 | Python | PyPy3 (7.3.0) | py | Runtime Error | 526 | 224752 | 2137 | def main():
import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline
N = int(input())
A = [int(x) for x in input().strip().split()]
maxA = max(A)
prime = [i % 2 != 0 for i in range(maxA+1)]
prime[2] = True
f = [False] * (maxA+1)
for i in range(3, int(maxA**.5)+1):
... | Traceback (most recent call last):
File "/tmp/tmpq9z61xqa/tmp5yrqafal.py", line 73, in <module>
main()
File "/tmp/tmpq9z61xqa/tmp5yrqafal.py", line 5, in main
N = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s653650411 | p02574 | u017050982 | 1598731846 | Python | PyPy3 (7.3.0) | py | Runtime Error | 595 | 217004 | 950 | import math
N = int(input())
A = list(map(int,input().rstrip().split(" ")))
M = int(math.sqrt(max(A))) + 1
sosuu = set()
sosuu.add(2)
for i in range(3,M,2):
for j in sosuu:
if i % j == 0:
break
else:
sosuu.add(i)
pair = True
setw = True
counter = 0
lis = [0 for i in range(10 ** 6)]
f... | Traceback (most recent call last):
File "/tmp/tmpyet0r90a/tmpdsm8sq0y.py", line 2, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s150003401 | p02574 | u908391630 | 1598731830 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2208 | 214544 | 1361 | import bisect
import sys
import math
input = sys.stdin.readline
import functools
from collections import defaultdict
############ ---- Input Functions ---- ############
def inp():
return(int(input()))
def inlt():
return(list(map(int,input().split())))
def insr():
s = input()
return(list(s[:len(s) - 1... | Traceback (most recent call last):
File "/tmp/tmpw_rnk7nz/tmpgz_1chl7.py", line 68, in <module>
res = solve()
^^^^^^^
File "/tmp/tmpw_rnk7nz/tmpgz_1chl7.py", line 32, in solve
N = inp()
^^^^^
File "/tmp/tmpw_rnk7nz/tmpgz_1chl7.py", line 12, in inp
return(int(input()))
^^^^... | |
s308296703 | p02574 | u869790980 | 1598731827 | Python | PyPy2 (7.3.0) | py | Runtime Error | 521 | 168532 | 66224 | pps = [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, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 34... | File "/tmp/tmpqq9ctwxr/tmpkayykozo.py", line 31
print f(map(int, raw_input().split()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s438274482 | p02574 | u127873832 | 1598731804 | Python | Python (3.8.2) | py | Runtime Error | 2208 | 132984 | 572 | from math import sqrt
from collections import Counter
def factorize(n):
rt = int(sqrt(n)+1)
facts = []
for i in range(2, rt+1):
if n % i == 0:
facts.append(i)
while n % i == 0:
n //= i
if n != 1:
facts.append(n)
return facts
n = int(input())
... | Traceback (most recent call last):
File "/tmp/tmpt3b2arg4/tmpi04ereu_.py", line 16, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s242501572 | p02574 | u519968172 | 1598731804 | Python | PyPy3 (7.3.0) | py | Runtime Error | 373 | 207220 | 363 | n=int(input())
a=list(map(int,input().split()))
l=[0]*(10**6+1)
for m in a:
l[m]=1
x=0
j=2
#print(l)
for i in range(n):
c=0
k=1
while j*k<=10**6+1 :
if l[j*k]==1:
c+=1
l[j*k]=0
k+=1
if c==n:
print("not coprime")
exit()
elif c>1:
x=1
j+=1
if x==1:
print("setwise coprime")... | Traceback (most recent call last):
File "/tmp/tmpxsf98i8o/tmpjfqk3h1o.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s340581104 | p02574 | u800396927 | 1598731769 | Python | PyPy3 (7.3.0) | py | Runtime Error | 433 | 241948 | 965 | from math import gcd
n = int(input())
A = list(map(int,input().split()))
d =[0]*(2*10**6+1)
c = [0]*(2*10**6+1)
max_val = max(A)
for a in A:
d[a] += 1
A.sort()
flag = True
for i in range(2,max_val+1):
if c[i]==0:
flag = True
for j in range(i,max_val+1,i):
c[j]=1
if d[j]... | Traceback (most recent call last):
File "/tmp/tmp0xj45c92/tmpuq6qrjsu.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s865990157 | p02574 | u869790980 | 1598731746 | Python | PyPy2 (7.3.0) | py | Runtime Error | 304 | 168820 | 66231 | pps = pps = [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, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, ... | File "/tmp/tmpx6eu1x_8/tmpfir0gdze.py", line 31
print f(map(int, raw_input().split()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s815849008 | p02574 | u127873832 | 1598731736 | Python | Python (3.8.2) | py | Runtime Error | 2208 | 132968 | 574 | from math import sqrt
from collections import Counter
def factorize(n):
rt = int(sqrt(n)+1)
facts = []
for i in range(2, rt+1):
if n % i == 0:
facts.append(i)
while n % i == 0:
n //= i
if n != 1:
facts.append(n)
return facts
n = int(input())
... | Traceback (most recent call last):
File "/tmp/tmp5sd7dky1/tmphwul02t_.py", line 16, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s392950979 | p02574 | u815269021 | 1598731696 | Python | PyPy3 (7.3.0) | py | Runtime Error | 196 | 164648 | 271 | import math
m=int(input())
a,b,c=map(int,input().split())
a1=math.gcd(a,b)
a2=math.gcd(a,c)
a3=math.gcd(b,c)
if a1==1 and a2==1 and a3==1:
print("pairwise coprime")
elif a1==2 and a2==2 and a3==2:
print("not coprime")
else:
print("setwise coprime")
| Traceback (most recent call last):
File "/tmp/tmpunonjmr7/tmp0_tavyr5.py", line 2, in <module>
m=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s460678824 | p02574 | u285891772 | 1598731689 | Python | PyPy3 (7.3.0) | py | Runtime Error | 302 | 188600 | 1891 | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter... | Traceback (most recent call last):
File "/tmp/tmpy855hc8g/tmp9ahe9v0m.py", line 25, in <module>
N = INT()
^^^^^
File "/tmp/tmpy855hc8g/tmp9ahe9v0m.py", line 12, in INT
def INT(): return int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s055408970 | p02574 | u815269021 | 1598731641 | Python | Python (3.8.2) | py | Runtime Error | 127 | 99864 | 271 | import math
m=int(input())
a,b,c=map(int,input().split())
a1=math.gcd(a,b)
a2=math.gcd(a,c)
a3=math.gcd(b,c)
if a1==1 and a2==1 and a3==1:
print("pairwise coprime")
elif a1==2 and a2==2 and a3==2:
print("not coprime")
else:
print("setwise coprime")
| Traceback (most recent call last):
File "/tmp/tmp6e2jdphm/tmp7jx5lkti.py", line 2, in <module>
m=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s764179645 | p02574 | u026788530 | 1598731636 | Python | Python (3.8.2) | py | Runtime Error | 2208 | 137548 | 2194 | MOD = 10**9+7
lim = 200000
inv_t = [-1 for i in range(lim+1)]
factrial = [-1 for i in range(lim+1)]
factrial_inv = [-1 for i in range(lim+1)]
def mod_inv(x, mod=MOD):
y, u, v, _x = mod, 1, 0, x
while y:
t = _x//y
_x -= t*y
_x, y = y, _x
u -= t*v
u, v = v, u
u %= mod... | Traceback (most recent call last):
File "/tmp/tmpwucaeg8x/tmp6hnwwndu.py", line 68, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s074946214 | p02574 | u550294762 | 1598731635 | Python | PyPy3 (7.3.0) | py | Runtime Error | 87 | 68592 | 1458 | import numpy as np
def seachPrimeNum(N):
max = int(np.sqrt(N))
seachList = [i for i in range(2, N+1)]
primeNum = []
while seachList[0] <= max:
primeNum.append(seachList[0])
tmp = seachList[0]
seachList = [i for i in seachList if i % tmp != 0]
primeNum.extend(seachList)
... | Traceback (most recent call last):
File "/tmp/tmpjqch0v6z/tmpafmzvb39.py", line 36, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s709406103 | p02574 | u116002573 | 1598731625 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2213 | 260340 | 1209 | import math
def main():
N = int(input())
A = list(map(int, input().split()))
A = [v for v in A if v != 1]
if len(set(A)) < len(A): return "not coprime"
A = list(set(A))
def eratosthenes(limit):
B = [i for i in range(2, limit+1)]
primes = []
while True:
prim... | Traceback (most recent call last):
File "/tmp/tmpx4_1u5h4/tmpb5924sbe.py", line 54, in <module>
print(main())
^^^^^^
File "/tmp/tmpx4_1u5h4/tmpb5924sbe.py", line 4, in main
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s143668381 | p02574 | u693173434 | 1598731576 | Python | Python (3.8.2) | py | Runtime Error | 2209 | 134576 | 898 | import math
n=int(input())
a=list(map(int,input().split()))
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 = []
limit = math.sqrt(n)
data = [i + 1 for i in range(1, n)]
while Tru... | Traceback (most recent call last):
File "/tmp/tmpoy033f9l/tmp460cuita.py", line 2, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s322489377 | p02574 | u860002137 | 1598731566 | Python | Python (3.8.2) | py | Runtime Error | 2209 | 128844 | 377 | from fractions import gcd
from collections import Counter
n = int(input())
arr = list(map(int, input().split()))
a = 1
result = []
for x in arr:
y = gcd(a, x)
result.append(y)
a = a * x // y
if result.count(1) == len(arr):
print("pairwise coprime")
sys.exit()
if len(Counter(result[1:])) == 1:
... | Traceback (most recent call last):
File "/tmp/tmpborcjmqy/tmpvcz4ro0l.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)
| |
s585656168 | p02574 | u192154323 | 1598731562 | Python | Python (3.8.2) | py | Runtime Error | 929 | 127132 | 1172 | def make_divisors(n):
divisors = []
# 試し割りで、かつ積でnを作るときの相方も同時に追加してる
for i in range(1, int(n**0.5)+1):
if n % i == 0:
divisors.append(i)
if i != n // i:
divisors.append(n//i)
divisors.sort()
return divisors
from math import gcd
import sys
n = int(input(... | Traceback (most recent call last):
File "/tmp/tmpmt2y_lzt/tmpetj8qvrn.py", line 14, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s086970824 | p02574 | u588794534 | 1598731558 | Python | PyPy3 (7.3.0) | py | Runtime Error | 705 | 197828 | 883 | n=int(input())
a=list(map(int,input().split()))
import math
ans = a[0]
for i in range(1, n):
ans = math .gcd(ans, a[i])
if ans!=1:
#print(ans)
print("not coprime")
exit()
else:
checked=[0]*(int(max(a)))
#print(checked)
for item in a:
for j in range(1,int(item**0.5)+1):
... | Traceback (most recent call last):
File "/tmp/tmp9ui0sfwl/tmpnf045pmv.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s444055059 | p02574 | u102305348 | 1598731552 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 132720 | 470 | import math
N = int(input())
A = list(set(list(map(int, input().split()))))
gcdAll = A[0]
isPairwise = True
for j in range(1, N):
gcdAll = math.gcd(gcdAll, A[j])
if not isPairwise:
continue
for i in range(0, j):
gcdNow = math.gcd(A[i], A[j])
if gcdNow != 1:
isPairwise... | Traceback (most recent call last):
File "/tmp/tmpgfo_jvq2/tmpif1mqz9f.py", line 3, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s688555228 | p02574 | u060936992 | 1598731526 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8984 | 943 | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const long long MOD=1000000007;
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
const int mmax=1000009;
int main(void){
int n;
cin>>n;
vector<int> A(n);
rep(... | File "/tmp/tmpmw6x0xoj/tmpb35ldei0.py", line 2
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s604443096 | p02574 | u061835391 | 1598731477 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8920 | 201 | def gcd(a,b):
if b==0:
return a
else:
return gcd(b,a%b)
n=int(input())
l=list(map(int,input().split()))
for i in range(0,n):
t=l[i%n]
y=l[(i+1)%n]
s=min(t,y)
p=max(t,y
f=gcd(p,s) | File "/tmp/tmpc32ru1mv/tmph_4iiswk.py", line 12
p=max(t,y
^
SyntaxError: '(' was never closed
| |
s862526414 | p02574 | u102305348 | 1598731441 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2207 | 225048 | 470 | import math
N = int(input())
A = list(set(list(map(int, input().split()))))
gcdAll = A[0]
isPairwise = True
for j in range(1, N):
gcdAll = math.gcd(gcdAll, A[j])
if not isPairwise:
continue
for i in range(0, j):
gcdNow = math.gcd(A[i], A[j])
if gcdNow != 1:
isPairwise... | Traceback (most recent call last):
File "/tmp/tmp3ps4y27k/tmpz4tzjeyr.py", line 3, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s194263725 | p02574 | u026788530 | 1598731438 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 138516 | 2085 | MOD = 10**9+7
lim = 200000
inv_t = [-1 for i in range(lim+1)]
factrial = [-1 for i in range(lim+1)]
factrial_inv = [-1 for i in range(lim+1)]
def mod_inv(x, mod=MOD):
y, u, v, _x = mod, 1, 0, x
while y:
t = _x//y
_x -= t*y
_x, y = y, _x
u -= t*v
u, v = v, u
u %= mod... | Traceback (most recent call last):
File "/tmp/tmpn81ujfda/tmpmpbxdlap.py", line 68, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s626677829 | p02574 | u151785909 | 1598731406 | Python | PyPy3 (7.3.0) | py | Runtime Error | 523 | 197832 | 539 | import math
n = int(input())
a = list(map(int,input().split()))
a.sort()
ans = a[0]
for i in range(1, n):
ans = math.gcd(ans, a[i])
if ans!=1:
print('not coprime')
else:
for i in range(min(1000,n-1)):
for k in range(i+1,min(n,1000)):
if math.gcd(a[i],a[j])!=1:
print('... | Traceback (most recent call last):
File "/tmp/tmpur2qfepx/tmphz1xelow.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s165555919 | p02574 | u170201762 | 1598731401 | Python | PyPy3 (7.3.0) | py | Runtime Error | 826 | 203304 | 3031 | N = int(input())
if N<=10**5:
def eratosthenes(n):
prime = []
limit = n**0.5
numbers = [i for i in range(2,n+1)]
while True:
p = numbers[0]
if limit <= p:
return prime + numbers
prime.append(p)
numbers = [i for i in num... | Traceback (most recent call last):
File "/tmp/tmpotd3eyhu/tmpq1qfj1_l.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s833888514 | p02574 | u815269021 | 1598731364 | Python | Python (3.8.2) | py | Runtime Error | 111 | 90592 | 263 | import math
m=int(input())
a,b,c=map(int,input().split())
if math.gcd(a,b) and math.gcd(a,c) and math.gcd(b,c)==1:
print("pairwise coprime")
elif math.gcd(a,b) and math.gcd(a,c) and math.gcd(b,c)==2:
print("not coprime")
else:
print("setwise coprime") | Traceback (most recent call last):
File "/tmp/tmpxqhb6rf1/tmpm91t27c3.py", line 2, in <module>
m=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s814868693 | p02574 | u247830763 | 1598731326 | Python | PyPy3 (7.3.0) | py | Runtime Error | 140 | 68600 | 1036 | from collections import Counter
import sys
import numpy as np
n = int(input())
ls = list(map(int,input().split()))
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
tem... | Traceback (most recent call last):
File "/tmp/tmpv95bhd5y/tmpzpvj18w4.py", line 4, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s861134773 | p02574 | u604522449 | 1598731294 | Python | Python (3.8.2) | py | Runtime Error | 423 | 128952 | 900 | import sys,os
import math
from fractions import Fraction
from collections import defaultdict
from random import randint
# sys.stderr=open('err.txt','w')
# sys.stdout=open('output.txt','w')
# sys.stdin=open('input.txt','r')
def linput():
return list(minput())
def minput():
return map(int, sys.stdin.readline(... | Traceback (most recent call last):
File "/tmp/tmp1bj5ds0g/tmp4ycukgt9.py", line 31, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s661349689 | p02574 | u651663683 | 1598731275 | Python | PyPy3 (7.3.0) | py | Runtime Error | 160 | 68572 | 826 | import numpy as np
def prime(n):
primes = np.zeros(n + 1, dtype=np.bool)
primes[2] = 1
primes[3::2] = 1
for p in range(3, n + 1, 2):
if primes[p]:
primes[p * p::2 * p] = 0
return primes
pp=prime(10**3)
p=[]
for i in range(2,1001):
if pp[i]:
p.append(i)
n=int(input())
a=li... | /tmp/tmpe3ff3gad/tmp3pv616l9.py:4: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.
primes = np.zeros(n + 1, dtype=np.bool)
Traceback (most recent call last):
File "/tmp/tmpe3ff3gad/tmp3pv616l9.py", line 11, in <module>
pp=prime(10**3)
^^^^^^^^^^^^
File "/tmp/tm... | |
s967627363 | p02574 | u906501980 | 1598731186 | Python | PyPy3 (7.3.0) | py | Runtime Error | 1719 | 197052 | 769 | from collections import defaultdict
def get_prime_factors(x):
out = set()
if x < 1:
return out
while not x%2:
out.add(2)
x //= 2
i = 3
while i*i <= x:
if not x%i:
out.add(i)
x //= i
else:
i += 2
if x != 1:
out.... | Traceback (most recent call last):
File "/tmp/tmpqtk0gqw8/tmp_tiiq2bb.py", line 40, in <module>
main()
File "/tmp/tmpqtk0gqw8/tmp_tiiq2bb.py", line 24, in main
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s785688785 | p02574 | u457901067 | 1598731175 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2211 | 228768 | 911 | def fast_prime_factorization_many(lst):
# 素因数分解(ロー法、複数)
from subprocess import Popen, PIPE
res = Popen(["factor"] + list(map(str, lst)), stdout=PIPE).communicate()[0].split(b"\n")[:-1]
return [set(list(map(int, r.split()[1:]))) for r in res]
def main():
import sys
input = sys.stdin.readline
... | Traceback (most recent call last):
File "/tmp/tmp54nw7u3r/tmp_pq09e7t.py", line 34, in <module>
main()
File "/tmp/tmp54nw7u3r/tmp_pq09e7t.py", line 10, in main
N = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s456914219 | p02574 | u587370992 | 1598731162 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2298 | 3297204 | 446 | import math
N = int(input())
A = list(map(int, input().split()))
def gcd_n(xs):
if len(xs) == 1:
return xs[0]
return math.gcd(xs[0], gcd_n(xs[1:]))
if gcd_n(A) != 1:
print("not coprime")
exit()
for i in range(2, 10**3):
cnt = 0
for j in range(N):
if A[j] % i == 0:
... | Traceback (most recent call last):
File "/tmp/tmpzkigls5i/tmpn7lnvrj1.py", line 3, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s869476835 | p02574 | u192154323 | 1598731138 | Python | Python (3.8.2) | py | Runtime Error | 1604 | 126904 | 1120 | def make_divisors(n):
divisors = []
# 試し割りで、かつ積でnを作るときの相方も同時に追加してる
for i in range(1, int(n**0.5)+1):
if n % i == 0:
divisors.append(i)
if i != n // i:
divisors.append(n//i)
divisors.sort()
return divisors
from math import gcd
import sys
n = int(input(... | Traceback (most recent call last):
File "/tmp/tmp3x4lm0hc/tmpbjna6c3u.py", line 14, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s920110796 | p02574 | u576335153 | 1598731137 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 133000 | 491 | import math
from functools import reduce
def gcd_list(numbers):
return reduce(math.gcd, numbers)
n = int(input())
a = list(map(int, input().split()))
flg = True
for i in range(n-1):
for j in range(i+1, n):
if math.gcd(a[i], a[j]) != 1:
if i != 0:
a = a[i-1:]
fl... | Traceback (most recent call last):
File "/tmp/tmp9qrt0l8n/tmpauoisq3x.py", line 7, 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.