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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s868457179 | p02361 | u825008385 | 1523455912 | Python | Python3 | py | Runtime Error | 0 | 0 | 1247 | from memory_profiler import profile
# Single Source Shortest Path
infty = 99999
[vertex, edge, r] = list(map(int, input("").split()))
D = [[infty for j in range(vertex)] for i in range(vertex)]
for i in range(edge):
data = list(map(int, input("").split()))
D[data[0]][data[1]] = data[2]
@profile
def Dijkstra(r... | Traceback (most recent call last):
File "/tmp/tmpm7oby6oy/tmp0c8xea67.py", line 1, in <module>
from memory_profiler import profile
ModuleNotFoundError: No module named 'memory_profiler'
| |
s501486847 | p02361 | u825008385 | 1523455991 | Python | Python3 | py | Runtime Error | 20 | 5612 | 1202 | # Single Source Shortest Path
infty = 99999
[vertex, edge, r] = list(map(int, input("").split()))
D = [[infty for j in range(vertex)] for i in range(vertex)]
for i in range(edge):
data = list(map(int, input("").split()))
D[data[0]][data[1]] = data[2]
def Dijkstra(root, n):
visited_order = 0
label = [0... | Traceback (most recent call last):
File "/tmp/tmpw5h3fnw1/tmpq6tr2cvt.py", line 4, in <module>
[vertex, edge, r] = list(map(int, input("").split()))
^^^^^^^^^
EOFError: EOF when reading a line
| |
s593960884 | p02361 | u825008385 | 1523546392 | Python | Python3 | py | Runtime Error | 20 | 5620 | 1419 | # Single Source Shortest Path
infty = 99999
[vertex, edge, r] = list(map(int, input("").split()))
dict_r = {}
for i in range(vertex):
dict_r[(r,i)] = infty
dict_c = {}
for i in range(edge):
data = list(map(int, input("").split()))
if int(data[0]) == r:
dict_r[(data[0],data[1])] = int(data[2])
... | Traceback (most recent call last):
File "/tmp/tmpwb1od0ph/tmp8ft8icre.py", line 4, in <module>
[vertex, edge, r] = list(map(int, input("").split()))
^^^^^^^^^
EOFError: EOF when reading a line
| |
s321194101 | p02361 | u167493070 | 1523758349 | Python | Python3 | py | Runtime Error | 20 | 5748 | 1439 | import sys
import heapq
def dfs(u,s,target, vs):
vs[u] = 1
if(u == target):
global h
heapq.heappush(h,s)
return
for j in range(e):
if(e_1[j] == u):
if(vs[e_2[j]] != 1):
count = s + e_w[j]
print(s,e_2[j],vs)
dfs(e_2... | Traceback (most recent call last):
File "/tmp/tmpiv9mqiap/tmpoid8jw5y.py", line 58, in <module>
v,e,r=map(int, input().split());
^^^^^^^
EOFError: EOF when reading a line
| |
s555319078 | p02361 | u167493070 | 1523758432 | Python | Python3 | py | Runtime Error | 0 | 0 | 1478 | import sys
import heapq
def dfs(u,s,target, vs):
vs[u] = 1
if(u == target):
global h
heapq.heappush(h,s)
return
for j in range(e):
if(e_1[j] == u):
if(vs[e_2[j]] != 1):
count = s + e_w[j]
print(s,e_2[j],vs)
dfs(e_2... | File "/tmp/tmpvowni8h0/tmps9f7jy5l.py", line 44
if(min == (INF)):
^
IndentationError: unindent does not match any outer indentation level
| |
s989608808 | p02361 | u167493070 | 1523759330 | Python | Python3 | py | Runtime Error | 0 | 0 | 1315 | import sys
import heapq
def dfs(u,s,target, vs):
vs[u] = 1
if(u == target):
global h
heapq.heappush(h,s)
return
for j in range(e):
if(e_1[j] == u):
if(vs[e_2[j]] != 1):
count = s + e_w[j]
print(s,e_2[j],vs)
dfs(e_2... | Traceback (most recent call last):
File "/tmp/tmppve_hp1p/tmpy2e8kflq.py", line 54, in <module>
v,e,r=map(int, input().split());
^^^^^^^
EOFError: EOF when reading a line
| |
s856725892 | p02361 | u167493070 | 1523760376 | Python | Python3 | py | Runtime Error | 0 | 0 | 465 | INF = 9999999999999999999
d = [INF for i in range(v)]
d[r] = 0
heapq.heappush(v_q,(0,r))
while(len(v_q) != 0):
cost,u = heapq.heappop(v_q)
if(cost > d[u]):
continue
for j in range(e):
if(u == e_1[j]):
alt = cost+e_w[j]
if(d[e_2[j]] > alt):
d[e_2[j]] = ... | Traceback (most recent call last):
File "/tmp/tmpuq5d_8o6/tmpstw1rwgu.py", line 2, in <module>
d = [INF for i in range(v)]
^
NameError: name 'v' is not defined
| |
s872744914 | p02361 | u167493070 | 1528102894 | Python | Python3 | py | Runtime Error | 0 | 0 | 660 | import sys
from collections import deque
v,e,r=map(int, input().split());
e_1=[0]*e;
e_2=[0]*e;
e_w=[0]*e;
for i in range(e):
e_1[i], e_2[i], e_w[i] = map(int, input().split());
v_q=[];
INF = 9999999999999999999
d = [INF for i in range(v)]
d[r] = 0
heapq.heappush(v_q,(0,r))
while(len(v_q) != 0):
cost,u = h... | Traceback (most recent call last):
File "/tmp/tmpmd79n8nq/tmpyv7vx3vp.py", line 4, in <module>
v,e,r=map(int, input().split());
^^^^^^^
EOFError: EOF when reading a line
| |
s038825156 | p02361 | u167493070 | 1528102909 | Python | Python3 | py | Runtime Error | 0 | 0 | 641 | import sys
from heapq
v,e,r=map(int, input().split());
e_1=[0]*e;
e_2=[0]*e;
e_w=[0]*e;
for i in range(e):
e_1[i], e_2[i], e_w[i] = map(int, input().split());
v_q=[];
INF = 9999999999999999999
d = [INF for i in range(v)]
d[r] = 0
heapq.heappush(v_q,(0,r))
while(len(v_q) != 0):
cost,u = heapq.heappop(v_q)
... | File "/tmp/tmpa87_wwnk/tmp7c43r4wr.py", line 2
from heapq
^
SyntaxError: invalid syntax
| |
s139384417 | p02361 | u089116225 | 1529340734 | Python | Python3 | py | Runtime Error | 0 | 0 | 450 | V,E,r = map(int, input().split())
edges = []
for _ in range(E):
tmp = [int(x) for x in input().split()]
edges.append(tmp)
d = [float('inf') for _ in range(V)]
d[r] = 0
for _ in range(V-1):
count = 0
for x in edges:
s,t,d = x
if d[t] > d[s] + d:
count += 1
d[t] =... | Traceback (most recent call last):
File "/tmp/tmpa9y5h9xf/tmpwefbqnuk.py", line 1, in <module>
V,E,r = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s227200387 | p02362 | u871901071 | 1404086451 | Python | Python3 | py | Runtime Error | 0 | 0 | 857 | import sys
def shortestPath(graph, s):
n = len(graph)
dist = [inf for _ in range(n)]
dist[s] = 0
for i in range(n):
for u in range(n):
for v, cost in graph[u]:
newDist = dist[u] + cost
if dist[u] != inf and newDist < dist[v]:
if i... | Traceback (most recent call last):
File "/tmp/tmpvoln5da2/tmpgi0rg8zl.py", line 37, in <module>
main()
File "/tmp/tmpvoln5da2/tmpgi0rg8zl.py", line 19, in main
v, e, s = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s374339174 | p02362 | u567380442 | 1427694806 | Python | Python3 | py | Runtime Error | 0 | 0 | 858 | class exist_negative_cycle(Exception):
pass
def bellman_ford(g, size, start=0):
d = [float('inf')] * size
d[start] = 0
for _ in range(size):
for u in g:
for length, v in g[u]:
if d[v] > d[u] + length:
d[v] = d[u] + length
for u in g:
... | Traceback (most recent call last):
File "/tmp/tmpfqa4z16h/tmpw5cyf67c.py", line 23, in <module>
vertex, edge, r = map(int, readline().split())
^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 3, got 0)
| |
s727560565 | p02362 | u442472098 | 1433241362 | Python | Python3 | py | Runtime Error | 0 | 0 | 548 | #!/usr/bin/env python3
from math import isinf
V, E, r = map(int, input().split())
vertices = [float('inf')] * V
vertices[r] = 0
edges = []
for i in range(E):
s, t, d = map(int, input().split())
edges.append((s, t, d))
for i in range(V - 1):
for s, t, d in edges:
if vertices[t] > vertices[s] + d:
... | Traceback (most recent call last):
File "/tmp/tmp3n26ebgp/tmph2b10v37.py", line 4, in <module>
V, E, r = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s903592549 | p02362 | u966364923 | 1451569884 | Python | Python3 | py | Runtime Error | 0 | 0 | 783 | V, E, root = map(int, input().split())
visited = [False] * V
nodes = [[] for i in range(V)]
cost = [[] for i in range(V)]
for i in range(E):
s, t, d = map(int, input().split())
nodes[s].append(t)
cost[s].append(d)
dist = [float('inf')] * V
dist[root] = 0
negative_cycle = False
for k in range(V):
for ... | Traceback (most recent call last):
File "/tmp/tmppn9vjsrb/tmpbt6kj49l.py", line 1, in <module>
V, E, root = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s746998718 | p02362 | u352394527 | 1528071924 | Python | Python3 | py | Runtime Error | 20 | 5600 | 848 |
INF = 10 ** 20
v_num, e_num, r = map(int, input().split())
dist_lst = [INF for _ in range(v_num)]
edges_lst = [[] for _ in range(e_num)]
negative_cycle_flag = False
for _ in range(e_num):
s, t, dist = map(int, input().split())
edges_lst[s].append((dist, t))
dist_lst[r] = 0
for _ in range(v_num):
for v in ran... | Traceback (most recent call last):
File "/tmp/tmpphwozqcp/tmpzu7zyrp5.py", line 4, in <module>
v_num, e_num, r = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s655507519 | p02363 | u397460030 | 1468758454 | Python | Python3 | py | Runtime Error | 50 | 7840 | 1491 | import heapq
def solve(num_v ,graph_data): # dict -> [[arr]]
solution = []
for i in range(num_v):
solution.append(partial_solve(i, graph_data))
return solution
def partial_solve(source,graph_data):
heap = [(0,source)]
partial_solution = [float("inf") for _ in range(4)]
while heap:
... | Traceback (most recent call last):
File "/tmp/tmpzs4d05_t/tmptt0apklh.py", line 60, in <module>
main()
File "/tmp/tmpzs4d05_t/tmptt0apklh.py", line 42, in main
l = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s759868690 | p02363 | u397460030 | 1468758592 | Python | Python3 | py | Runtime Error | 20 | 7828 | 1509 | import heapq
def solve(num_v ,graph_data): # dict -> [[arr]]
solution = []
for i in range(num_v):
solution.append(partial_solve(i, num_v, graph_data))
return solution
def partial_solve(source, num_v,graph_data):
heap = [(0,source)]
partial_solution = [float("inf") for _ in range(num_v)]
... | Traceback (most recent call last):
File "/tmp/tmp52qu1zk_/tmpt9bg6sjq.py", line 60, in <module>
main()
File "/tmp/tmp52qu1zk_/tmpt9bg6sjq.py", line 42, in main
l = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s487215530 | p02363 | u397460030 | 1469103786 | Python | Python3 | py | Runtime Error | 30 | 7784 | 1411 | def print_solve(ans):
if "negative" in ans:
print("NEGATIVE CYCLE")
else:
for l in ans:
for c in l[:-1]:
if c == float("inf"):
print("INF",end=" ")
else:
print(c,end=" ")
print(l[-1])
def solve(graph... | Traceback (most recent call last):
File "/tmp/tmprrdaoji0/tmp26feh09z.py", line 65, in <module>
main()
File "/tmp/tmprrdaoji0/tmp26feh09z.py", line 46, in main
l = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s828578532 | p02363 | u022407960 | 1480178506 | Python | Python3 | py | Runtime Error | 30 | 7712 | 1318 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from sys import stdin
def generate_adj_table(v_table):
for each in v_table:
start, end, weight = map(int, each)
init_adj_table[start][end] = weight
return init_adj_table
def floyd():
for k in _range:
for i in _range:
if ... | Traceback (most recent call last):
File "/tmp/tmpxf9kka05/tmpmf0w1sbl.py", line 47, in <module>
vertices, edges = map(int, _input[0].split())
~~~~~~^^^
IndexError: list index out of range
| |
s236929037 | p02363 | u798803522 | 1486974937 | Python | Python3 | py | Runtime Error | 0 | 0 | 903 | from collections import defaultdict
vertice,edge = map(int,input().split(" "))
cost = [[0 if m == n else float("inf") for n in range(vertice)] for m in range(vertice)]
link = defaultdict(dict)
weight = defaultdict(dict)
for e in range(edge):
i,j,w = map(int,input().split(""))
link[i] = link.get(i,set()) | {j}... | File "/tmp/tmpxoyxix4f/tmpvpgbir_7.py", line 19
for source in range(vertice)
^
SyntaxError: expected ':'
| |
s809618441 | p02363 | u798803522 | 1486974978 | Python | Python3 | py | Runtime Error | 0 | 0 | 904 | from collections import defaultdict
vertice,edge = map(int,input().split(" "))
cost = [[0 if m == n else float("inf") for n in range(vertice)] for m in range(vertice)]
link = defaultdict(dict)
weight = defaultdict(dict)
for e in range(edge):
i,j,w = map(int,input().split(""))
link[i] = link.get(i,set()) | {j}... | Traceback (most recent call last):
File "/tmp/tmp4jge0mn8/tmp67h6n306.py", line 3, in <module>
vertice,edge = map(int,input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s410898245 | p02363 | u798803522 | 1507967565 | Python | Python3 | py | Runtime Error | 0 | 0 | 892 | from collections import defaultdict
vertices, edges = (int(n) for n in input().split(" "))
connect = defaultdict(list)
cost_dp = [[float("inf") if n != m else 0 for n in range(vertices)] for m in range(vertices)]
for e in range(edges):
v1, v2, weight = (int(n) for n in input().split(" "))
connect[v1].append([v2... | File "/tmp/tmp6fwa51r_/tmp3saoa6nl.py", line 24
break
^^^^^
SyntaxError: 'break' outside loop
| |
s037692375 | p02363 | u798803522 | 1507967691 | Python | Python3 | py | Runtime Error | 0 | 0 | 888 | from collections import defaultdict
vertices, edges = (int(n) for n in input().split(" "))
connect = defaultdict(list)
cost_dp = [[float("inf") if n != m else 0 for n in range(vertices)] for m in range(vertices)]
for e in range(edges):
v1, v2, weight = (int(n) for n in input().split(" "))
connect[v1].append([v2... | File "/tmp/tmpv1axew5r/tmpily_36og.py", line 24
break
^^^^^
SyntaxError: 'break' outside loop
| |
s220587712 | p02363 | u146816547 | 1510482876 | Python | Python | py | Runtime Error | 0 | 0 | 986 | def main():
INF = int(1e12)
G = [[0 for i in range(101)] for j in range(101)];
v, e = map(int, raw_input().split())
for i in range(v):
for j in range(v):
if i == j:
G[i][j] = 0
else:
G[i][j] = INF
for i in range(e):
s, t, ... | File "/tmp/tmpdrupo2nu/tmppjh1nzac.py", line 28
print "NEGATIVE CYCLE"
^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s251032147 | p02363 | u146816547 | 1510482918 | Python | Python | py | Runtime Error | 0 | 0 | 931 | def main():
INF = int(1e12)
G = [[0 for i in range(101)] for j in range(101)];
v, e = map(int, raw_input().split())
for i in range(v):
for j in range(v):
if i == j:
G[i][j] = 0
else:
G[i][j] = INF
for i in range(e):
s, ... | File "/tmp/tmprk7scykz/tmpc0u2pakg.py", line 27
print "NEGATIVE CYCLE"
^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s560650720 | p02364 | u131811591 | 1531698670 | Python | Python3 | py | Runtime Error | 0 | 0 | 1106 | import sys
from union_find import UnionFind
from operator import attrgetter
class Kruskal:
class Edge:
def __init__(self, u, v, cost):
self.u, self.v, self.cost = u, v, cost
def __lt__(self, another):
return self.cost < another.cost
def __init__(self, node_size):
... | Traceback (most recent call last):
File "/tmp/tmp5cn1_mf1/tmpokq9lvav.py", line 2, in <module>
from union_find import UnionFind
ModuleNotFoundError: No module named 'union_find'
| |
s896088028 | p02364 | u629780968 | 1545454370 | Python | Python3 | py | Runtime Error | 0 | 0 | 610 | n = int(input())
m = [[-1 for i in range (n)] for j in range(n)]
d = [0]+ [2000]* (n-1)
isVisited = [False] * n
for i in range(n):
nums = list(map(int, input().split()))
for j in range(n):
m[i][j] = nums[j]
# def prim_mst(n):
def prim_mst(n):
while True:
mincost = 2000
for i in range(n):
if... | Traceback (most recent call last):
File "/tmp/tmpu755_gjj/tmpz8jma6ss.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s047730740 | p02364 | u629780968 | 1545454935 | Python | Python3 | py | Runtime Error | 0 | 0 | 851 | n = int(input())
m = [[-1 for i in range(n)] for j in range(n)] #お隣さんへのコストを保存(この中から最小を探す)
v = set()
v.add(0)
for i in range(n): #隣接の辺のコストを入力
nums = list(map(int, input().split()))
for j in range(n):
m[i][j] = nums[j]
def prim_mst(n):
isVisited = [False] * n
d = [0] + [2001] * (n-1) #TとV-Tのを繋ぐ最小辺の重み... | Traceback (most recent call last):
File "/tmp/tmp1vvf1jyn/tmpimzk07mj.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s290488990 | p02364 | u943441430 | 1559194638 | Python | Python3 | py | Runtime Error | 20 | 5664 | 962 | from heapq import heappush, heappop
line = input()
v, e = list(map(int, line.split()))
edge = {}
for _ in range(0, e):
line = input()
s, t, w = list(map(int, line.split()))
if s not in edge:
edge[s] = [[t, w]]
else:
edge[s] += [[t, w]]
if t not in edge:
edge[t] = [[s, w]]
... | Traceback (most recent call last):
File "/tmp/tmpw_b5pa64/tmp487b1tkj.py", line 3, in <module>
line = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s096901846 | p02364 | u686180487 | 1559355770 | Python | Python3 | py | Runtime Error | 0 | 0 | 544 | # -*- coding: utf-8 -*-
V, E = list(map(int, input().split()))
weight = []
for i in range(E):
s, t, w = list(map(int, input().split()))
weight.append((s,t,w))
weight.sort(key = lambda x: x[2])
parent = [i for i in range(V)]
def find(x):
if parent[x] == x:
return x
else:
return find(parent[x])
def u... | Traceback (most recent call last):
File "/tmp/tmpszb6l8cp/tmphr7fg0h0.py", line 3, in <module>
V, E = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s229423508 | p02364 | u797673668 | 1455720460 | Python | Python3 | py | Runtime Error | 20 | 7744 | 562 | import heapq
nv, ne = map(int, input().split())
edges = [set() for _ in range(nv)]
while ne:
s, t, w = map(int, input().split())
edges[s].add((w, t))
edges[t].add((w, s))
ne -= 1
cost = 0
queue = list(edges[0])
heapq.heapify(queue)
visited = [False] * nv
visited[0] = True
while True:
edge_cost, ... | Traceback (most recent call last):
File "/tmp/tmpvm2rxhfq/tmp9k8pim6x.py", line 3, in <module>
nv, ne = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s915397639 | p02364 | u766163292 | 1459318669 | Python | Python3 | py | Runtime Error | 0 | 0 | 1428 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import collections
import heapq
AdjacentVertex = collections.namedtuple("AdjacentVertex", "vertex cost")
INF = 2 ** 31 - 1
NO_VERTEX = -1
# Prim?????§??????0?????????????°???¨?????¨????±???????
def compute_mst_prim(max_v, adj_list):
# pred[u]?????????u???????????¨... | Traceback (most recent call last):
File "/tmp/tmpac2q7kxu/tmpj311ury3.py", line 48, in <module>
main()
File "/tmp/tmpac2q7kxu/tmpj311ury3.py", line 37, in main
max_v, max_e = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s039775401 | p02364 | u798803522 | 1487230887 | Python | Python3 | py | Runtime Error | 30 | 7900 | 984 | from collections import defaultdict
import heapq
vertices,edges = map(int,input().split(" "))
link = defaultdict(dict)
weight = defaultdict(dict)
for e in range(edges):
source,target,w = map(int,input().split(" "))
link[source] = link.get(source,set()) | {target}
link[target] = link.get(target,set()) | {s... | Traceback (most recent call last):
File "/tmp/tmp2ixby722/tmpwwcugut9.py", line 4, in <module>
vertices,edges = map(int,input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s295276899 | p02364 | u798803522 | 1487233494 | Python | Python3 | py | Runtime Error | 0 | 0 | 1038 | from collections import defaultdict
import heapq
vertices,edges = map(int,input().split(" "))
link = defaultdict(dict)
weight = defaultdict(dict)
way = [float("inf")] * vertices
for e in range(edges):
source,target,w = map(int,input().split(" "))
link[source] = link.get(source,set()) | {target}
link[target... | File "/tmp/tmp9p6_nfw1/tmpsahqjtrr.py", line 29
if c not in went and way[c] > [weight[here][c]:
^
SyntaxError: invalid syntax
| |
s147338420 | p02364 | u798803522 | 1487238471 | Python | Python3 | py | Runtime Error | 0 | 0 | 1214 | from collections import defaultdict
import heapq
def aaa()
vertices,edges = map(int,input().split(" "))
link = defaultdict(dict)
weight = defaultdict(dict)
way = [float("inf")] * vertices
for e in range(edges):
source,target,w = map(int,input().split(" "))
link[source] = link.get(sou... | File "/tmp/tmpv9wsxjq4/tmp_fatm6no.py", line 3
def aaa()
^
SyntaxError: expected ':'
| |
s242314772 | p02364 | u035108350 | 1500340429 | Python | Python3 | py | Runtime Error | 0 | 0 | 4955 |
class Node:
def __init__(self):
pass
class Edge:
def __init__(self,edge,cost=1):
self.node_from=edge[0]
self.node_to=edge[1]
self.cost=cost
def add_node(self,node):
self.nodes.append(node)
class myGraph:
def __init__(self):
self.adj={}
self.no... | Traceback (most recent call last):
File "/tmp/tmplfcumb0y/tmphm365vj9.py", line 199, in <module>
a=spaceinput()
^^^^^^^^^^^^
File "/tmp/tmplfcumb0y/tmphm365vj9.py", line 192, in spaceinput
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s952166354 | p02364 | u035108350 | 1500340475 | Python | Python3 | py | Runtime Error | 0 | 0 | 4955 |
class Node:
def __init__(self):
pass
class Edge:
def __init__(self,edge,cost=1):
self.node_from=edge[0]
self.node_to=edge[1]
self.cost=cost
def add_node(self,node):
self.nodes.append(node)
class myGraph:
def __init__(self):
self.adj={}
self.no... | Traceback (most recent call last):
File "/tmp/tmp7_xwy5z_/tmpgafvi7g3.py", line 199, in <module>
a=spaceinput()
^^^^^^^^^^^^
File "/tmp/tmp7_xwy5z_/tmpgafvi7g3.py", line 192, in spaceinput
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s458518479 | p02364 | u035108350 | 1500340581 | Python | Python3 | py | Runtime Error | 0 | 0 | 4957 |
class Node:
def __init__(self):
pass
class Edge:
def __init__(self,edge,cost=1):
self.node_from=edge[0]
self.node_to=edge[1]
self.cost=cost
def add_node(self,node):
self.nodes.append(node)
class myGraph:
def __init__(self):
self.adj={}
self.no... | Traceback (most recent call last):
File "/tmp/tmplh2uv7ou/tmpr0ni8yqa.py", line 199, in <module>
a=spaceinput()
^^^^^^^^^^^^
File "/tmp/tmplh2uv7ou/tmpr0ni8yqa.py", line 192, in spaceinput
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s447300525 | p02364 | u035108350 | 1500340632 | Python | Python3 | py | Runtime Error | 0 | 0 | 4957 |
class Node:
def __init__(self):
pass
class Edge:
def __init__(self,edge,cost=1):
self.node_from=edge[0]
self.node_to=edge[1]
self.cost=cost
def add_node(self,node):
self.nodes.append(node)
class myGraph:
def __init__(self):
self.adj={}
self.no... | Traceback (most recent call last):
File "/tmp/tmpv1mr5qb7/tmpvm3turia.py", line 199, in <module>
a=spaceinput()
^^^^^^^^^^^^
File "/tmp/tmpv1mr5qb7/tmpvm3turia.py", line 192, in spaceinput
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s626351835 | p02364 | u510829608 | 1501308057 | Python | Python3 | py | Runtime Error | 0 | 0 | 1482 | import array
import collections
import heapq
AdjacentVertex = collections.namedtuple('AdjacentVertex', 'vertex cost')
INF = 2 ** 31 - 1
NO_VERTEX = -1
#Prim?????§??????0?????????????°???¨?????¨(minimum spanning tree????±???????)
def compute_mst_prim(max_v, adj_list):
# pred[u]?????????u???????????¨??????????????... | Traceback (most recent call last):
File "/tmp/tmp5tup7y4r/tmpmzdfzz5l.py", line 35, in <module>
max_v, max_e = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s451716904 | p02364 | u510829608 | 1501308096 | Python | Python3 | py | Runtime Error | 0 | 0 | 1482 | import array
import collections
import heapq
AdjacentVertex = collections.namedtuple('AdjacentVertex', 'vertex cost')
INF = 2 ** 31 - 1
NO_VERTEX = -1
#Prim?????§??????0?????????????°???¨?????¨(minimum spanning tree????±???????)
def compute_mst_prim(max_v, adj_list):
# pred[u]?????????u???????????¨??????????????... | Traceback (most recent call last):
File "/tmp/tmp3ouo9lam/tmpaqdv19qi.py", line 35, in <module>
max_v, max_e = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s231016768 | p02364 | u510829608 | 1501308123 | Python | Python3 | py | Runtime Error | 0 | 0 | 1482 | import array
import collections
import heapq
AdjacentVertex = collections.namedtuple('AdjacentVertex', 'vertex cost')
INF = 2 ** 31 - 1
NO_VERTEX = -1
#Prim?????§??????0?????????????°???¨?????¨(minimum spanning tree????±???????)
def compute_mst_prim(max_v, adj_list):
# pred[u]?????????u???????????¨??????????????... | Traceback (most recent call last):
File "/tmp/tmp_tpjd119/tmpa92tblrk.py", line 35, in <module>
max_v, max_e = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s507452906 | p02364 | u510829608 | 1501308638 | Python | Python3 | py | Runtime Error | 0 | 0 | 2942 | import array
import collections
import heapq
AdjacentVertex = collections.namedtuple("AdjacentVertex", "vertex cost")
INF = 2 ** 31 - 1
NO_VERTEX = -1
# Prim?????§??????0?????????????°???¨?????¨????±???????
def compute_mst_prim(max_v, adj_list):
# pred[u]?????????u???????????¨???????????????????????¨???
pred... | File "/tmp/tmp3pq8bfv4/tmptgo6d8w8.py", line 42
print(sum(key.values()))import array
^^^^^^
SyntaxError: invalid syntax
| |
s189812025 | p02364 | u881590806 | 1502609381 | Python | Python3 | py | Runtime Error | 30 | 7992 | 832 | from collections import defaultdict
INF = 9999999999999999999999999999
def spanning_tree(G):
n = len(G)
T = {}
added = set()
min_c = INF
for i in G:
for j in G[i]:
if G[i][j] < min_c:
min_c = G[i][j]
min_e = (i, j)
T[min_e] = min_c
added.add(min_e[0])
added.add(min_e[1])
whi... | Traceback (most recent call last):
File "/tmp/tmpmrdenjof/tmpvmkv81ya.py", line 33, in <module>
n, m = [int(v) for v in input().strip().split(' ')]
^^^^^^^
EOFError: EOF when reading a line
| |
s767565344 | p02364 | u510829608 | 1504102928 | Python | Python3 | py | Runtime Error | 0 | 0 | 584 | mport heapq
from collections import defaultdict
INF = float('inf')
V, E = map(int, input().split())
Adj_list = defaultdict(set)
for i in range(E):
s, t, w = map(int, input().split())
Adj_list[s].add((t, w))
Adj_list[t].add((s, w))
def prim(x):
d = [INF] * x
d[0] = 0
hq = [(0,0)]
... | File "/tmp/tmpmipjrdpp/tmp4x9a9xyl.py", line 1
mport heapq
^^^^^
SyntaxError: invalid syntax
| |
s050725167 | p02364 | u798803522 | 1507974416 | Python | Python3 | py | Runtime Error | 0 | 0 | 758 | from collections import defaultdict
import heapq
vertices, edges = (int(n) for n in input().split(" "))
conn = defaultdict(set)
weight = defaultdict(dict())
for i in range(edges):
v1, v2, w = (int(n) for n in input().split(" "))
conn[v1] |= {v2}
conn[v2] |= {v1}
weight[v1][v2] = w
weight[v2][v1] = w... | Traceback (most recent call last):
File "/tmp/tmp7t9l3mr7/tmpzvc4fze5.py", line 3, in <module>
vertices, edges = (int(n) for n in input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s021693790 | p02365 | u797673668 | 1455910205 | Python | Python3 | py | Runtime Error | 30 | 7904 | 2089 | import heapq
nv, ne, r = map(int, input().split())
in_edges = {v: set() for v in range(nv)}
out_edges = {v: set() for v in range(nv)}
while ne:
s, t, w = map(int, input().split())
in_edges[t].add((w, s))
out_edges[s].add((w, t))
ne -= 1
def chu_liu_edmond(vertices):
global in_edges, out_edges, n... | Traceback (most recent call last):
File "/tmp/tmpoft67dvb/tmp31581cd9.py", line 3, in <module>
nv, ne, r = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s476496161 | p02365 | u685815919 | 1475030188 | Python | Python | py | Runtime Error | 20 | 6488 | 1198 | def edmond(V, paths, root):
mins = [(10**18, -1)]*V
for s,t,w in paths:
mins[t] = min(mins[t], (w,s))
mins[r] = (-1, -1)
group = [0]*V
comp = [0]*V
cnt = 0
used = [0]*V
for v in xrange(V):
if not used[v]:
chain = []
cur = v
while not used[cur] and cur != -1:
chain.appe... | File "/tmp/tmpfbxn_5hh/tmpnhzp3wt8.py", line 53
print edmond(V, paths, r)
^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s217883813 | p02365 | u072053884 | 1484492190 | Python | Python3 | py | Runtime Error | 30 | 7860 | 1750 | # Acceptance of input
import sys
file_input = sys.stdin
v_num, e_num, r = map(int, file_input.readline().split())
G = [[] for i in range(v_num)]
import heapq
for line in file_input:
s, t, w = map(int, line.split())
if t != r:
heapq.heappush(G[t], [w, s, t])
# Edmonds' algorithm
def find_cycle(in... | Traceback (most recent call last):
File "/tmp/tmpd5e0p6rb/tmpqw3qickl.py", line 7, in <module>
v_num, e_num, r = map(int, file_input.readline().split())
^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 3, got 0)
| |
s747186568 | p02365 | u035108350 | 1500340750 | Python | Python3 | py | Runtime Error | 0 | 0 | 4215 | class Node:
def __init__(self):
pass
class Edge:
def __init__(self,edge,cost=1):
self.node_from=edge[0]
self.node_to=edge[1]
self.cost=cost
def add_node(self,node):
self.nodes.append(node)
class myGraph:
def __init__(self):
self.adj={}
self.nod... | Traceback (most recent call last):
File "/tmp/tmpwu54_vk3/tmp71fuwpo4.py", line 173, in <module>
a=spaceinput()
^^^^^^^^^^^^
File "/tmp/tmpwu54_vk3/tmp71fuwpo4.py", line 166, in spaceinput
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s070147456 | p02366 | u967553879 | 1556715855 | Python | Python3 | py | Runtime Error | 30 | 7140 | 1313 | from collections import deque
def dfs(current, prev):
global time
# node currentを訪問した直後の処理
ord[current] = time
low[current] = time
time += 1
color[current] = BLACK
for next in G[current]:
if color[next] == WHITE:
# node currentからnode nextへ訪問する直前の処理
parent[n... | Traceback (most recent call last):
File "/tmp/tmp832wwrhr/tmpd0271qam.py", line 41, in <module>
v, n = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s207467058 | p02366 | u567380442 | 1428131860 | Python | Python3 | py | Runtime Error | 50 | 7544 | 1368 | def dfs(u, prev, visited, lowest, parent, prenum):
# ????????? u ????¨????????????´????????????
visited |= {u}
prenum[u] = len(visited)
lowest[u] = len(visited)
for v in g[u]:
if v not in visited:
# ????????? u ??????????????? v ????¨????????????´????????????
parent... | Traceback (most recent call last):
File "/tmp/tmpen5oyui0/tmpv3ub0_nu.py", line 23, in <module>
v, e = map(int, readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s949682410 | p02366 | u567380442 | 1428139037 | Python | Python3 | py | Runtime Error | 0 | 0 | 1113 | from sys import stdin
readline = stdin.readline
v, e = map(int, readline().split())
from collections import defaultdict
g = defaultdict(list)
for _ in range(e):
s, t = map(int, readline().split())
g[s].append(t)
g[t].append(s)
visited = set()
lowest = [None] * v
parent = [None] * v
prenum = [None] * ... | Traceback (most recent call last):
File "/tmp/tmppndfasm2/tmp1cp1y5dc.py", line 4, in <module>
v, e = map(int, readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s885290037 | p02366 | u567380442 | 1428140177 | Python | Python3 | py | Runtime Error | 0 | 0 | 1103 | from sys import stdin
readline = stdin.readline
v, e = map(int, readline().split())
from collections import defaultdict
g = defaultdict(list)
for _ in range(e):
s, t = map(int, readline().split())
g[s].append(t)
g[t].append(s)
visited = set()
lowest = [None] * v
parent = [None] * v
prenum = [None] * ... | Traceback (most recent call last):
File "/tmp/tmp4le6ioww/tmplp820zpi.py", line 4, in <module>
v, e = map(int, readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s036233960 | p02366 | u106851363 | 1444544678 | Python | Python3 | py | Runtime Error | 0 | 0 | 3268 | __author__ = 'zhewang711'
class Graph:
def __init__(self):
self.vertices = 0
self.outgoing = {}
self.root_cnt = 0
# self.incoming = {}
self.result = []
def insert_vertice(self):
self.vertices += 1
self.outgoing[self.vertices - 1] = []
# self.inco... | Traceback (most recent call last):
File "/tmp/tmpgthrjba7/tmpm0yj9y2d.py", line 91, in <module>
g.read_input('1.txt')
File "/tmp/tmpgthrjba7/tmpm0yj9y2d.py", line 41, in read_input
f = open(filename, 'r')
^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '1.txt'
| |
s299166673 | p02366 | u106851363 | 1444551595 | Python | Python3 | py | Runtime Error | 0 | 0 | 3221 | __author__ = 'zhewang711'
class Graph:
def __init__(self):
self.vertices = 0
self.outgoing = {}
self.root_cnt = 0
# self.incoming = {}
self.result = []
def insert_vertice(self):
self.vertices += 1
self.outgoing[self.vertices - 1] = []
# self.inco... | Traceback (most recent call last):
File "/tmp/tmpkhkba2ig/tmp9ennf2u2.py", line 88, in <module>
g.get_input()
File "/tmp/tmpkhkba2ig/tmp9ennf2u2.py", line 24, in get_input
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s562581919 | p02366 | u106851363 | 1444551993 | Python | Python3 | py | Runtime Error | 70 | 8752 | 3266 | __author__ = 'zhewang711'
class Graph:
def __init__(self):
self.vertices = 0
self.outgoing = {}
self.root_cnt = 0
# self.incoming = {}
self.result = set()
def insert_vertice(self):
self.vertices += 1
self.outgoing[self.vertices - 1] = []
# self.i... | Traceback (most recent call last):
File "/tmp/tmpl9yjmp_o/tmp93omb1ll.py", line 89, in <module>
g.get_input()
File "/tmp/tmpl9yjmp_o/tmp93omb1ll.py", line 24, in get_input
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s774779117 | p02366 | u797673668 | 1461573976 | Python | Python3 | py | Runtime Error | 50 | 8964 | 898 | n, m = map(int, input().split())
edges = [set() for _ in range(n)]
for _ in range(m):
s, t = map(int, input().split())
edges[s].add(t)
edges[t].add(s)
prenum = [None] * n
parent = [None] * n
lowest = [None] * n
counter = 0
def dfs(cur, prev):
global counter
prenum[cur] = lowest[cur] = counter
... | Traceback (most recent call last):
File "/tmp/tmp7f83hojs/tmpnjul6dv6.py", line 1, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s463524665 | p02366 | u894114233 | 1461738300 | Python | Python | py | Runtime Error | 0 | 0 | 536 | def dfs(s,p):
global V,color
color[s]=1
for i in V[s] :
if color[i]==0 and i!=p:
dfs(i,p)
color[s]=2
def AP():
global V,ap,n,color
for i in xrange(n):
color=[0]*n
dfs(V[i][0],i)
color[i]=2
print color
if color!=[2]*n:
ap.ap... | File "/tmp/tmpr_5tez7i/tmp7x_lf4u4.py", line 15
print color
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s534227465 | p02366 | u894114233 | 1461738330 | Python | Python | py | Runtime Error | 0 | 0 | 516 | def dfs(s,p):
global V,color
color[s]=1
for i in V[s] :
if color[i]==0 and i!=p:
dfs(i,p)
color[s]=2
def AP():
global V,ap,n,color
for i in xrange(n):
color=[0]*n
dfs(V[i][0],i)
color[i]=2
if color!=[2]*n:
ap.append(i)
n,e=map(int... | Traceback (most recent call last):
File "/tmp/tmphpmwwmld/tmpj001ifyd.py", line 18, in <module>
n,e=map(int,raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s590812376 | p02366 | u894114233 | 1461738980 | Python | Python | py | Runtime Error | 750 | 7104 | 595 | def dfs(s,p,color):
color[s]=1
for i in V[s] :
if color[i]==0 and i!=p:
dfs(i,p,color)
color[s]=2
def AP():
for i in xrange(n):
color=[0]*n
dfs(V[i][0],i,color)
color[i]=2
if color!=[2]*n:
ap.append(i)
n,e=map(int,raw_input().split())
ap=... | Traceback (most recent call last):
File "/tmp/tmpwvs3myb8/tmpt5ackldy.py", line 16, in <module>
n,e=map(int,raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s802953858 | p02366 | u894114233 | 1461739837 | Python | Python | py | Runtime Error | 30 | 6464 | 729 | import sys
sys.setrecursionlimit(10*6)
def dfs(s,p,color):
color[s]=1
for i in V[s] :
if color[i]==0 and i!=p:
dfs(i,p,color)
color[s]=2
def AP():
for i in xrange(vn):
if V[i]!=[]:
color=[0]*vn
dfs(V[i][0],i,color)
color[i]=2
i... | Traceback (most recent call last):
File "/tmp/tmpqtp06p0t/tmp7cx_e58q.py", line 21, in <module>
vn,e=map(int,raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s649288766 | p02366 | u022407960 | 1480319923 | Python | Python3 | py | Runtime Error | 30 | 8756 | 1808 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input:
5 4
0 1
1 2
2 3
3 4
output:
1
2
3
"""
from sys import stdin
UNVISITED, VISITED_IN_STACK, POPPED_OUT = 0, 1, 2
def generate_adj_table(_v_info):
for v_detail in _v_info:
v_from, v_to = map(int, v_detail)
init_adj_table[v_from].append(v_to... | Traceback (most recent call last):
File "/tmp/tmp2o7fdt3t/tmp89a7w3v7.py", line 72, in <module>
vertices, edges = map(int, _input[0].split())
~~~~~~^^^
IndexError: list index out of range
| |
s963184012 | p02366 | u022407960 | 1480320046 | Python | Python3 | py | Runtime Error | 50 | 8800 | 1808 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input:
5 4
0 1
1 2
2 3
3 4
output:
1
2
3
"""
from sys import stdin
UNVISITED, VISITED_IN_STACK, POPPED_OUT = 0, 1, 2
def generate_adj_table(_v_info):
for v_detail in _v_info:
v_from, v_to = map(int, v_detail)
init_adj_table[v_from].append(v_to... | Traceback (most recent call last):
File "/tmp/tmphrycan1n/tmp89u14_6z.py", line 72, in <module>
vertices, edges = map(int, _input[0].split())
~~~~~~^^^
IndexError: list index out of range
| |
s572881673 | p02366 | u022407960 | 1480321663 | Python | Python3 | py | Runtime Error | 0 | 0 | 1922 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input:
5 4
0 1
1 2
2 3
3 4
output:
1
2
3
"""
from sys import stdin
UNVISITED, VISITED_IN_STACK, POPPED_OUT = 0, 1, 2
def generate_adj_table(_v_info):
for v_detail in _v_info:
v_from, v_to = map(int, v_detail)
init_adj_table[v_from].append(v_to... | Traceback (most recent call last):
File "/tmp/tmp6c2ol_ym/tmp_4az18mk.py", line 73, in <module>
_in = open('test.txt', 'rt')
^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'test.txt'
| |
s864056130 | p02366 | u022407960 | 1480321700 | Python | Python3 | py | Runtime Error | 20 | 8792 | 1858 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input:
5 4
0 1
1 2
2 3
3 4
output:
1
2
3
"""
from sys import stdin
UNVISITED, VISITED_IN_STACK, POPPED_OUT = 0, 1, 2
def generate_adj_table(_v_info):
for v_detail in _v_info:
v_from, v_to = map(int, v_detail)
init_adj_table[v_from].append(v_to... | Traceback (most recent call last):
File "/tmp/tmp5v_c0rv7/tmp8tukdjpr.py", line 74, in <module>
vertices, edges = map(int, _input[0].split())
~~~~~~^^^
IndexError: list index out of range
| |
s591469860 | p02366 | u022407960 | 1480324495 | Python | Python3 | py | Runtime Error | 0 | 0 | 1900 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input:
5 4
0 1
1 2
2 3
3 4
output:
1
2
3
"""
import sys
sys.setrecursionlimit(int(3e6))
UNVISITED, VISITED_IN_STACK, POPPED_OUT = 0, 1, 2
def generate_adj_table(_v_info):
for v_detail in _v_info:
v_from, v_to = map(int, v_detail)
init_adj_tabl... | Traceback (most recent call last):
File "/tmp/tmpt7nx_8jz/tmpkv299i6w.py", line 74, in <module>
with open('test.txt', 'rt') as _in:
^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'test.txt'
| |
s807469391 | p02366 | u022407960 | 1481632984 | Python | Python3 | py | Runtime Error | 40 | 10452 | 1551 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input:
5 4
0 1
1 2
2 3
3 4
output:
1
2
3
"""
import sys
sys.setrecursionlimit(int(1e4))
def dfs_Tarjan(current):
global timer
children = 0
visited[current] = True
disc[current] = low[current] = timer
timer += 1
for adj in adj_table[curren... | Traceback (most recent call last):
File "/tmp/tmpye2hh4b1/tmpbmbwh52g.py", line 59, in <module>
v_num, e_num = map(int, _input[0].split())
~~~~~~^^^
IndexError: list index out of range
| |
s265991570 | p02366 | u400336986 | 1487447782 | Python | Python3 | py | Runtime Error | 0 | 0 | 809 | def dfs(v, tm):
dts[v] = est[v] = tm
child = 0
for i in range(nv):
if adj[v][i]:
if parents[i] is None:
child += 1
parents[i] = v
dfs(i, tm + 1)
est[v] = min(est[v], est[i])
if parents[v] is None and child ... | Traceback (most recent call last):
File "/tmp/tmp6jgnmzi3/tmpkigmk7h4.py", line 19, in <module>
nv, ne = map(int, input().split(' '))
^^^^^^^
EOFError: EOF when reading a line
| |
s024721865 | p02366 | u400336986 | 1487447981 | Python | Python3 | py | Runtime Error | 160 | 16596 | 856 | def dfs(v, tm):
visited[v] = True
dts[v] = est[v] = tm
child = 0
for i in range(nv):
if adj[v][i]:
if not visited[i]:
child += 1
parents[i] = v
dfs(i, tm + 1)
est[v] = min(est[v], est[i])
if parents[v] ... | Traceback (most recent call last):
File "/tmp/tmp4oajt52b/tmpqs_11jnl.py", line 20, in <module>
nv, ne = map(int, input().split(' '))
^^^^^^^
EOFError: EOF when reading a line
| |
s227607133 | p02366 | u881590806 | 1490960152 | Python | Python | py | Runtime Error | 0 | 0 | 1221 | def dfs(G,s,p,prenum,T,parents):
if len(G[s]) == 0: return p
T[s] = set()
prenum[s] = p
for c in G[s]:
if c in T: continue
p = dfs(G,c,p+1,prenum,T,parents)
T[s].add(c)
T[c].add(s)
parents[c] = s
return p
def find(G):
points = []
lowest = {}
pr... | File "/tmp/tmpdpxhfwi4/tmpac938g2v.py", line 59
print p
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s584254139 | p02366 | u881590806 | 1490960203 | Python | Python | py | Runtime Error | 0 | 0 | 1218 | def dfs(G,s,p,prenum,T,parents):
if len(G[s]) == 0: return p
T[s] = set()
prenum[s] = p
for c in G[s]:
if c in T: continue
p = dfs(G,c,p+1,prenum,T,parents)
T[s].add(c)
T[c].add(s)
parents[c] = s
return p
def find(G):
points = []
lowest = {}
prenu... | File "/tmp/tmptg98xyex/tmpqk_crn7r.py", line 56
print p
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s974969402 | p02366 | u881590806 | 1490961371 | Python | Python | py | Runtime Error | 20 | 8120 | 1154 | def dfs(G,s,p,prenum,T,parents,lowest):
T[s] = set()
prenum[s] = p
lowest[s] = p
if len(G[s]) == 0: return p
for c in G[s]:
if c in T:
if lowest[s] > prenum[c]:
lowest[s] = prenum[c]
else:
p = dfs(G,c,p+1,prenum,T,parents,lowest)
T[... | File "/tmp/tmp7a13olct/tmp48h_lvmx.py", line 59
print p
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s494780311 | p02366 | u603049633 | 1496896569 | Python | Python3 | py | Runtime Error | 30 | 8780 | 1027 | V,E = map(int, input().split())
#??£??\??????????????????
A = [[] for i in range(V)]
for i in range(E):
s,t = map(int, input().split())
A[s].append(t)
A[t].append(s)
#?????????????¨???????
prenum = [None for i in range(V)]
#DFS???????????????????????????
parent = [None for i in range(V)]
#?????????????... | Traceback (most recent call last):
File "/tmp/tmpy5mrhyl6/tmpd_goffxd.py", line 1, in <module>
V,E = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s337982752 | p02366 | u426534722 | 1501019833 | Python | Python3 | py | Runtime Error | 30 | 8952 | 939 | from sys import stdin
import sys
n, m = map(int, stdin.readline().split())
edges = [set() for _ in range(n)]
for _ in [0] * m:
s, t = map(int, stdin.readline().split())
edges[s].add(t)
edges[t].add(s)
prenum = [None] * n
parent = [None] * n
lowest = [None] * n
counter = 0
def dfs(cur, prev):
global coun... | Traceback (most recent call last):
File "/tmp/tmpong0np5k/tmpwbmtcfis.py", line 3, in <module>
n, m = map(int, stdin.readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s674001603 | p02366 | u426534722 | 1501019883 | Python | Python3 | py | Runtime Error | 30 | 8908 | 928 | from sys import stdin
n, m = map(int, stdin.readline().split())
edges = [set() for _ in range(n)]
for _ in [0] * m:
s, t = map(int, stdin.readline().split())
edges[s].add(t)
edges[t].add(s)
prenum = [None] * n
parent = [None] * n
lowest = [None] * n
counter = 0
def dfs(cur, prev):
global counter
pre... | Traceback (most recent call last):
File "/tmp/tmpragbb8vw/tmpuivn29o9.py", line 2, in <module>
n, m = map(int, stdin.readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s867639661 | p02366 | u426534722 | 1501020047 | Python | Python3 | py | Runtime Error | 30 | 8520 | 773 | import sys
def dfs(v, tm):
dts[v] = est[v] = tm + 1
child = 0
for i in adj[v]:
if est[i] == float('inf'):
child += 1
parents[i] = v
dfs(i, tm + 1)
est[v] = min(est[v], est[i])
if parents[v] is None and child > 1: aps[v] = True
... | Traceback (most recent call last):
File "/tmp/tmp19iukwry/tmpto7xmbd1.py", line 20, in <module>
nv, ne = map(int, input().split(' '))
^^^^^^^
EOFError: EOF when reading a line
| |
s237376507 | p02366 | u881590806 | 1504195663 | Python | Python3 | py | Runtime Error | 60 | 9364 | 780 | prenum = {}
lowest = {}
parent = {}
visited = set()
def dfs(G, u, t):
prenum[u] = t
lowest[u] = t
visited.add(u)
for v in G[u]:
if v not in visited:
dfs(G, v, t+1)
lowest[u] = min(lowest[u], lowest[v])
parent[v] = u
else:
lowest[u] = min(lowest[u], prenum[v])
def solve(G):
df... | Traceback (most recent call last):
File "/tmp/tmpo2rvsrvk/tmpmg6vb_p_.py", line 35, in <module>
n,m = list(map(int, input().split(' ')))
^^^^^^^
EOFError: EOF when reading a line
| |
s410774057 | p02366 | u260980560 | 1507995564 | Python | Python3 | py | Runtime Error | 0 | 0 | 893 | def get_articulation_points(G, N, start=0):
v_min = [0]*N; order = [None]*N
result = []; count = 0
def dfs(v, prev):
nonlocal count
r_min = order[v] = count
fcnt = 0; p_art = 0
count += 1
for w in G[v]:
if w == prev:
continue
if... | Traceback (most recent call last):
File "/tmp/tmp6m75ps2e/tmpq8dn_s6h.py", line 25, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s254297228 | p02366 | u260980560 | 1507996420 | Python | Python3 | py | Runtime Error | 60 | 8860 | 957 |
def get_articulation_points(G, N, start=0):
v_min = [0]*N; order = [None]*N
result = []; count = 0
def dfs(v, prev):
nonlocal count
r_min = order[v] = count
fcnt = 0; p_art = 0
count += 1
for w in G[v]:
if w == prev:
continue
i... | Traceback (most recent call last):
File "/tmp/tmpp7mbt_e_/tmps5os6bb6.py", line 27, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s145514849 | p02366 | u798803522 | 1508055253 | Python | Python3 | py | Runtime Error | 20 | 7968 | 1229 | from collections import defaultdict
def seq():
a = 1
while True:
yield a
a += 1
def dfs(here, went, connect, discovery, low, answer, seq):
went |= {here}
discovery[here] = low[here] = next(seq)
child = 0
for con in connect[here]:
if con not in went:
parent[c... | Traceback (most recent call last):
File "/tmp/tmp9fmu3svl/tmpxxyp_iu2.py", line 26, in <module>
vertices, edges = (int(n) for n in input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s471486340 | p02366 | u798803522 | 1508055838 | Python | Python3 | py | Runtime Error | 80 | 9096 | 1267 | from collections import defaultdict
def seq():
a = 1
while True:
yield a
a += 1
def dfs(here, went, connect, discovery, low, answer, seq):
went |= {here}
discovery[here] = low[here] = next(seq)
child = 0
for con in connect[here]:
if con not in went:
parent[c... | Traceback (most recent call last):
File "/tmp/tmp91nnr1es/tmpsz3_t2uy.py", line 26, in <module>
vertices, edges = (int(n) for n in input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s236368384 | p02366 | u519227872 | 1508058831 | Python | Python3 | py | Runtime Error | 80 | 9296 | 883 | from collections import defaultdict
V, E = map(int, input().split())
G = defaultdict(list)
T = defaultdict(list)
for i in range(E):
s,t = map(int, input().split())
G[s].append(t)
G[t].append(s)
prenum = [float('inf')] * V
lowest = [float('inf')] * V
parent = [None] * V
visited = [False] * V
def dfs(g,s,c=... | Traceback (most recent call last):
File "/tmp/tmpq9eaenw2/tmpsv8djbbb.py", line 2, in <module>
V, E = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s575416220 | p02366 | u519227872 | 1508059074 | Python | Python3 | py | Runtime Error | 70 | 11012 | 943 | from collections import defaultdict
import sys
sys.setrecursionlimit(2*sys.getrecursionlimit())
V, E = map(int, input().split())
G = defaultdict(list)
T = defaultdict(list)
for i in range(E):
s,t = map(int, input().split())
G[s].append(t)
G[t].append(s)
prenum = [float('inf')] * V
lowest = [float('inf')] *... | Traceback (most recent call last):
File "/tmp/tmpw6k3elnn/tmprud4c8i4.py", line 4, in <module>
V, E = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s365409982 | p02366 | u519227872 | 1508059097 | Python | Python3 | py | Runtime Error | 60 | 10916 | 943 | from collections import defaultdict
import sys
sys.setrecursionlimit(3*sys.getrecursionlimit())
V, E = map(int, input().split())
G = defaultdict(list)
T = defaultdict(list)
for i in range(E):
s,t = map(int, input().split())
G[s].append(t)
G[t].append(s)
prenum = [float('inf')] * V
lowest = [float('inf')] *... | Traceback (most recent call last):
File "/tmp/tmpaxfh7xpc/tmpmc2crfhh.py", line 4, in <module>
V, E = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s010245125 | p02366 | u519227872 | 1508059120 | Python | Python3 | py | Runtime Error | 60 | 11012 | 943 | from collections import defaultdict
import sys
sys.setrecursionlimit(5*sys.getrecursionlimit())
V, E = map(int, input().split())
G = defaultdict(list)
T = defaultdict(list)
for i in range(E):
s,t = map(int, input().split())
G[s].append(t)
G[t].append(s)
prenum = [float('inf')] * V
lowest = [float('inf')] *... | Traceback (most recent call last):
File "/tmp/tmp5wexqldi/tmpf0zdy8p4.py", line 4, in <module>
V, E = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s923190449 | p02366 | u662418022 | 1519735513 | Python | Python3 | py | Runtime Error | 30 | 7052 | 1172 | # -*- coding: utf-8 -*-
if __name__ == '__main__':
n, m = [int(s) for s in input().split()]
E = [set() for _ in range(n)]
for _ in range(m):
s, t = [int(s) for s in input().split(" ")]
E[s].add(t)
E[t].add(s)
def dfs(current, prev):
global timer
prenum[current... | Traceback (most recent call last):
File "/tmp/tmpgq6obh_7/tmpp6yhk067.py", line 6, in <module>
n, m = [int(s) for s in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s303842990 | p02367 | u967553879 | 1556843407 | Python | Python3 | py | Runtime Error | 0 | 0 | 1310 | from collections import deque
sys.setrecursionlimit(1000000)
def dfs(current, prev):
global time
# node currentを訪問した直後の処理
ord[current] = time
low[current] = time
time += 1
color[current] = BLACK
for next in G[current]:
if color[next] == WHITE:
# node currentからnode next... | Traceback (most recent call last):
File "/tmp/tmplxrcud6f/tmph47dzuv9.py", line 2, in <module>
sys.setrecursionlimit(1000000)
^^^
NameError: name 'sys' is not defined
| |
s729066645 | p02367 | u797673668 | 1461576355 | Python | Python3 | py | Runtime Error | 40 | 8992 | 797 | n, m = map(int, input().split())
edges = [set() for _ in range(n)]
for _ in range(m):
s, t = map(int, input().split())
edges[s].add(t)
edges[t].add(s)
prenum = [None] * n
parent = [None] * n
lowest = [None] * n
counter = 0
bridges = set()
def dfs(cur, prev):
global counter
prenum[cur] = lowest[... | Traceback (most recent call last):
File "/tmp/tmpg62i618y/tmpcgr7k59k.py", line 1, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s408332130 | p02367 | u022407960 | 1480484486 | Python | Python3 | py | Runtime Error | 30 | 8956 | 2160 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input:
5 4
0 1
1 2
2 3
3 4
output:
0 1
1 2
2 3
3 4
"""
import sys
# sys.setrecursionlimit(int(3e6))
def generate_adj_table(_v_info):
for v_detail in _v_info:
v_from, v_to = map(int, v_detail)
init_adj_table[v_from].append(v_to)
# undirec... | Traceback (most recent call last):
File "/tmp/tmprqae44u0/tmpfsi1mas5.py", line 84, in <module>
vertices, edges = map(int, _input[0].split())
~~~~~~^^^
IndexError: list index out of range
| |
s878913971 | p02367 | u022407960 | 1480484549 | Python | Python3 | py | Runtime Error | 0 | 0 | 2159 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input:
5 4
0 1
1 2
2 3
3 4
output:
0 1
1 2
2 3
3 4
"""
import sys
sys.setrecursionlimit(int(1e10))
def generate_adj_table(_v_info):
for v_detail in _v_info:
v_from, v_to = map(int, v_detail)
init_adj_table[v_from].append(v_to)
# undirect... | Traceback (most recent call last):
File "/tmp/tmpl8bzvoz8/tmp4bzb25o8.py", line 20, in <module>
sys.setrecursionlimit(int(1e10))
OverflowError: Python int too large to convert to C int
| |
s427778962 | p02367 | u798803522 | 1508077762 | Python | Python3 | py | Runtime Error | 0 | 0 | 1232 | from collections import defaultdict
import sys
sys.setrecursionlimit(100000)
def seq():
a = 1
while True:
yield a
a += 1
def dfs(here, went, connect, discovery, low, answer, seq):
went |= {here}
discovery[here] = low[here] = next(seq)
child = 0
for con in connect[here]:
... | Traceback (most recent call last):
File "/tmp/tmp8v7ho51e/tmpqhw1dglv.py", line 26, in <module>
vertices, edges = (int(n) for n in input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s986602917 | p02367 | u798803522 | 1508077844 | Python | Python3 | py | Runtime Error | 0 | 0 | 1232 | from collections import defaultdict
import sys
sys.setrecursionlimit(100000)
def seq():
a = 1
while True:
yield a
a += 1
def dfs(here, went, connect, discovery, low, answer, seq):
went |= {here}
discovery[here] = low[here] = next(seq)
child = 0
for con in connect[here]:
... | Traceback (most recent call last):
File "/tmp/tmps4wqlcbe/tmpjjofmirh.py", line 26, in <module>
vertices, edges = (int(n) for n in input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s204853134 | p02368 | u567380442 | 1428195864 | Python | Python3 | py | Runtime Error | 0 | 0 | 1664 | def search(g, v):
visited = set()
lowest = [None] * v
parent = [None] * v
prenum = [None] * v
child = defaultdict(list)
root = 0
# dfs??§tree?????????
stack = [(root, None)]
while stack:
u, prev = stack.pop()
if u not in visited:
parent[u] = prev
... | Traceback (most recent call last):
File "/tmp/tmpqdmz524q/tmpeyjh1fz9.py", line 55, in <module>
main()
File "/tmp/tmpqdmz524q/tmpeyjh1fz9.py", line 43, in main
v, e = map(int, readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s157612326 | p02368 | u567380442 | 1428195926 | Python | Python3 | py | Runtime Error | 30 | 6800 | 1700 | def search(g, v):
visited = set()
lowest = [None] * v
parent = [None] * v
prenum = [None] * v
child = defaultdict(list)
root = 0
# dfs??§tree?????????
stack = [(root, None)]
while stack:
u, prev = stack.pop()
if u not in visited:
parent[u] = prev
... | Traceback (most recent call last):
File "/tmp/tmpu5_rjyym/tmpf49q5k9m.py", line 56, in <module>
main()
File "/tmp/tmpu5_rjyym/tmpf49q5k9m.py", line 44, in main
v, e = map(int, readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s117398597 | p02368 | u567380442 | 1428207239 | Python | Python3 | py | Runtime Error | 0 | 0 | 1762 | from collections import defaultdict
from collections import Counter
def search(g, v):
visited = set()
lowest = [None] * v
parent = [None] * v
prenum = [None] * v
child = defaultdict(list)
backtrack = defaultdict(set)
for root in range(v):
if root in visited:
continue
... | Traceback (most recent call last):
File "/tmp/tmp1kz9tdbe/tmp3x0pi67d.py", line 66, in <module>
main()
File "/tmp/tmp1kz9tdbe/tmp3x0pi67d.py", line 53, in main
v, e = map(int, readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s111787803 | p02368 | u797673668 | 1461579413 | Python | Python3 | py | Runtime Error | 140 | 8436 | 1019 | def f_dfs(i):
global f_edges, counter
visited[i] = True
for edge in f_edges[i]:
if visited[edge]:
continue
f_dfs(edge)
finish_order[i] = (counter, i)
counter += 1
def b_dfs(i, group):
global b_edges, groups
visited[i] = True
groups[i] = group
for edge in... | Traceback (most recent call last):
File "/tmp/tmpcm8thqvw/tmpfif3uob4.py", line 22, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s184108483 | p02368 | u022407960 | 1480492151 | Python | Python3 | py | Runtime Error | 90 | 9844 | 2759 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input:
5 6
0 1
1 0
1 2
2 4
4 3
3 2
4
0 1
0 3
2 3
3 4
output:
1
0
1
1
"""
import sys
sys.setrecursionlimit(int(1e4))
def generate_adj_table(_v_info):
for v_detail in _v_info:
v_from, v_to = map(int, v_detail)
init_adj_table[v_from].append(v_to)
... | Traceback (most recent call last):
File "/tmp/tmptpwomvan/tmpgxmy1489.py", line 114, in <module>
vertices, edges = map(int, _input[0].split())
~~~~~~^^^
IndexError: list index out of range
| |
s800372080 | p02368 | u022407960 | 1480527058 | Python | Python3 | py | Runtime Error | 210 | 67532 | 2395 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input:
5 6
0 1
1 0
1 2
2 4
4 3
3 2
4
0 1
0 3
2 3
3 4
output:
1
0
1
1
"""
import sys
from math import isinf
sys.setrecursionlimit(int(1e6))
def generate_adj_table(_v_info):
for v_detail in _v_info:
v_from, v_to = map(int, v_detail)
init_adj_tabl... | Traceback (most recent call last):
File "/tmp/tmp_w2z3lq9/tmphpogvr5f.py", line 102, in <module>
vertices, edges = map(int, _input[0].split())
~~~~~~^^^
IndexError: list index out of range
| |
s608785094 | p02368 | u894114233 | 1482652349 | Python | Python | py | Runtime Error | 40 | 6508 | 991 | def add_edge(frm,to):
g[frm].append(to)
rg[to].append(frm)
def dfs(now,used,back_track):
used[now]=True
for nx in g[now]:
if not used[nx]:dfs(nx,used,back_track)
back_track.append(now)
def rdfs(now,num_cmp,used,cmp):
used[now]=True
cmp[now]=num_cmp
for nx in rg[now]:
if... | Traceback (most recent call last):
File "/tmp/tmp7_pfud1b/tmpcuv4p99l.py", line 31, in <module>
n,m=map(int,raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.