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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s711996225 | p02573 | u301893320 | 1598729686 | Python | PyPy3 (7.3.0) | py | Runtime Error | 171 | 68556 | 1403 | import numpy as np
class UnionFind():
def __init__(self, n):
self.n = n
self.parents = [-1] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.parents[x]
def union(self,... | Traceback (most recent call last):
File "/tmp/tmpgt0mru4g/tmpowpay52x.py", line 50, in <module>
n,m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s141469617 | p02573 | u501278784 | 1598729651 | Python | Python (3.8.2) | py | Runtime Error | 1000 | 87660 | 499 | import collections
def connected(adj,v,visited,f):
visited[v]=True
f.append(v)
for i in adj[v]:
if not visited[i]:
connected(adj,i,visited,f)
adj=collections.defaultdict(set)
n,m=map(int,input().split())
for i in range(m):
u,v=map(int,input().split())
adj[u-1].add(v-1)
... | Traceback (most recent call last):
File "/tmp/tmpdw4bwla_/tmpdc_q7pt9.py", line 9, in <module>
n,m=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s411103289 | p02573 | u592944963 | 1598729651 | Python | PyPy3 (7.3.0) | py | Runtime Error | 512 | 165396 | 420 | N, M = map(int, input().split())
A, B = list(zip(*[list(map(int, input().split())) for _ in range(M)]))
G = []
m = {}
for a, b in zip(A, B):
if a not in m and b not in m:
G.append({a, b})
m[a] = len(G) - 1
m[b] = len(G) - 1
elif a in m:
gid = m[a]
G[gid].add(b)
elif ... | Traceback (most recent call last):
File "/tmp/tmpz7hskq_t/tmp99dl220e.py", line 1, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s968943527 | p02573 | u941438707 | 1598729648 | Python | Python (3.8.2) | py | Runtime Error | 2208 | 67268 | 180 | (n,m),*e=[[*map(int,i.split())]for i in open(0)]
d=[[]for i in range(n+1)]
for i,j in e:
d[i]+=[j]
d[j]+=[i]
print(max(len(set(d[i]+d[j]))for i in range(n+1)for j in d[i])) | Traceback (most recent call last):
File "/tmp/tmpm0jlk3dx/tmptemh2gvq.py", line 1, in <module>
(n,m),*e=[[*map(int,i.split())]for i in open(0)]
^^^^^^^^
ValueError: not enough values to unpack (expected at least 1, got 0)
| |
s102410997 | p02573 | u460229551 | 1598729635 | Python | Python (3.8.2) | py | Runtime Error | 2210 | 167920 | 860 | n,m=list(map(int,input().split(" ")))
group=[]
idx=[-1]*n
for i in range(m):
a,b=list(map(int,input().split(" ")))
a-=1
b-=1
if idx[a]!=-1 or idx[b]!=-1:
if (idx[a]!=-1 and idx[b]!=-1) and idx[a]!=idx[b]:
new_group=group[idx[a]]+group[idx[b]]
length=len(group)
... | Traceback (most recent call last):
File "/tmp/tmpvapflxpx/tmp_h5lndcl.py", line 1, in <module>
n,m=list(map(int,input().split(" ")))
^^^^^^^
EOFError: EOF when reading a line
| |
s664181903 | p02573 | u912862653 | 1598729623 | Python | PyPy3 (7.3.0) | py | Runtime Error | 617 | 140768 | 949 | from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
input = sys.stdin.readline
INF = float("inf")
def dfs(G, visited, v, cnt):
visited[v] = True
cnt += 1
for nv in G[v]:
if visited[nv]:
continue
cnt = dfs(G, visited, nv,... | Traceback (most recent call last):
File "/tmp/tmpnz1oss61/tmp6zcl4a3q.py", line 2, in <module>
from fractions import gcd
ImportError: cannot import name 'gcd' from 'fractions' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/fractions.py)
| |
s556491485 | p02573 | u732963817 | 1598729607 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 43684 | 245 | import collections
N, M = map(int, input().split())
data = set()
for _ in range(M):
a, b = map(int, input().split())
data.add((min([a, b]), max([a, b])))
c = collections.Counter(sum(map(list, data), []))
print(c.most_common(1)[0][1] + 1)
| Traceback (most recent call last):
File "/tmp/tmp1yhkuieq/tmpwrvm59cc.py", line 3, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s517182708 | p02573 | u592944963 | 1598729597 | Python | Python (3.8.2) | py | Runtime Error | 822 | 67908 | 420 | N, M = map(int, input().split())
A, B = list(zip(*[list(map(int, input().split())) for _ in range(M)]))
G = []
m = {}
for a, b in zip(A, B):
if a not in m and b not in m:
G.append({a, b})
m[a] = len(G) - 1
m[b] = len(G) - 1
elif a in m:
gid = m[a]
G[gid].add(b)
elif ... | Traceback (most recent call last):
File "/tmp/tmpzo8idlka/tmp7sty1quq.py", line 1, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s473167679 | p02573 | u926412290 | 1598729597 | Python | Python (3.8.2) | py | Runtime Error | 770 | 44624 | 620 | N, M = map(int, input().split())
to = [[] for _ in range(N)]
count = 0
for _ in range(M):
A, B = map(lambda x:int(x) - 1, input().split())
to[A].append(B)
to[B].append(A)
def dfs(v, to, seen):
global count
seen[v] = True
count += 1
for nv in to[v]:
if seen[nv] == True:
... | Traceback (most recent call last):
File "/tmp/tmp6b59czwd/tmpxlhoi55l.py", line 1, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s148635081 | p02573 | u496407619 | 1598729579 | Python | Python (3.8.2) | py | Runtime Error | 774 | 84436 | 996 | import sys
from collections import Counter
input = lambda : sys.stdin.readline().rstrip()
def main(pairs, n, m):
graph = {}
for node in range(1, n+1):
graph[node] = []
for a, b in pairs:
graph[a].append(b)
graph[b].append(a)
gids = [None] * (n+1)
def get_gid(in_i, cur_g... | Traceback (most recent call last):
File "/tmp/tmpodnf8cbw/tmp4_lonlef.py", line 35, in <module>
n, m = map(int, input().split(" "))
^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s526149925 | p02573 | u951480280 | 1598729557 | Python | Python (3.8.2) | py | Runtime Error | 526 | 12632 | 620 | n,m=map(int,input().split())
ans=0
group = [0]*n
group_num = 1
for i in range(m):
a,b=map(int,input().split())
a-=1
b-=1
a1 = group[a]
b1 = group[b]
if a1 == 0 and b1 == 0:
group[a] = group_num
group[b] = group_num
group_num += 1
elif a1 != 0:
group[b] = a... | Traceback (most recent call last):
File "/tmp/tmpp8jd5wmh/tmpcfjs7oaz.py", line 1, in <module>
n,m=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s727881652 | p02573 | u026788530 | 1598729549 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9028 | 492 | n, m = [int(_) for _ in input().split()]
ab = [[int(_)-1 for _ in input().split()]for i in range(m)]
for i in range(m):
if ab[i][0] > ab[i][1]:
ab[i][0], ab[i][1] = ab[i][1], ab[i][0]
ab.sort(key=lambda x: (x[1], x[0]))
t = [-1 for i in range(n)]
ans = [0 for i in range(n)]
for i in range(m):
a, b =... | File "/tmp/tmpuaaygalb/tmph2oh0jzr.py", line 24
print(max(ans)+1)
IndentationError: expected an indented block after 'else' statement on line 21
| |
s183977275 | p02573 | u990726146 | 1598729541 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 44704 | 389 | N, M = map(int, input().split())
to = [[] for i in range(N)]
for i in range(M):
A, B = map(int, input().split())
to[A-1].append(B-1)
to[B-1].append(A-1)
ans = 0
def DFS(n):
global h, ans
#print(h)
if h[n] == 1:
ans = max(ans, sum(h))
return
h[n] = 1
for x in to[n]:
... | Traceback (most recent call last):
File "/tmp/tmp5866vdf7/tmpbqeanmzy.py", line 1, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s680014783 | p02573 | u513434790 | 1598729478 | Python | PyPy3 (7.3.0) | py | Runtime Error | 552 | 86724 | 555 | N, M = map(int, input().split())
UF = [-1] * (N+1)
def find(x):
global UF
if UF[x] == -1:
return x
else:
UF[x] = find(UF[x])
return UF[x]
def union(x,y):
global UF
xx = find(x)
yy = find(y)
if UF[x] == UF[y] == -1:
UF[y] = xx
return
elif xx == yy:
... | Traceback (most recent call last):
File "/tmp/tmp11uy1lsh/tmp6mqebhdt.py", line 1, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s927393426 | p02573 | u915716225 | 1598729379 | Python | PyPy2 (7.3.0) | py | Runtime Error | 87 | 63748 | 3640 | #include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
// DEEP
using namespace std;
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define all(v) v.begin(),v.end()
#define pb push_back
#define endl '\n'
#define mp make_pair
typedef long lon... | File "/tmp/tmpw3334p0b/tmprcl2kx_8.py", line 2
//#include <ext/pb_ds/assoc_container.hpp>
^^
SyntaxError: invalid syntax
| |
s776711525 | p02573 | u221264296 | 1598729373 | Python | Python (3.8.2) | py | Runtime Error | 877 | 72416 | 370 | def dfs(s):
ret = 1
vis[s] = True
for v in adj[s]:
if not vis[v]:
ret+=dfs(v)
return ret
n,m = map(int,input().split())
adj = [set() for i in range(n)]
for _ in range(m):
u,v = map(int,input().split())
u-=1
v-=1
adj[u].add(v)
adj[v].add(u)
vis = [False] * n
ans = 0
for i in range(n):
if not vis[i]:
... | Traceback (most recent call last):
File "/tmp/tmpac9jzmlq/tmp3uebkbqp.py", line 9, in <module>
n,m = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s443333967 | p02573 | u814986259 | 1598729368 | Python | Python (3.8.2) | py | Runtime Error | 1185 | 25848 | 1073 | import collections
class unionFind:
parent = []
count = []
def __init__(self, N):
self.parent = [i for i in range(N)]
self.count = [1]*N
def root(self, x):
if self.parent[x] == x:
return(x)
else:
self.parent[x] = self.root(self.parent[x])
... | Traceback (most recent call last):
File "/tmp/tmp0i67x1cr/tmpzisyv4e5.py", line 41, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s808197578 | p02573 | u528181687 | 1598729295 | Python | Python (3.8.2) | py | Runtime Error | 395 | 18576 | 679 | def main():
n,m = [int(v) for v in input().split()]
groups = []
g = [-1]*(n+1)
for _ in range(m):
a,b = [int(v) for v in input().split()]
if g[a]!=-1 and g[b]!=-1:
if g[a]==g[b]: continue
gb = g[b]
for no in groups[gb]:
g[no] = g[a]
... | Traceback (most recent call last):
File "/tmp/tmppcau7nzm/tmpc66lx92y.py", line 26, in <module>
main()
File "/tmp/tmppcau7nzm/tmpc66lx92y.py", line 2, in main
n,m = [int(v) for v in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s648381250 | p02573 | u665369939 | 1598729290 | Python | Python (3.8.2) | py | Runtime Error | 558 | 26324 | 476 | n,m = map(int,input().split())
l = [-1 for i in range (n)]
L = []
for i in range (m):
a,b = map(int,input().split())
if l[a-1] == l[b-1] == -1:
L.append([a,b])
l[a-1] = l[b-1] = len(L)-1
elif l[a-1] == -1:
num = l[b-1]
L[num].append(a)
l[a-1] = num
elif l[b-1] == ... | Traceback (most recent call last):
File "/tmp/tmp5298txif/tmpudd_ch29.py", line 1, in <module>
n,m = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s698467590 | p02573 | u081193942 | 1598729270 | Python | Python (3.8.2) | py | Runtime Error | 2028 | 277988 | 238 | import networkx as nx
n, m = map(int, input().split())
pairs = [tuple(map(int, input().split())) for _ in range(m)]
graph = nx.from_edgelist(pairs)
groups = list(nx.connected_components(graph))
print(max(len(group) for group in groups)) | Traceback (most recent call last):
File "/tmp/tmp2svdj5ya/tmpdx_qkzbw.py", line 3, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s996563961 | p02573 | u374935093 | 1598729237 | Python | PyPy3 (7.3.0) | py | Runtime Error | 549 | 90432 | 474 | N,M = map(int,input().split())
ls = [0 for _ in range(N)]
flg = 1
for i in range(M):
a,b = map(int,input().split())
if ls[a-1] == 0 and ls[b-1]==0:
ls[a-1]=flg
ls[b-1]=flg
flg+=1
elif ls[a-1] == 0:
ls[a-1] = ls[b-1]
elif ls[b-1] == 0:
ls[b-1] = ls[a-1]
else:
... | Traceback (most recent call last):
File "/tmp/tmpj2c6w7u2/tmphdx4dmiv.py", line 1, in <module>
N,M = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s586621256 | p02573 | u201387466 | 1598729223 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2391 | 3518868 | 1598 | import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bise... | Traceback (most recent call last):
File "/tmp/tmpxz0yotwf/tmp573r_6yh.py", line 28, in <module>
N,M = map(int,input().split())
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s335606491 | p02573 | u667024514 | 1598729220 | Python | PyPy3 (7.3.0) | py | Runtime Error | 366 | 101300 | 452 | n,m = map(int,input().split())
if m == 0:
print(1)
exit()
lis = [i+1 for i in range(n)]
li = list(set([sorted(list(map(int,input().split()))) for i in range(m)]))
li.sort(key=lambda x:x[1])
li.sort(key=lambda x:x[0])
for i in range(len(li)):
lis[li[i][1]-1] = lis[li[i][0]-1]
lis.sort()
ans = 0
cnt = 1
for i... | Traceback (most recent call last):
File "/tmp/tmp76u_kfr6/tmpr4tlhsga.py", line 1, in <module>
n,m = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s492174645 | p02573 | u519968172 | 1598729218 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2209 | 710848 | 243 | n,m=map(int,input().split())
l=[set() for _ in range(n+1)]*(n+1)
mn=0
for i in range(m):
a,b=map(int,input().split())
l[a].add(b)
l[b].add(a)
for i in range(n):
aa=l[i]
for k in l[i]:
aa=aa|l[k]
mn=max(mn,len(aa))
print(mn)
| Traceback (most recent call last):
File "/tmp/tmprtdu7f42/tmpwinocv0k.py", line 1, in <module>
n,m=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s951285721 | p02573 | u650709896 | 1598729216 | Python | PyPy3 (7.3.0) | py | Runtime Error | 637 | 127260 | 582 | def find_par(x,p):
if x == p[x] :
return x
p[x] = find_par(p[x],p)
return p[x]
def union(x,y,p,size):
xp = find_par(x,p)
yp= find_par(y,p)
if xp != yp:
p[yp] = xp
size[xp] += size[yp]
n,m=[int(c) for c in input().split()]
p=[i for i in range(n+1)]
size =[1 f... | Traceback (most recent call last):
File "/tmp/tmpjcumzf33/tmpvijf685p.py", line 18, in <module>
n,m=[int(c) for c in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s352212859 | p02573 | u769694158 | 1598729176 | Python | PyPy3 (7.3.0) | py | Runtime Error | 704 | 149172 | 508 | from collections import defaultdict
# your code goes here
v=defaultdict(list)
n,m=map(int,input().split())
for i in range(m):
a,b=map(int,input().split())
v[a-1].append(b-1)
v[b-1].append(a-1)
vis=[0]*n
def dfs(node):
vis[node]=1
for j in v[node]:
#print(j,v[node])
... | Traceback (most recent call last):
File "/tmp/tmpzmub6v4n/tmp_j2o9hna.py", line 6, in <module>
n,m=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s533195565 | p02573 | u295585689 | 1598729172 | Python | Python (3.8.2) | py | Runtime Error | 47 | 9184 | 413 | N,M = [int(i) for i in input().split()]
groups = []
for i in range(M):
a,b = [int(i) for i in input().split()]
flag = True
for j,g in enumerate(groups):
if a in g or b in g:
groups[j] = np.unique(np.append(g,[a,b]))
flag = False
if flag:
groups.append([a,b])
... | Traceback (most recent call last):
File "/tmp/tmp1aa5skyg/tmppbnc8ipe.py", line 1, in <module>
N,M = [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s026399591 | p02573 | u819345214 | 1598729159 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 9780 | 466 | N, M = map(int, input().split())
m = 2
A, B = map(int, input().split())
s = [[A, B]]
for i in range(M - 1):
A, B = map(int, input().split())
flag = False
for sins in s:
if A in sins and not B in sins:
sins.append(B)
flag = True
if B in sins and not A in sins:
... | Traceback (most recent call last):
File "/tmp/tmp9p6v6go0/tmp_4kywy5s.py", line 1, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s419546192 | p02573 | u920463220 | 1598729117 | Python | Python (3.8.2) | py | Runtime Error | 542 | 54324 | 508 | from sys import stdin,stdout
from collections import defaultdict
# n=int(stdin.readline())
def dfs(src):
global sz
vis[src]=1
sz+=1
for neigh in g[src]:
if not vis[neigh]:
dfs(neigh)
n,eg=list(map(int,stdin.readline().split()))
g=defaultdict(list)
for i in range(eg):
A,B=map(int... | Traceback (most recent call last):
File "/tmp/tmpe675bq15/tmp523thl0z.py", line 12, in <module>
n,eg=list(map(int,stdin.readline().split()))
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s882349623 | p02573 | u995163736 | 1598729106 | Python | PyPy3 (7.3.0) | py | Runtime Error | 92 | 68764 | 186 | n = int(input())
a = tuple(map(int,input().split()))
mod = 10**9 + 7
at = tuple([a[i] % mod for i in range(n)])
ans = 0
for i in range(n):
ans += sum(at[i+1:])*at[i]
print(ans % mod) | Traceback (most recent call last):
File "/tmp/tmpu6nfhebx/tmpkg0m1uqz.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s143003214 | p02573 | u513434790 | 1598729094 | Python | Python (3.8.2) | py | Runtime Error | 744 | 15552 | 588 | N, M = map(int, input().split())
UF = [-1] * (N+1)
def find(x):
global UF
if UF[x] == -1:
return x
else:
UF[x] = find(UF[x])
return UF[x]
def union(x,y):
global UF
xx = find(x)
yy = find(y)
if UF[x] == UF[y] == -1:
UF[y] = xx
return
elif xx == yy:
... | Traceback (most recent call last):
File "/tmp/tmp9au_zcc7/tmp872a8k5i.py", line 1, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s575947528 | p02573 | u496407619 | 1598729076 | Python | PyPy2 (7.3.0) | py | Runtime Error | 489 | 165500 | 679 | import sys
from collections import Counter
input = lambda : sys.stdin.readline().rstrip()
n, m = map(int, input().split(" "))
pairs = set([tuple(sorted(map(int, input().split(" ")))) for i in range(m)])
graph = {}
for node in range(1, n+1):
graph[node] = []
for a, b in pairs:
graph[a].append(b)
graph[b]... | Traceback (most recent call last):
File "/tmp/tmpnwcfm1v1/tmpmohf3ayw.py", line 6, in <module>
n, m = map(int, input().split(" "))
^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s749609281 | p02573 | u304102443 | 1598729064 | Python | PyPy3 (7.3.0) | py | Runtime Error | 712 | 343900 | 2805 | import os
import heapq
import sys,threading
import math
import operator
from collections import defaultdict
from io import BytesIO, IOBase
sys.setrecursionlimit(10 ** 5)
threading.stack_size(2**27)
def gcd(a, b):
if b == 0:
return a
else:
return gcd(b, a % b)
"""def pw(a,b):
result=1
... | Traceback (most recent call last):
File "/tmp/tmpwsgcssri/tmp15w8eq_y.py", line 121, in <module>
main()
File "/tmp/tmpwsgcssri/tmp15w8eq_y.py", line 44, in main
n,m=inpt()
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s790705209 | p02573 | u912862653 | 1598729062 | Python | PyPy3 (7.3.0) | py | Runtime Error | 556 | 130164 | 784 | from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
input = sys.stdin.readline
INF = float("inf")
def dfs(G, visited, v, cnt):
visited[v] = True
cnt += 1
for nv in G[v]:
if visited[nv]:
continue
cnt = dfs(G, visited, nv,... | Traceback (most recent call last):
File "/tmp/tmphwtycjd5/tmpo960194s.py", line 2, in <module>
from fractions import gcd
ImportError: cannot import name 'gcd' from 'fractions' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/fractions.py)
| |
s793592246 | p02573 | u626468554 | 1598729040 | Python | PyPy3 (7.3.0) | py | Runtime Error | 544 | 195604 | 713 | N,M = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(M)]
#xの木の根を求める
def root(x,li):
if li[x] == x:
return x
else:
li[x] = root(li[x],li)
return li[x]
#xとyが同じ集合に属するかの判定
def find(x,y,li):
return root(x,li) == root(y,li)
#xとyを併合
def union(x,y,li):
... | Traceback (most recent call last):
File "/tmp/tmplew6aoeh/tmp8rozp_92.py", line 1, in <module>
N,M = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s682924502 | p02573 | u693666240 | 1598729028 | Python | PyPy3 (7.3.0) | py | Runtime Error | 633 | 162080 | 696 | mod = 10**9 + 7
def go(v):
global tmp
tmp += 1
used[v] = True
for i in range(len(g[v])):
if not used[g[v][i]]:
go(g[v][i])
def solve():
n, m = map(int, input().split())
global g, used, tmp
tmp = 0
g = [[] for i in range(n + 1)]
ans = 0
d = {}
used = [False... | Traceback (most recent call last):
File "/tmp/tmp69asqwao/tmp4qam6b9r.py", line 31, in <module>
solve()
File "/tmp/tmp69asqwao/tmp4qam6b9r.py", line 10, in solve
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s934501686 | p02573 | u814986259 | 1598729017 | Python | Python (3.8.2) | py | Runtime Error | 842 | 17936 | 845 | import collections
class unionFind:
parent = []
def __init__(self, N):
self.parent = [i for i in range(N)]
def root(self, x):
if self.parent[x] == x:
return(x)
else:
self.parent[x] = self.root(self.parent[x])
return(self.parent[x])
def sam... | Traceback (most recent call last):
File "/tmp/tmpyqlsuifr/tmpq4ogvol8.py", line 32, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s524337153 | p02573 | u908391630 | 1598728964 | Python | PyPy3 (7.3.0) | py | Runtime Error | 381 | 161732 | 1184 | 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/tmpl7sz2tr7/tmpmwxb3x8t.py", line 63, in <module>
res = solve()
^^^^^^^
File "/tmp/tmpl7sz2tr7/tmpmwxb3x8t.py", line 31, in solve
[N, M] = inlt()
^^^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s901318949 | p02573 | u693666240 | 1598728927 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2208 | 127796 | 657 | mod = 10**9 + 7
def go(v):
global tmp
tmp += 1
used[v] = True
for i in range(len(g[v])):
if not used[g[v][i]]:
go(g[v][i])
def solve():
n, m = map(int, input().split())
global g, used, tmp
tmp = 0
g = [[] for i in range(n + 1)]
ans = 0
used = [False for i in r... | Traceback (most recent call last):
File "/tmp/tmp8dtqm_e8/tmp89o5gxam.py", line 29, in <module>
solve()
File "/tmp/tmp8dtqm_e8/tmp89o5gxam.py", line 10, in solve
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s123008981 | p02573 | u814986259 | 1598728918 | Python | Python (3.8.2) | py | Runtime Error | 855 | 43076 | 844 | import collections
class unionFind:
parent = []
def __init__(self, N):
self.parent = [i for i in range(N)]
def root(self, x):
if self.parent[x] == x:
return(x)
else:
self.parent[x] = self.root(self.parent[x])
return(self.parent[x])
def sam... | Traceback (most recent call last):
File "/tmp/tmpdx3oakpl/tmpa58d93dz.py", line 32, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s079685143 | p02573 | u626468554 | 1598728899 | Python | PyPy3 (7.3.0) | py | Runtime Error | 616 | 195688 | 707 | N,M = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(M)]
#xの木の根を求める
def root(x,li):
if li[x] == x:
return x
else:
li[x] = root(li[x],li)
return li[x]
#xとyが同じ集合に属するかの判定
def find(x,y,li):
return root(x,li) == root(y,li)
#xとyを併合
def union(x,y,li):
... | Traceback (most recent call last):
File "/tmp/tmpa03dywa0/tmp_a2bphcv.py", line 1, in <module>
N,M = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s975331631 | p02573 | u665369939 | 1598728886 | Python | Python (3.8.2) | py | Runtime Error | 562 | 25684 | 417 | n,m = map(int,input().split())
l = [-1 for i in range (n)]
L = []
for i in range (m):
a,b = map(int,input().split())
if l[a-1] == l[b-1] == -1:
L.append([a,b])
l[a-1] = l[b-1] = len(L)-1
elif l[a-1] == -1:
num = l[b-1]
L[num].append(a)
l[a-1] = num
elif l[b-1] == ... | Traceback (most recent call last):
File "/tmp/tmpfbwaowdt/tmp1_xgkry_.py", line 1, in <module>
n,m = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s704134533 | p02573 | u693666240 | 1598728879 | Python | PyPy3 (7.3.0) | py | Runtime Error | 140 | 97664 | 654 | mod = 10**9 + 7
def go(v):
global tmp
tmp += 1
used[v] = True
for i in range(len(g[v])):
if not used[g[v][i]]:
go(g[v][i])
def solve():
n, m = map(int, input().split())
global g, used, tmp
tmp = 0
g = [[] for i in range(n + 1)]
ans = 0
used = [False for i in r... | Traceback (most recent call last):
File "/tmp/tmpsnca118a/tmplzrqjyiu.py", line 29, in <module>
solve()
File "/tmp/tmpsnca118a/tmplzrqjyiu.py", line 10, in solve
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s480996449 | p02573 | u888804711 | 1598728870 | Python | Python (3.8.2) | py | Runtime Error | 1026 | 102224 | 663 | import sys
sys.setrecursionlimit(100000)
class UF:
def __init__(self, n):
self.parent = list(range(n))
def find(self,n):
if self.parent[n] == n :
return n
self.parent[n] = self.find(self.parent[n])
return self.parent[n]
def union(self, i,j ):
self.paren... | Traceback (most recent call last):
File "/tmp/tmpcdo8c1hw/tmpepbq3_pw.py", line 17, in <module>
N, M = map(int, input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s518747186 | p02573 | u843135954 | 1598728855 | Python | PyPy3 (7.3.0) | py | Runtime Error | 172 | 72808 | 670 | import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()
N = 10**5
*p, = range(N)
size = [1]*N
def root(x):
if x == p[x]:
return x
p[x] = y =... | Traceback (most recent call last):
File "/tmp/tmplb0qpylq/tmpt6mgoie8.py", line 31, in <module>
n,m = na()
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s272831330 | p02573 | u888804711 | 1598728801 | Python | Python (3.8.2) | py | Runtime Error | 996 | 68104 | 662 | import sys
sys.setrecursionlimit(60000)
class UF:
def __init__(self, n):
self.parent = list(range(n))
def find(self,n):
if self.parent[n] == n :
return n
self.parent[n] = self.find(self.parent[n])
return self.parent[n]
def union(self, i,j ):
self.parent... | Traceback (most recent call last):
File "/tmp/tmplg4q1saf/tmpenbulhd2.py", line 17, in <module>
N, M = map(int, input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s559284900 | p02573 | u264349861 | 1598728784 | Python | PyPy3 (7.3.0) | py | Runtime Error | 470 | 70604 | 719 | #dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys;input = sys.stdin.readline
inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]
import resource,sys
resource.setrlimit(resource.RLIMIT_STACK,(2**29,-1))
sys.setrecursionlimit(10**6)
def dfs(u):
global graph,vis
vis.add(u)
for i in gr... | Traceback (most recent call last):
File "/tmp/tmpp00ms_7s/tmpboyi27ks.py", line 16, in <module>
n,m = ip()
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s056311613 | p02573 | u814986259 | 1598728782 | Python | Python (3.8.2) | py | Runtime Error | 838 | 42980 | 835 | import collections
class unionFind:
parent = []
def __init__(self, N):
self.parent = [i for i in range(N)]
def root(self, x):
if self.parent[x] == x:
return(x)
else:
self.parent[x] = self.root(self.parent[x])
return(self.parent[x])
def sam... | Traceback (most recent call last):
File "/tmp/tmpc7cku0xo/tmpf8i_t0q3.py", line 32, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s207648895 | p02573 | u657173608 | 1598728768 | Python | Python (3.8.2) | py | Runtime Error | 689 | 45408 | 1641 | from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math
from itertools import accumulate
def get_int():return int(stdin.readline().strip())
def get_tuple():return map(int, stdin.readline().split())
def get_list():return li... | Traceback (most recent call last):
File "/tmp/tmpbefcamqk/tmphq5ifntp.py", line 57, in <module>
n,m = get_tuple()
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s467350437 | p02573 | u693666240 | 1598728749 | Python | PyPy3 (7.3.0) | py | Runtime Error | 554 | 139524 | 623 | mod = 10**9 + 7
def go(v):
global tmp
tmp += 1
used[v] = True
for i in range(len(g[v])):
if not used[g[v][i]]:
go(g[v][i])
def solve():
n, m = map(int, input().split())
global g, used, tmp
tmp = 0
g = [[] for i in range(n + 1)]
ans = 0
used = [False for i in r... | Traceback (most recent call last):
File "/tmp/tmp6t7e6e6u/tmp_5oetm41.py", line 28, in <module>
solve()
File "/tmp/tmp6t7e6e6u/tmp_5oetm41.py", line 10, in solve
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s201894211 | p02573 | u341175126 | 1598728733 | Python | PyPy3 (7.3.0) | py | Runtime Error | 412 | 127408 | 2865 | import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in file.mode or "r" not in file.mode
self.write = self.buffer.write if self.writa... | Traceback (most recent call last):
File "/tmp/tmpq8tsfwq4/tmp62rb1sb8.py", line 65, in <module>
n,m = Ri()
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s322637029 | p02573 | u888804711 | 1598728725 | Python | Python (3.8.2) | py | Runtime Error | 1037 | 37896 | 620 | class UF:
def __init__(self, n):
self.parent = list(range(n))
def find(self,n):
if self.parent[n] == n :
return n
self.parent[n] = self.find(self.parent[n])
return self.parent[n]
def union(self, i,j ):
self.parent[self.find(i)] = self.find(j)
N, M = map... | Traceback (most recent call last):
File "/tmp/tmpozf9cgof/tmphkq0ulso.py", line 14, in <module>
N, M = map(int, input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s285295483 | p02573 | u591589288 | 1598728724 | Python | PyPy3 (7.3.0) | py | Runtime Error | 439 | 162508 | 973 | from collections import Counter
import sys
def _ia(): return map(int, sys.stdin.readline().strip().split())
class UnionFind:
def __init__(self, n: int) -> None:
self._par = [i for i in range(n)]
self._rank = [0] * n
def root(self, n: int) -> int:
p = self._par[n]
if p == n:
... | Traceback (most recent call last):
File "/tmp/tmpzwzxba2j/tmpicx45fh4.py", line 44, in <module>
print(main())
^^^^^^
File "/tmp/tmpzwzxba2j/tmpicx45fh4.py", line 34, in main
n, m = _ia()
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s070771136 | p02573 | u843135954 | 1598728679 | Python | PyPy3 (7.3.0) | py | Runtime Error | 1029 | 180628 | 1655 | import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()
import collections
import itertools
import operator
class UnionFind:
def __init__(self, elems=None... | Traceback (most recent call last):
File "/tmp/tmpgtvwhn_s/tmp6vkit_o0.py", line 62, in <module>
n,m = na()
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s232047385 | p02573 | u495667483 | 1598728562 | Python | Python (3.8.2) | py | Runtime Error | 933 | 63208 | 1403 | import sys, math
from functools import lru_cache
sys.setrecursionlimit(10**9)
MOD = 10**9+7
def input():
return sys.stdin.readline()[:-1]
def mi():
return map(int, input().split())
def ii():
return int(input())
def i2(n):
tmp = [list(mi()) for i in range(n)]
return [list(i) for i in zip(*tmp)]
... | Traceback (most recent call last):
File "/tmp/tmpse9msoyc/tmpre0hgx88.py", line 72, in <module>
main()
File "/tmp/tmpse9msoyc/tmpre0hgx88.py", line 57, in main
N, M = mi()
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s146857363 | p02573 | u644972721 | 1598728556 | Python | PyPy3 (7.3.0) | py | Runtime Error | 760 | 113648 | 863 | def get_root(s):
if s != root[s]:
root[s] = get_root(root[s])
return root[s]
return s
def unite(s, t):
root_s = get_root(s)
root_t = get_root(t)
if not root_s == root_t:
if rank[s] == rank[t]:
root[root_t] = root_s
rank[root_s] += 1
elif rank[... | Traceback (most recent call last):
File "/tmp/tmplva7tf64/tmpb3a_s4aj.py", line 25, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s539376451 | p02573 | u657173608 | 1598728552 | Python | Python (3.8.2) | py | Runtime Error | 522 | 45724 | 1679 | from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math
from itertools import accumulate
def get_int():return int(stdin.readline().strip())
def get_tuple():return map(int, stdin.readline().split())
def get_list():return li... | Traceback (most recent call last):
File "/tmp/tmp25wjfn5l/tmpvbm3g7sf.py", line 60, in <module>
n,m = get_tuple()
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s028012240 | p02573 | u888804711 | 1598728500 | Python | Python (3.8.2) | py | Runtime Error | 875 | 40376 | 578 | class UF:
def __init__(self, n):
self.parent = list(range(n))
def find(self,n):
if self.parent[n] == n :
return n
self.parent[n] = self.find(self.parent[n])
return self.parent[n]
def union(self, i,j ):
self.parent[self.find(i)] = self.find(j)
N, M = map... | Traceback (most recent call last):
File "/tmp/tmp_cc7fd0z/tmpuobdmzne.py", line 14, in <module>
N, M = map(int, input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s546165379 | p02573 | u495667483 | 1598728485 | Python | Python (3.8.2) | py | Runtime Error | 807 | 63208 | 1357 | import sys, math
from functools import lru_cache
sys.setrecursionlimit(10**9)
MOD = 10**9+7
def input():
return sys.stdin.readline()[:-1]
def mi():
return map(int, input().split())
def ii():
return int(input())
def i2(n):
tmp = [list(mi()) for i in range(n)]
return [list(i) for i in zip(*tmp)]
... | Traceback (most recent call last):
File "/tmp/tmpo8s5upno/tmp1_aea6ix.py", line 70, in <module>
main()
File "/tmp/tmpo8s5upno/tmp1_aea6ix.py", line 57, in main
N, M = mi()
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s470358115 | p02573 | u899782392 | 1598728311 | Python | PyPy3 (7.3.0) | py | Runtime Error | 744 | 183972 | 445 | from collections import defaultdict
N, M = map(int, input().split())
edges = defaultdict(set)
for _ in range(M):
a, b = map(lambda x:int(x)-1, input().split())
edges[a].add(b)
edges[b].add(a)
ans = 0
visited = [False] * N
def dfs(i):
if visited[i]:
return 0
ans = 1
visited[i] = True
... | Traceback (most recent call last):
File "/tmp/tmpgjpv1grd/tmpt0ddy2b6.py", line 3, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s950183906 | p02573 | u814986259 | 1598728285 | Python | Python (3.8.2) | py | Runtime Error | 927 | 44880 | 851 | import collections
N, M = map(int, input().split())
AB = [tuple(map(int, input().split())) for i in range(M)]
class unionFind:
parent = []
def __init__(self, N):
self.parent = [i for i in range(N)]
def root(self, x):
if self.parent[x] == x:
return(x)
else:
... | Traceback (most recent call last):
File "/tmp/tmpqxc9a1o0/tmp5_nrwylx.py", line 2, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s800302367 | p02573 | u484902431 | 1598728062 | Python | PyPy3 (7.3.0) | py | Runtime Error | 563 | 80924 | 386 | n, m = map(int, input().split())
f = [i for i in range(n + 1)]
def getF(u):
if f[f[u]] == f[u]:
return f[u]
f[u] = getF(f[u])
return f[u]
def uniF(u, v):
u = getF(u)
v = getF(v)
if u != v:
f[u] = v
for i in range(m):
u, v = map(int, input().split())
uniF(u, v)
c = [0] * (... | Traceback (most recent call last):
File "/tmp/tmpjcslp6tz/tmps2ypk70e.py", line 1, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s833011227 | p02573 | u997641430 | 1598727877 | Python | Python (3.8.2) | py | Runtime Error | 883 | 25284 | 1029 | class UnionFind():
def __init__(self, n):
self.n = n
# 親の名(いない場合はNone)
self.parent = [None] * n
# 子の数
self.count = [0] * n
def root(self, x):
# xの根を返す
if self.parent[x] is None:
return x
else:
return self.root(self.parent[x... | Traceback (most recent call last):
File "/tmp/tmpc6q7yno5/tmpgo98zu0v.py", line 35, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s572191308 | p02574 | u240630407 | 1600733828 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8928 | 1845 | # import itertools
import math
import functools import reduce
# import sys
# sys.setrecursionlimit(500*500)
# import numpy as np
# import heapq
# from collections import deque
N = int(input())
# S = input()
# n, *a = map(int, open(0))
# N, M = map(int, input().split())
A = list(map(int, input().split()))
# B = list(ma... | File "/tmp/tmpw7ftpfy0/tmpuy7wyr0z.py", line 3
import functools import reduce
^^^^^^
SyntaxError: invalid syntax
| |
s621531436 | p02574 | u594983000 | 1600621163 | Python | Python (3.8.2) | py | Runtime Error | 2098 | 163068 | 515 | import sys
def input(): return sys.stdin.readline().rstrip()
N = int(input())
A = list(map(int, input().split()))
A_max = A[-1]
prime = [[] for _ in range(A_max + 1)]
for i in range(2,A_max + 1):
if prime[i] == []:
n = i
while n <= A_max:
prime[n].append(i)
n += i
li = [0]... | Traceback (most recent call last):
File "/tmp/tmp91mq5z3u/tmp58ksz73c.py", line 4, in <module>
N = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s855254172 | p02574 | u280978334 | 1600596594 | Python | PyPy3 (7.3.0) | py | Runtime Error | 88 | 74392 | 602 | from math import gcd
def lcm(a,b):
return a*b//gcd(a,b)
def main():
n = int(input())
A = list(map(int,input().split()))
LCM = 1
GCD = A[-1]
flag = True
for a in A[::-1]:
if gcd(LCM,a) > 1:
flag = False
break... | File "/tmp/tmpnv1xjw2t/tmpwerywv5i.py", line 1
from math import gcd
IndentationError: unexpected indent
| |
s208137815 | p02574 | u707808519 | 1600541844 | Python | Python (3.8.2) | py | Runtime Error | 642 | 134556 | 776 | import math
def eratosthenes():
erat = [0 for _ in range(max(a)+1)]
lim = int(math.sqrt(max(set_a)))
for i in range(2, lim+1):
cnt = 0
if not erat[i]:
for res in range(i, max(set_a)+1, i):
if res in set_a:
cnt += 1
erat[i] = i
... | Traceback (most recent call last):
File "/tmp/tmpxj_77sgk/tmp0cyv3pvj.py", line 21, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s510006933 | p02574 | u625729943 | 1600535938 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2215 | 390528 | 1422 | # import numpy as np
import sys, math, heapq
from functools import reduce
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial, gcd
from bisect import bisect_left, bisect_right
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
input = lambda: sy... | Traceback (most recent call last):
File "/tmp/tmpw8kxqogl/tmpo6_gtsdt.py", line 14, in <module>
N = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s092952987 | p02574 | u707808519 | 1600534562 | Python | Python (3.8.2) | py | Runtime Error | 2212 | 186592 | 592 | import math
def eratosthenes():
cnt = dict()
lim = int(math.sqrt(max(set_a)))
for i in range(2, lim+1):
for res in range(i, max(set_a)+1, i):
if res in set_a:
cnt[res] = cnt.get(res, 0) + 1
return cnt
n = int(input())
a = [int(x) for x in input().split()]
set_a = s... | Traceback (most recent call last):
File "/tmp/tmptnntqgj5/tmp_j4uf1nu.py", line 13, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s019635049 | p02574 | u779455925 | 1600511971 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2213 | 245776 | 712 | from collections import *
def gcd(a,b):
if a%b==0:return(b)
else:return(gcd(b,a%b))
def soinsuu(n):
visited=defaultdict(int)
for i in range(2,round(n**.5)+1):
while n%i==0:
n//=i
visited[i]+=1
if n>1:
visited[n]+=1
return(visited)
N=int(input())
A=list(m... | Traceback (most recent call last):
File "/tmp/tmpkfch1njq/tmp2_qlis8c.py", line 16, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s290085759 | p02574 | u779455925 | 1600511795 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2210 | 198952 | 787 | from collections import *
def gcd(a,b):
if a%b==0:return(b)
else:return(gcd(b,a%b))
def soinsuu(n):
visited=defaultdict(int)
for i in range(2,round(n**.5)+1):
while n%i==0:
n//=i
visited[i]+=1
if n>1:
visited[n]+=1
return(visited)
N=int(input())
A=list(m... | Traceback (most recent call last):
File "/tmp/tmpa45n14p6/tmpw117z8gh.py", line 16, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s709867562 | p02574 | u736729525 | 1600469213 | Python | Python (3.8.2) | py | Runtime Error | 2208 | 127680 | 1118 | #!/usr/bin/env python
from math import sqrt
from collections import Counter
def gen_primes(X):
D = [0] * (X+1)
is_prime = [True for _ in range(0, X+1)]
is_prime[0] = False
is_prime[1] = False
primes = []
for n in range(2, int(sqrt(X))+1):
if is_prime[n]:
primes.append(n)
... | Traceback (most recent call last):
File "/tmp/tmpbnluk0po/tmpss1989wx.py", line 49, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s565455334 | p02574 | u736729525 | 1600468866 | Python | Python (3.8.2) | py | Runtime Error | 1734 | 134756 | 1048 | #!/usr/bin/env python
from math import sqrt
def gen_primes(X):
D = [0] * (X+1)
is_prime = [True for _ in range(0, X+1)]
is_prime[0] = False
is_prime[1] = False
primes = []
for n in range(2, int(sqrt(X))+1):
if is_prime[n]:
primes.append(n)
j = n*2
D[n... | Traceback (most recent call last):
File "/tmp/tmpml4roces/tmpgoel94ze.py", line 46, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s797104568 | p02574 | u736729525 | 1600468788 | Python | Python (3.8.2) | py | Runtime Error | 1824 | 134636 | 1049 | #!/usr/bin/env python
from math import sqrt
def gen_primes(X):
D = [0] * (X+1)
is_prime = [True for _ in range(0, X+1)]
is_prime[0] = False
is_prime[1] = False
primes = []
for n in range(2, int(sqrt(X))+1):
if is_prime[n]:
primes.append(n)
j = n*2
D[n... | Traceback (most recent call last):
File "/tmp/tmprbs32rl6/tmpm95p143o.py", line 46, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s021376709 | p02574 | u427427681 | 1600467060 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 127424 | 1419 | def gcd(a, b):
# c += 1
# if c > 100:
# return 100;
# print(c, a, b)
if a < b:
a, b = b, a
if b == 0:
return a;
return gcd(b, a - b)
# test1 = gcd(40, 20, 1)
# test2 = gcd(60, 40, 1)
# test3 = gcd(50, 3, 1)
# print(test1, test2, test3)
def f(n, ais):
common_divisor... | Traceback (most recent call last):
File "/tmp/tmp1yf0kt94/tmpjyffdpmp.py", line 58, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s816185967 | p02574 | u427427681 | 1600466437 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 127544 | 1155 | def gcd(a, b):
# c += 1
# if c > 100:
# return 100;
# print(c, a, b)
if a < b:
a, b = b, a
if b == 0:
return a;
return gcd(b, a - b)
# test1 = gcd(40, 20, 1)
# test2 = gcd(60, 40, 1)
# test3 = gcd(50, 3, 1)
# print(test1, test2, test3)
def f(n, ais):
common_divisor... | Traceback (most recent call last):
File "/tmp/tmpxn653x_l/tmpak6o1ts6.py", line 47, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s434748628 | p02574 | u347502437 | 1600419054 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9036 | 1142 | from math import sqrt
from math import ceil
def mpfli(N): #minimum prime factor listのこと
li = [i for i in range(N+1)]
li2 = [i for i in range(N+1)]
for i in range(2,ceil(sqrt(N+1))):
for j in range(2*i, N + 1):
if li[j]== li2[j]:
if li[j] % li[i] == 0:
... | Traceback (most recent call last):
File "/tmp/tmp05l41asr/tmpzvhgmgxz.py", line 54, in <module>
main()
File "/tmp/tmp05l41asr/tmpzvhgmgxz.py", line 43, in main
N = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s764238595 | p02574 | u628285938 | 1600406544 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8860 | 1293 |
@author: liang
"""
"""
コーナーケース1:
重複があるとき not coprime(※これが誤り)
ただし、1の重複は除く
コーナーケース:
重複があるとき pairwise coprime ではない
setwise coprimeの可能性はある
ただし、1の重複は
"""
import math
C = 10**6
#T = int(math.sqrt(C)*10**3)+1
N = int(input())
judge = [0]+[False]*C
A =list()
f = True
for a in input().split():
if judg... | File "/tmp/tmp5nmhtk4o/tmpkgsuw9rt.py", line 7
重複があるとき not coprime(※これが誤り)
^
SyntaxError: invalid non-printable character U+3000
| |
s297629373 | p02574 | u412863850 | 1600384065 | Python | PyPy3 (7.3.0) | py | Runtime Error | 874 | 222864 | 1761 | import sys
import re
import queue
import collections
import math
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
fro... | Traceback (most recent call last):
File "/tmp/tmpfs3yo04s/tmp88hceim3.py", line 80, in <module>
main()
File "/tmp/tmpfs3yo04s/tmp88hceim3.py", line 37, in main
N = i_input()
^^^^^^^^^
File "/tmp/tmpfs3yo04s/tmp88hceim3.py", line 15, in i_input
def i_input(): return int(input())
... | |
s641571803 | p02574 | u412863850 | 1600383870 | Python | Python (3.8.2) | py | Runtime Error | 2209 | 128700 | 1799 | import sys
import re
import queue
import collections
import math
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
fro... | Traceback (most recent call last):
File "/tmp/tmpryrhk5_1/tmpp_ud_kcp.py", line 86, in <module>
main()
File "/tmp/tmpryrhk5_1/tmpp_ud_kcp.py", line 43, in main
N = i_input()
^^^^^^^^^
File "/tmp/tmpryrhk5_1/tmpp_ud_kcp.py", line 15, in i_input
def i_input(): return int(input())
... | |
s390281764 | p02574 | u412863850 | 1600383804 | Python | PyPy3 (7.3.0) | py | Runtime Error | 864 | 222452 | 1799 | import sys
import re
import queue
import collections
import math
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
fro... | Traceback (most recent call last):
File "/tmp/tmpyqfhyoi6/tmp9_ygudbo.py", line 86, in <module>
main()
File "/tmp/tmpyqfhyoi6/tmp9_ygudbo.py", line 43, in main
N = i_input()
^^^^^^^^^
File "/tmp/tmpyqfhyoi6/tmp9_ygudbo.py", line 15, in i_input
def i_input(): return int(input())
... | |
s430842092 | p02574 | u412863850 | 1600383653 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2211 | 261192 | 1819 | import sys
import re
import queue
import collections
import math
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
fro... | Traceback (most recent call last):
File "/tmp/tmp5yn92x08/tmpezrthcf7.py", line 83, in <module>
main()
File "/tmp/tmp5yn92x08/tmpezrthcf7.py", line 56, in main
N = i_input()
^^^^^^^^^
File "/tmp/tmp5yn92x08/tmpezrthcf7.py", line 15, in i_input
def i_input(): return int(input())
... | |
s888642642 | p02574 | u412863850 | 1600381046 | Python | Python (3.8.2) | py | Runtime Error | 2209 | 128888 | 2213 | import sys
import re
import queue
import collections
import math
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
fro... | Traceback (most recent call last):
File "/tmp/tmp4caun_4j/tmpw7y3as8a.py", line 75, in <module>
main()
File "/tmp/tmp4caun_4j/tmpw7y3as8a.py", line 53, in main
N = i_input()
^^^^^^^^^
File "/tmp/tmp4caun_4j/tmpw7y3as8a.py", line 15, in i_input
def i_input(): return int(input())
... | |
s623998086 | p02574 | u412863850 | 1600380988 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2214 | 255160 | 2213 | import sys
import re
import queue
import collections
import math
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
fro... | Traceback (most recent call last):
File "/tmp/tmpjebsnvaw/tmptt_wvuug.py", line 75, in <module>
main()
File "/tmp/tmpjebsnvaw/tmptt_wvuug.py", line 53, in main
N = i_input()
^^^^^^^^^
File "/tmp/tmpjebsnvaw/tmptt_wvuug.py", line 15, in i_input
def i_input(): return int(input())
... | |
s597866401 | p02574 | u412863850 | 1600380663 | Python | Python (3.8.2) | py | Runtime Error | 310 | 128920 | 1710 | import sys
import re
import queue
import collections
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect imp... | Traceback (most recent call last):
File "/tmp/tmpje53a2xr/tmp63oki115.py", line 71, in <module>
main()
File "/tmp/tmpje53a2xr/tmp63oki115.py", line 49, in main
N = i_input()
^^^^^^^^^
File "/tmp/tmpje53a2xr/tmp63oki115.py", line 14, in i_input
def i_input(): return int(input())
... | |
s939929695 | p02574 | u412863850 | 1600379189 | Python | Python (3.8.2) | py | Runtime Error | 2209 | 128776 | 1751 | import sys
import re
import queue
import collections
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect imp... | Traceback (most recent call last):
File "/tmp/tmp_rxmn4xp/tmp8kh3x2rb.py", line 76, in <module>
main()
File "/tmp/tmp_rxmn4xp/tmp8kh3x2rb.py", line 52, in main
N = i_input()
^^^^^^^^^
File "/tmp/tmp_rxmn4xp/tmp8kh3x2rb.py", line 14, in i_input
def i_input(): return int(input())
... | |
s415868970 | p02574 | u412863850 | 1600378833 | Python | Python (3.8.2) | py | Runtime Error | 2209 | 128940 | 1694 | import sys
import re
import queue
import collections
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect imp... | Traceback (most recent call last):
File "/tmp/tmpyho4uwb2/tmpg3zj7vb_.py", line 73, in <module>
main()
File "/tmp/tmpyho4uwb2/tmpg3zj7vb_.py", line 49, in main
N = i_input()
^^^^^^^^^
File "/tmp/tmpyho4uwb2/tmpg3zj7vb_.py", line 14, in i_input
def i_input(): return int(input())
... | |
s540376280 | p02574 | u015767468 | 1600337408 | Python | Python (3.8.2) | py | Runtime Error | 1017 | 127392 | 495 | M=int(input())
B=list(map(int,input().split()))
import numpy as np
import math
import sys
sys.setrecursionlimit(10**7)
def coprime(A,N):
X=np.zeros(A[N-1]+1)
for i in range(int(math.sqrt(A[N-1]))+1):
if i>=2:
X[i::i]=1
sumx=sum(X[A[j]] for j in range(N))
if sumx==N:
... | Traceback (most recent call last):
File "/tmp/tmpj0z824r0/tmpb_yqv5gr.py", line 1, in <module>
M=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s056942029 | p02574 | u015767468 | 1600337357 | Python | Python (3.8.2) | py | Runtime Error | 331 | 127468 | 548 | M=int(input())
B=list(map(int,input().split()))
import numpy as np
import math
import sys
sys.setrecursionlimit(10**7)
resource.setrlimit(resource.RLIMIT_STACK, (-1, -1))
def coprime(A,N):
X=np.zeros(A[N-1]+1)
for i in range(int(math.sqrt(A[N-1]))+1):
if i>=2:
X[i::i]=1
sumx=sum(X[A[... | Traceback (most recent call last):
File "/tmp/tmpzthmcsle/tmp_6_2lwzs.py", line 1, in <module>
M=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s461357892 | p02574 | u015767468 | 1600337146 | Python | Python (3.8.2) | py | Runtime Error | 1011 | 127460 | 456 | M=int(input())
B=list(map(int,input().split()))
import numpy as np
import math
def coprime(A,N):
X=np.zeros(A[N-1]+1)
for i in range(int(math.sqrt(A[N-1]))+1):
if i>=2:
X[i::i]=1
sumx=sum(X[A[j]] for j in range(N))
if sumx==N:
print('not coprime')
retu... | Traceback (most recent call last):
File "/tmp/tmpb2o4vdnm/tmpnv2eaft8.py", line 1, in <module>
M=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s615264300 | p02574 | u015767468 | 1600337068 | Python | Python (3.8.2) | py | Runtime Error | 999 | 127424 | 436 | M=int(input())
B=list(map(int,input().split()))
import numpy as np
import math
def coprime(A,N):
X=np.zeros(A[N-1]+1)
for i in range(int(math.sqrt(A[N-1]))+1):
if i>=2:
X[i::i]=1
sumx=sum(X[A[j]] for j in range(N))
if sumx==N:
print('not coprime')
retu... | Traceback (most recent call last):
File "/tmp/tmpx8acy9nf/tmpy7tujsij.py", line 1, in <module>
M=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s950741226 | p02574 | u015767468 | 1600336991 | Python | Python (3.8.2) | py | Runtime Error | 999 | 127416 | 448 | M=int(input())
B=list(map(int,input().split()))
import numpy as np
import math
import sys
def coprime(A,N):
X=np.zeros(A[N-1]+1)
for i in range(int(math.sqrt(A[N-1]))+1):
if i>=2:
X[i::i]=1
sumx=sum(X[A[j]] for j in range(N))
if sumx==N:
print('not coprime')
... | Traceback (most recent call last):
File "/tmp/tmpmpvsmzcx/tmpepd1hom8.py", line 1, in <module>
M=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s738028029 | p02574 | u015767468 | 1600336748 | Python | Python (3.8.2) | py | Runtime Error | 1076 | 127364 | 476 | N=int(input())
B=list(map(int,input().split()))
import numpy as np
import math
import sys
def coprime(A):
X=np.zeros(A[N-1]+1)
count=0
for i in range(int(math.sqrt(A[N-1]))+1):
if i>=2:
X[i::i]=1
sumx=sum(X[A[j]] for j in range(N))
if sumx==N:
print('not copr... | Traceback (most recent call last):
File "/tmp/tmp060xzwnz/tmp5i1nw7cm.py", line 1, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s761292837 | p02574 | u015767468 | 1600336615 | Python | Python (3.8.2) | py | Runtime Error | 1010 | 127472 | 467 | N=int(input())
A=list(map(int,input().split()))
import numpy as np
X=np.zeros(A[N-1]+1)
import math
import sys
count=0
def coprime(X):
for i in range(int(math.sqrt(A[N-1]))+1):
if i>=2:
X[i::i]=1
sumx=sum(X[A[j]] for j in range(N))
if sumx==N:
print('not coprime')
... | Traceback (most recent call last):
File "/tmp/tmpa3eae1_4/tmpuzp9d1lj.py", line 1, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s649348359 | p02574 | u015767468 | 1600336174 | Python | Python (3.8.2) | py | Runtime Error | 1025 | 127444 | 398 | N=int(input())
A=list(map(int,input().split()))
import numpy as np
X=np.zeros(A[N-1]+1)
import math
import sys
count=0
for i in range(int(math.sqrt(A[N-1]))+1):
if i>=2:
X[i::i]=1
sumx=sum(X[A[j]] for j in range(N))
if sumx==N:
print('not coprime')
sys.exit([0])
elif sumx>=2:
... | Traceback (most recent call last):
File "/tmp/tmp64krqptr/tmp0tv036k2.py", line 1, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s911678465 | p02574 | u015767468 | 1600336068 | Python | Python (3.8.2) | py | Runtime Error | 1015 | 127564 | 391 | N=int(input())
A=list(map(int,input().split()))
import numpy as np
X=np.zeros(A[N-1]+1)
import math
import sys
count=0
for i in range(int(math.sqrt(A[N-1]))+1):
if i>=2:
X[i::i]=1
sumx=sum(X[A[j]] for j in range(N))
if sumx==N:
print('not coprime')
sys.exit()
elif sumx>=2:
... | Traceback (most recent call last):
File "/tmp/tmpji9fdw30/tmpy8qa67gq.py", line 1, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s039071947 | p02574 | u391725895 | 1600291633 | Python | Python (3.8.2) | py | Runtime Error | 898 | 127064 | 1022 | def gcc(x, y):
if x == 0:return y
return gcc(y % x, x)
N = int(input())
A = list(map(int, input().split()))
g = 0
A.sort()
for item in A:
g = gcc(g, item)
if g != 1:
print("not coprime")
exit()
primes = []
is_prime = [True] * 1100000
primes = []
is_prime[0] = is_prime[1] = False
for i in ra... | Traceback (most recent call last):
File "/tmp/tmp5n8y52ds/tmp1njlsvsf.py", line 5, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s168067031 | p02574 | u525571359 | 1600291502 | Python | Python (3.8.2) | py | Runtime Error | 2208 | 141984 | 2479 | import sys
import math
from io import StringIO
import unittest
def resolve():
N, = map(int, input().split())
As = list(map(int, input().split()))
# allprimes = []
common_primes = None
all_primes = set()
all_uniq_primes_n = 0
d = get_d(1100000)
for i, a in enumerate(As):
primes... | Traceback (most recent call last):
File "/tmp/tmpj3fte4dc/tmpc1hcf3pv.py", line 103, in <module>
resolve()
File "/tmp/tmpj3fte4dc/tmpc1hcf3pv.py", line 8, in resolve
N, = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s594745447 | p02574 | u525571359 | 1600291221 | Python | Python (3.8.2) | py | Runtime Error | 2209 | 142024 | 2470 | import sys
import math
from io import StringIO
import unittest
def resolve():
N, = map(int, input().split())
As = list(map(int, input().split()))
# allprimes = []
common_primes = None
all_primes = set()
all_uniq_primes_n = 0
d = get_d(1100000)
for i, a in enumerate(As):
primes... | Traceback (most recent call last):
File "/tmp/tmpz5h4e_gj/tmpyl867_10.py", line 103, in <module>
resolve()
File "/tmp/tmpz5h4e_gj/tmpyl867_10.py", line 8, in resolve
N, = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s245029261 | p02574 | u525571359 | 1600290830 | Python | Python (3.8.2) | py | Runtime Error | 2207 | 141980 | 2431 | import sys
import math
from io import StringIO
import unittest
def resolve():
N, = map(int, input().split())
As = list(map(int, input().split()))
# allprimes = []
common_primes = None
all_primes = set()
all_uniq_primes_n = 0
d = get_d(1000000)
for i, a in enumerate(As):
primes... | Traceback (most recent call last):
File "/tmp/tmp5f3mqwt7/tmpyufjmy2f.py", line 100, in <module>
resolve()
File "/tmp/tmp5f3mqwt7/tmpyufjmy2f.py", line 8, in resolve
N, = map(int, input().split())
^^^^^^^
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.