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
s705330673
p02368
u400336986
1487593289
Python
Python3
py
Runtime Error
280
8016
801
def dfs(u, g, stack): visited[u] = True for v in g[u]: if not visited[v]: dfs(v, g, stack) stack.append(u) return stack nv, ne = map(int, input().split(' ')) adj, tps = ([[] for _ in range(nv)] for _ in range(2)) for _ in range(ne): s, t = map(int, input().split(' ')) adj[s...
Traceback (most recent call last): File "/tmp/tmpgjbr82nu/tmpee9ja6d1.py", line 9, in <module> nv, ne = map(int, input().split(' ')) ^^^^^^^ EOFError: EOF when reading a line
s966539963
p02368
u855775311
1499781277
Python
Python3
py
Runtime Error
140
8264
1032
def main(): nvertices, nedges = map(int, input().split()) Adj = [[] for i in range(nvertices)] Adjrev = [[] for i in range(nvertices)] for i in range(nedges): s, t = map(int, input().split()) Adj[s].append(t) Adjrev[t].append(s) component_ids = [-1] * nvertices id = 0 ...
Traceback (most recent call last): File "/tmp/tmpdpkb4bym/tmp2b5mdagz.py", line 44, in <module> main() File "/tmp/tmpdpkb4bym/tmp2b5mdagz.py", line 2, in main nvertices, nedges = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s169080503
p02368
u855775311
1499920890
Python
Python3
py
Runtime Error
0
0
1241
def main(): nvertices, nedges = map(int, input().split()) Adj = [[] for i in range(nvertices)] Adjrev = [[] for i in range(nvertices)] for i in range(nedges): s, t = map(int, input().split()) Adj[s].append(t) Adjrev[t].append(s) ordering = [] visited = [False] * nvertice...
Traceback (most recent call last): File "/tmp/tmpp4nxyhjo/tmp7n0xnqnj.py", line 51, in <module> main() File "/tmp/tmpp4nxyhjo/tmp7n0xnqnj.py", line 2, in main nvertices, nedges = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s325399044
p02368
u855775311
1499920982
Python
Python3
py
Runtime Error
130
8176
1249
def main(): nvertices, nedges = map(int, input().split()) Adj = [[] for i in range(nvertices)] Adjrev = [[] for i in range(nvertices)] for i in range(nedges): s, t = map(int, input().split()) Adj[s].append(t) Adjrev[t].append(s) ordering = [] visited = [False] * nvertice...
Traceback (most recent call last): File "/tmp/tmp_h3y3u6w/tmp35hv6_9r.py", line 51, in <module> main() File "/tmp/tmp_h3y3u6w/tmp35hv6_9r.py", line 2, in main nvertices, nedges = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s526226443
p02368
u855775311
1499921156
Python
Python3
py
Runtime Error
120
8024
1299
import sys def main(): sys.setrecursionlimit(int(1e4)) nvertices, nedges = map(int, input().split()) Adj = [[] for i in range(nvertices)] Adjrev = [[] for i in range(nvertices)] for i in range(nedges): s, t = map(int, input().split()) Adj[s].append(t) Adjrev[t].append(s) ...
Traceback (most recent call last): File "/tmp/tmpglxdnf4m/tmpxxfmwl03.py", line 56, in <module> main() File "/tmp/tmpglxdnf4m/tmpxxfmwl03.py", line 6, in main nvertices, nedges = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s106263419
p02368
u855775311
1501749583
Python
Python3
py
Runtime Error
110
7924
1114
def main(): nvertices, nedges = map(int, input().split()) Adj = [[] for i in range(nvertices)] AdjRev = [[] for i in range(nvertices)] for i in range(nedges): u, v = map(int, input().split()) Adj[u].append(v) AdjRev[v].append(u) lst = [] visited = [False] * nvertices ...
Traceback (most recent call last): File "/tmp/tmp6jgbs6g9/tmpvw050i13.py", line 46, in <module> main() File "/tmp/tmp6jgbs6g9/tmpvw050i13.py", line 2, in main nvertices, nedges = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s419177994
p02368
u798803522
1508158537
Python
Python3
py
Runtime Error
150
8544
1430
from collections import defaultdict def counter(): cnt = 0 while True: yield cnt cnt += 1 def dfs(here, visited, track, count, connect): visited |= {here} for c in connect[here]: if c not in visited: dfs(c, visited, track, count, connect) track[here] = next(coun...
Traceback (most recent call last): File "/tmp/tmp1c8jl3gw/tmpv0ax1kkd.py", line 23, in <module> vertices, edges = (int(n) for n in input().split(" ")) ^^^^^^^ EOFError: EOF when reading a line
s159978713
p02368
u798803522
1508158584
Python
Python3
py
Runtime Error
0
0
1460
from collections import defaultdict sys.setrecursionlimit(100000) def counter(): cnt = 0 while True: yield cnt cnt += 1 def dfs(here, visited, track, count, connect): visited |= {here} for c in connect[here]: if c not in visited: dfs(c, visited, track, count, connec...
Traceback (most recent call last): File "/tmp/tmpap9ajtjr/tmpr13lcvda.py", line 2, in <module> sys.setrecursionlimit(100000) ^^^ NameError: name 'sys' is not defined
s447351435
p02368
u352394527
1528130011
Python
Python3
py
Runtime Error
200
6056
1222
""" 強連結成分分解 """ def dfs(v, visited, edges, order): visited[v] = True for to in edges[v]: if not visited[to]: dfs(to, visited, edges, order) order.append(v) def search_strongly_connection(v, visited, reverse_edges, parent): visited[v] = True for to in reverse_edges[v]: if not visited[to]: ...
Traceback (most recent call last): File "/tmp/tmphtouf1s6/tmpstey6168.py", line 27, in <module> v_num , e_num = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s577430336
p02369
u797673668
1461582089
Python
Python3
py
Runtime Error
20
7712
779
import sys sys.setrecursionlimit(200000) def dfs(i): global edges, visited, root, duplicated visited[i] = True for edge in edges[i]: if visited[edge]: if edge == root: return True duplicated.add(edge) continue if dfs(edge): r...
Traceback (most recent call last): File "/tmp/tmpm7pfy_fx/tmp31iqfqbe.py", line 19, in <module> n, m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s710746056
p02369
u603049633
1497844394
Python
Python3
py
Runtime Error
30
7792
722
import heapq as pq inf = float("inf") n,e = map(int, input().split()) M = [[] for i in range(n)] L = list(map(int, range(n))) for i in range(e): s,t = map(int, input().split()) M[s].append(t) if t in L: L.remove(t) def dijkstra(s): color = [0] * n H =[] pq.heappush(H, s) whil...
Traceback (most recent call last): File "/tmp/tmpk4_9zxmv/tmp7q90m8yv.py", line 3, in <module> n,e = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s874350260
p02369
u893844544
1523855949
Python
Python3
py
Runtime Error
0
0
426
nv,ne = [int(i) for i in input().split()] a = [] for i in range(nv): a.append([]) for i in range(ne): s,t = [int(j) for j in input().split()] a[s].append(t) done = [] flag = 0 def put_forword(index): global f if index in done: return done.append(index) for s in a[index]: ...
Traceback (most recent call last): File "/tmp/tmp2yndt1t_/tmpsfyf208v.py", line 4, in <module> nv,ne = [int(i) for i in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s588145984
p02369
u893844544
1523858360
Python
Python3
py
Runtime Error
0
0
429
nv,ne = [int(i) for i in input().split()] g = [[] for i in range(nv)] for i in range(ne): s,t = [int(j) for j in input().split()] g[s].append(t) done = [] f = 0 def put_forword(index): global f if index in done: return done.append(index) for i in g[index]: if i == 0 and ...
File "/tmp/tmpu4oj553a/tmp7wl466av.py", line 23 if i == 0 and done.count() == nv: ^ SyntaxError: invalid non-printable character U+3000
s531085172
p02370
u011621222
1540444477
Python
Python3
py
Runtime Error
20
5664
442
# -*- coding: utf-8 -*- # 文字列の入力 import math V,E = map(int ,input().split()) X = [] for i in range(E): s_i, t_i = map(int , input().split()) if(s_i in X): if(t_i in X): t = X.index(t_i) s = X.index(s_i) if(s > t): X.remove(t_i) X.insert(s,t_i) else: X.append(t_i) else: if(t_i in X): t...
Traceback (most recent call last): File "/tmp/tmpg5br6hgv/tmpsil827km.py", line 6, in <module> V,E = map(int ,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s189501960
p02370
u967553879
1556259677
Python
Python3
py
Runtime Error
0
0
1009
def topologicalSortBfs(n): for i in range(n): color[i] = WHITE for i in range(0, n): if indeg[i] == 0 and color[i] == WHITE: bfs(i) def bfs(s): Q.appendleft(s) color[s] = GRAY while Q: u = Q.popleft() out.append(u) for v in G[u]: i...
Traceback (most recent call last): File "/tmp/tmpjeysyo_2/tmpya8quucu.py", line 42, in <module> n, e = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s311039860
p02370
u099826363
1556717798
Python
Python3
py
Runtime Error
40
6840
701
from sys import exit import queue V,E = [int(n) for n in input().split()] ans = [] # N = int(input()) graph = [[] for _ in range(V)] indeg = [0]*E yet = [True]*E def bfs(s): q = queue.Queue() q.put(s) while(not q.empty()): u = q.get() ans.append(u) yet[u]=False for v in grap...
Traceback (most recent call last): File "/tmp/tmpu6ufdgjy/tmpc__605xt.py", line 3, in <module> V,E = [int(n) for n in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s327024893
p02370
u099826363
1556717874
Python
Python3
py
Runtime Error
40
6840
701
from sys import exit import queue V,E = [int(n) for n in input().split()] ans = [] # N = int(input()) graph = [[] for _ in range(E)] indeg = [0]*E yet = [True]*E def bfs(s): q = queue.Queue() q.put(s) while(not q.empty()): u = q.get() ans.append(u) yet[u]=False for v in grap...
Traceback (most recent call last): File "/tmp/tmp206x559e/tmp8ko_az7m.py", line 3, in <module> V,E = [int(n) for n in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s959517610
p02370
u067972379
1559212067
Python
Python3
py
Runtime Error
0
0
1069
from collections import deque, defaultdict def topological_sort(V, E): ''' Kahn's Algorithm (O(|V| + |E|) time) Input: V = [0, 1, ..., N-1]: a list of vertices of the digraph E: the adjacency list of the digraph (dict) Output: If the input digraph is acyclic, then return a topological sorti...
Traceback (most recent call last): File "/tmp/tmptmohfzg7/tmpuewfmgkm.py", line 33, in <module> N, M = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s900224205
p02370
u894114233
1461422655
Python
Python
py
Runtime Error
10
6800
697
from collections import deque def Topologicalsort(): for i in xrange(v): if indeg[i]==0 and color[i]==0: bfs(i) def bfs(s): color[s]=2 q.append(s) while len(q)>0: i=q.popleft() ans.append(i) for j in xrange(v): if m[i][j]!=-1 and color[j]==0 : ...
Traceback (most recent call last): File "/tmp/tmpzd53sieu/tmp1p3ww9o7.py", line 21, in <module> v,e=map(int,raw_input().split()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s080724592
p02370
u894114233
1461422906
Python
Python
py
Runtime Error
10
6800
688
from collections import deque def Topologicalsort(): for i in xrange(v): if indeg[i]==0 and color[i]==0: bfs(i) def bfs(s): color[s]=2 q.append(s) while len(q)>0: i=q.popleft() ans.append(i) for j in xrange(v): if m[i][j]!=-1: ind...
Traceback (most recent call last): File "/tmp/tmpa3f9_752/tmpofj4vrbu.py", line 21, in <module> v,e=map(int,raw_input().split()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s164985054
p02370
u462831976
1490603572
Python
Python3
py
Runtime Error
40
8676
830
# -*- coding: utf-8 -*- import sys import os import pprint from queue import Queue """Topological Sort""" #fd = os.open('GRL_4_B.txt', os.O_RDONLY) #os.dup2(fd, sys.stdin.fileno()) V, E = list(map(int, input().split())) G = [[] for i in range(V)] indig = [0] * V # ??\?¬???° for i in range(V): s, t = list(map(in...
Traceback (most recent call last): File "/tmp/tmpctqegmeo/tmp4lwdd7m1.py", line 13, in <module> V, E = list(map(int, input().split())) ^^^^^^^ EOFError: EOF when reading a line
s492553537
p02370
u426534722
1500821701
Python
Python3
py
Runtime Error
0
0
469
from sys import stdin from collections import deque V, E = map(int, stdin.readline().split()) adj_list = [[] for _ in [] * V] is_visited = [False] * V for _ in [] * E: s, t = map(int, stdin.readline().split()) adj_list[s].append(t) out = deque() def dfs(u): is_visited[u] = True for v in adj_list[u]: ...
Traceback (most recent call last): File "/tmp/tmpe_0zq4vc/tmpulzjxza_.py", line 3, in <module> V, E = map(int, stdin.readline().split()) ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s162708980
p02370
u426534722
1500821728
Python
Python3
py
Runtime Error
0
0
470
from sys import stdin from collections import deque V, E = map(int, stdin.readline().split()) adj_list = [[] for _ in [] * V] is_visited = [False] * V for _ in [0] * E: s, t = map(int, stdin.readline().split()) adj_list[s].append(t) out = deque() def dfs(u): is_visited[u] = True for v in adj_list[u]: ...
Traceback (most recent call last): File "/tmp/tmp44oz__1p/tmpr4_iquvm.py", line 3, in <module> V, E = map(int, stdin.readline().split()) ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s907833658
p02370
u792145349
1528975773
Python
Python3
py
Runtime Error
0
0
516
N, M = map(int, input().split()) G = [[] for i in range(N)] for i in range(M): s, t = map(int, input().split()) G[s].append(t) def topological_sort(g): topological_list = [] visited = set() def dfs(n): for e in g[n]: if e not in visited: dfs(e) topologic...
File "/tmp/tmpr5yjo3wp/tmp68s2c6mj.py", line 8 topological_list = [] ^ SyntaxError: invalid non-printable character U+3000
s257941396
p02371
u138546245
1534991840
Python
Python3
py
Runtime Error
20
6248
1710
#!/usr/bin/env python3 # GRL_5_A: Tree - Diameter of a Tree class Edge: __slots__ = ('v', 'w') def __init__(self, v, w): self.v = v self.w = w def either(self): return self.v def other(self, v): if v == self.v: return self.w else: retu...
Traceback (most recent call last): File "/tmp/tmp4jvuk4ti/tmpo67z5mza.py", line 85, in <module> run() File "/tmp/tmp4jvuk4ti/tmpo67z5mza.py", line 74, in run n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s723042716
p02371
u943441430
1559280055
Python
Python3
py
Runtime Error
20
5668
934
from heapq import heappush, heappop INF = 10000000000 def dijkstra(r, v, dic): dp = [] q = [] dp = [INF] * v dp[r] = 0 heappush(q, (0, r)) while q: cost, vtx = heappop(q) if dp[vtx] < cost: continue for vtx1, cost1 in dic[vtx]: if cost + cost1 <...
Traceback (most recent call last): File "/tmp/tmp6o7gifv4/tmpxfg7ls4r.py", line 22, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s636298060
p02371
u943441430
1559280089
Python
Python3
py
Runtime Error
20
5664
924
from heapq import heappush, heappop INF = 10000000000 def dijkstra(r, v, dic): dp = [] q = [] dp = [INF] * v dp[r] = 0 heappush(q, (0, r)) while q: cost, vtx = heappop(q) if dp[vtx] < cost: continue for vtx1, cost1 in dic[vtx]: if cost + cost1 <...
Traceback (most recent call last): File "/tmp/tmpbonokvq4/tmpofk15duv.py", line 22, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s900104419
p02371
u943441430
1559282570
Python
Python3
py
Runtime Error
20
6220
665
def solve(prev, r, dic): d = 0 t = r if r in dic: for vtx, cost in dic[r]: if vtx == prev: continue d1, t1 = solve(r, vtx, dic) d1 += cost if d < d1: d = d1 t = t1 return d, t line = input() n = int(...
Traceback (most recent call last): File "/tmp/tmp_g1ug_1n/tmpp2xtv553.py", line 15, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s896418709
p02371
u943441430
1559282654
Python
Python3
py
Runtime Error
20
6220
665
def solve(prev, r, dic): d = 0 t = r if r in dic: for vtx, cost in dic[r]: if vtx == prev: continue d1, t1 = solve(r, vtx, dic) d1 += cost if d < d1: d = d1 t = t1 return d, t line = input() n = int(...
Traceback (most recent call last): File "/tmp/tmp4ludajos/tmpimn592gg.py", line 15, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s015717608
p02371
u943441430
1559285284
Python
Python3
py
Runtime Error
290
16788
707
import sys sys.setrecursionlimit(10000) def solve(prev, r, dic): d = 0 t = r if r in dic: for vtx, cost in dic[r]: if vtx == prev: continue d1, t1 = solve(r, vtx, dic) d1 += cost if d < d1: d = d1 t = t...
Traceback (most recent call last): File "/tmp/tmp_q_psvyk/tmp96jv71_a.py", line 19, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s948763989
p02371
u943441430
1559285310
Python
Python3
py
Runtime Error
820
43928
707
import sys sys.setrecursionlimit(50000) def solve(prev, r, dic): d = 0 t = r if r in dic: for vtx, cost in dic[r]: if vtx == prev: continue d1, t1 = solve(r, vtx, dic) d1 += cost if d < d1: d = d1 t = t...
Traceback (most recent call last): File "/tmp/tmpzo1vg_0j/tmpyi3kfxkj.py", line 19, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s205742847
p02371
u943441430
1559285339
Python
Python3
py
Runtime Error
750
43924
708
import sys sys.setrecursionlimit(100000) def solve(prev, r, dic): d = 0 t = r if r in dic: for vtx, cost in dic[r]: if vtx == prev: continue d1, t1 = solve(r, vtx, dic) d1 += cost if d < d1: d = d1 t = ...
Traceback (most recent call last): File "/tmp/tmpzf2j6cuz/tmp8coogtzb.py", line 19, in <module> line = input() ^^^^^^^ EOFError: EOF when reading a line
s751108930
p02371
u567380442
1428235656
Python
Python3
py
Runtime Error
40
6756
847
def postorder(g): parent_stack = [None] dfs_stack = [(0, None)] while dfs_stack: u, prev = dfs_stack.pop() dfs_stack.extend((t, u) for d, t in g[u]) while parent_stack[-1] != prev: yield parent_stack.pop() parent_stack.append(u) while parent_stack[...
Traceback (most recent call last): File "/tmp/tmpog3wayur/tmpfkplinui.py", line 18, in <module> n = int(readline()) ^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s832427108
p02371
u567380442
1428236297
Python
Python3
py
Runtime Error
30
6764
945
def root(g): return set(g.keys()).difference({y for x in g.values() for y in x}).pop() def postorder(g): parent_stack = [None] dfs_stack = [(root(g), None)] while dfs_stack: u, prev = dfs_stack.pop() dfs_stack.extend((t, u) for d, t in g[u]) while parent_stack[-1] !=...
Traceback (most recent call last): File "/tmp/tmp0z4a5crc/tmp1aa7f14o.py", line 21, in <module> n = int(readline()) ^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s849577171
p02371
u072053884
1477707059
Python
Python3
py
Runtime Error
230
15936
553
# Acceptance of input import sys f_i = sys.stdin n = int(f_i.readline()) edges = [[None] * n for i in range(n)] for l_i in f_i: s, t, w = map(int, l_i.split()) edges[s][t] = w edges[t][s] = w # Tree Walk and Output distance = [0] * n def tree_walk(u, d, p): for v, e in enumerate(edges[u]): ...
Traceback (most recent call last): File "/tmp/tmpmyfen8r2/tmpegy7vwdb.py", line 7, in <module> n = int(f_i.readline()) ^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s793960812
p02371
u072053884
1477759074
Python
Python3
py
Runtime Error
30
8028
1470
# Acceptance of input import sys f_i = sys.stdin n = int(f_i.readline()) edges = [[None] * n for i in range(n)] for l_i in f_i: s, t, w = map(int, l_i.split()) edges[s][t] = w edges[t][s] = w # dfs tree walk 1 import collections path = collections.deque() path.append(0) distance = 0 max_distance = ...
Traceback (most recent call last): File "/tmp/tmpm3gg__lh/tmphpxkl021.py", line 7, in <module> n = int(f_i.readline()) ^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s307578639
p02371
u072053884
1477830715
Python
Python3
py
Runtime Error
150
20612
566
# Acceptance of input import sys f_i = sys.stdin n = int(f_i.readline()) edges = [[] for i in range(n)] for l_i in f_i: s, t, w = map(int, l_i.split()) edges[s].append([t, w]) edges[t].append([s, w]) # Tree Walk and Output distance = [0] * n sys.setrecursionlimit(10000) def tree_walk(u, d, p): ...
Traceback (most recent call last): File "/tmp/tmpcfi2vfbc/tmp3bxsn7ok.py", line 7, in <module> n = int(f_i.readline()) ^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s361206091
p02371
u072053884
1477830786
Python
Python3
py
Runtime Error
500
94944
567
# Acceptance of input import sys f_i = sys.stdin n = int(f_i.readline()) edges = [[] for i in range(n)] for l_i in f_i: s, t, w = map(int, l_i.split()) edges[s].append([t, w]) edges[t].append([s, w]) # Tree Walk and Output distance = [0] * n sys.setrecursionlimit(100000) def tree_walk(u, d, p): ...
Traceback (most recent call last): File "/tmp/tmp59f8dcog/tmp0ffm68e_.py", line 7, in <module> n = int(f_i.readline()) ^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s378573805
p02371
u072053884
1477830822
Python
Python3
py
Runtime Error
510
94916
567
# Acceptance of input import sys f_i = sys.stdin n = int(f_i.readline()) edges = [[] for i in range(n)] for l_i in f_i: s, t, w = map(int, l_i.split()) edges[s].append([t, w]) edges[t].append([s, w]) # Tree Walk and Output distance = [0] * n sys.setrecursionlimit(200000) def tree_walk(u, d, p): ...
Traceback (most recent call last): File "/tmp/tmp03f2h6na/tmpkfgmf7ux.py", line 7, in <module> n = int(f_i.readline()) ^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s725953730
p02371
u260980560
1500111153
Python
Python
py
Runtime Error
0
0
591
while 1: n = input() if n == 0: break G = [[] for i in xrange(n)] for i in xrange(n-1): s, t, w = map(int, raw_input().split()) G[s].append((t, w)) G[t].append((s, w)) def dfs(s, prev): if prev != -1 and len(G[s]) == 1: return (0, s) res =...
File "/tmp/tmpssw16_43/tmp8c95j8ok.py", line 23 print dfs(t, -1)[0] ^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s830985785
p02371
u260980560
1500111176
Python
Python
py
Runtime Error
0
0
631
import sys sys.setrecursionlimit(10**6) while 1: n = input() if n == 0: break G = [[] for i in xrange(n)] for i in xrange(n-1): s, t, w = map(int, raw_input().split()) G[s].append((t, w)) G[t].append((s, w)) def dfs(s, prev): if prev != -1 and len(G[s]) == 1:...
File "/tmp/tmp3x4l1fvp/tmphhhm41n2.py", line 25 print dfs(t, -1)[0] ^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s285166837
p02371
u260980560
1500111221
Python
Python
py
Runtime Error
470
91060
509
import sys sys.setrecursionlimit(10**6) n = input() G = [[] for i in xrange(n)] for i in xrange(n-1): s, t, w = map(int, raw_input().split()) G[s].append((t, w)) G[t].append((s, w)) def dfs(s, prev): if prev != -1 and len(G[s]) == 1: return (0, s) res = (0, -1) for t, w in G[s]: ...
File "/tmp/tmpv7i2db4_/tmpp5xlxbu1.py", line 22 print dfs(t, -1)[0] ^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s656967478
p02371
u260980560
1500111591
Python
Python
py
Runtime Error
490
95028
474
import sys sys.setrecursionlimit(10**6) n = input() G = [[] for i in xrange(n)] for i in xrange(n-1): s, t, w = map(int, raw_input().split()) G[s].append((t, w)) G[t].append((s, w)) def dfs(s, prev): if prev != -1 and len(G[s]) == 1: return (0, s) res = (0, s) for t, w in G[s]: ...
File "/tmp/tmp_plq0y0t/tmpzg7_fgoz.py", line 21 print dfs(t, -1)[0] ^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s319285156
p02371
u426534722
1501104919
Python
Python3
py
Runtime Error
0
0
718
import sys readline = sys.stdin.readline from collections import deque from math import isinf INF = float("inf") sys.setrecursionlimit(200000) n = int(readline()) G = [[] for _ in range(n)] for _ in [0] * (n - 1): s, t, w = map(int, readline().split()) G[s].append([t, w]) G[t].append([s, w]) def bfs(s, D): ...
Traceback (most recent call last): File "/tmp/tmp7cnohsx2/tmpq9zqklw_.py", line 7, in <module> n = int(readline()) ^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s350380047
p02371
u798803522
1508662368
Python
Python3
py
Runtime Error
60
8412
868
from collections import defaultdict def dfs(source, used, all_weight, connect): max_weight = all_weight max_source = source used[source] = 1 for target, weight in connect[source]: if not used[target]: now_weight = all_weight + weight this_source, this_weight = dfs(target...
Traceback (most recent call last): File "/tmp/tmpeggsgf74/tmpqc990l7c.py", line 16, in <module> vertice = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s906142384
p02371
u798803522
1508662414
Python
Python3
py
Runtime Error
830
54372
909
from collections import defaultdict import sys sys.setrecursionlimit(100000) def dfs(source, used, all_weight, connect): max_weight = all_weight max_source = source used[source] = 1 for target, weight in connect[source]: if not used[target]: now_weight = all_weight + weight ...
Traceback (most recent call last): File "/tmp/tmpy2s8a874/tmpbpxi5aqv.py", line 18, in <module> vertice = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s366159095
p02372
u138546245
1535095693
Python
Python3
py
Runtime Error
20
5684
3004
#!/usr/bin/env python3 # GRL_5_B: Tree - Height of a Tree import bisect class Edge: __slots__ = ('v', 'w') def __init__(self, v, w): self.v = v self.w = w def either(self): return self.v def other(self, v): if v == self.v: return self.w else: ...
Traceback (most recent call last): File "/tmp/tmpgrdhrqng/tmpjnu90afc.py", line 123, in <module> run() File "/tmp/tmpgrdhrqng/tmpjnu90afc.py", line 111, in run n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s522342851
p02372
u567380442
1428286644
Python
Python3
py
Runtime Error
30
6800
1400
from sys import stdin from collections import defaultdict readline = stdin.readline def main(): n = int(readline()) g = defaultdict(list) for _ in range(n - 1): s, t, d = map(int, readline().split()) g[s].append([d, t]) dp = defaultdict(dict) r = root(g) for i in postorder(g, ...
Traceback (most recent call last): File "/tmp/tmphe_3hh4a/tmpwxslstve.py", line 56, in <module> main() File "/tmp/tmphe_3hh4a/tmpwxslstve.py", line 8, in main n = int(readline()) ^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s750439590
p02372
u797673668
1461663787
Python
Python3
py
Runtime Error
30
7752
1027
import sys from operator import itemgetter sys.setrecursionlimit(200000) def dfs(u, prev): global post_order, pre_order pre_order.append((u, prev)) for w, t in edges[u]: if t != prev: dfs(t, u) post_order.append(u) n = int(input()) edges = [set() for _ in range(n)] for _ in ra...
Traceback (most recent call last): File "/tmp/tmp27bc8kf2/tmps121ofln.py", line 17, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s899231018
p02372
u798803522
1508670418
Python
Python3
py
Runtime Error
0
0
1041
from collections import defaultdict import sys sys.setrecursionlimit(200000) def dfs(source, edge_index, connect): if connect[source][edge_index][2] >= 0: return connect[source][edge_index][2] this_edge = connect[source][edge_index] this_edge[2] = this_edge[1] dest = this_edge[0] for i, (ne...
Traceback (most recent call last): File "/tmp/tmpphc72mst/tmpgydr5khl.py", line 16, in <module> v_num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s175574039
p02372
u798803522
1508671622
Python
Python3
py
Runtime Error
0
0
1321
from collections import defaultdict import sys sys.setrecursionlimit(200000) def dfs(source, edge_index, connect, used): if used[source] or connect[source][edge_index][2] >= 0: return connect[source][edge_index][2] used[source] = 1 this_edge = connect[source][edge_index] this_edge[2] = this_edg...
Traceback (most recent call last): File "/tmp/tmp4ye3froy/tmpcaxoqwow.py", line 20, in <module> v_num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s403533908
p02372
u798803522
1508675521
Python
Python3
py
Runtime Error
0
0
1645
# for undirected graph from collections import defaultdict import sys sys.setrecursionlimit(200000) def dfs(source, edge_index, connect, used): if connect[source][edge_index][3] or connect[source][edge_index][2] >= 0: return connect[source][edge_index][2] connect[source][edge_index][3] = 1 this_ed...
Traceback (most recent call last): File "/tmp/tmp9hsi2rdw/tmpw7rfytpc.py", line 25, in <module> v_num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s076566577
p02372
u798803522
1508681398
Python
Python3
py
Runtime Error
0
0
1721
# for undirected graph from collections import defaultdict import sys sys.setrecursionlimit(200000) def dfs(source, edge_index, connect): if connect[source][edge_index][3] or connect[source][edge_index][2] >= 0: return connect[source][edge_index][2] connect[source][edge_index][3] = 1 this_edge = c...
Traceback (most recent call last): File "/tmp/tmp48c0saz8/tmpfhwtt8ow.py", line 25, in <module> v_num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s050646246
p02372
u798803522
1508681433
Python
Python3
py
Runtime Error
0
0
1687
# for undirected graph from collections import defaultdict import sys sys.setrecursionlimit(200000) def dfs(source, edge_index, connect): if connect[source][edge_index][3] or connect[source][edge_index][2] >= 0: return connect[source][edge_index][2] connect[source][edge_index][3] = 1 this_edge = c...
Traceback (most recent call last): File "/tmp/tmp0g4_sth7/tmp4hd4k4my.py", line 25, in <module> v_num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s656616893
p02373
u082657995
1556376524
Python
Python3
py
Runtime Error
20
5624
1752
class Lca: def __init__(self, E, root): import sys sys.setrecursionlimit(500000) self.root = root self.E = E # V<V> self.n = len(E) # 頂点数 self.logn = 0 while self.n > (1<<self.logn): self.logn += 1 # parent[n][v] = ノード v から 1<<n 個親をたどったノ...
Traceback (most recent call last): File "/tmp/tmpmi6_9pdi/tmp07qa_mux.py", line 46, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s977228897
p02373
u894114233
1471704708
Python
Python
py
Runtime Error
480
19080
1345
# -*- coding: utf-8 -*- from math import log def dfs(v,p,d): parent[0][v]=p depth[v]=d for i in xrange(len(G[v])): if G[v][i]!=p: dfs(G[v][i],v,d+1) def init(vn,root): dfs(root,-1,0) k=0 while k+1<log(vn,2): for v in xrange(vn): if parent[k][v]<0: ...
Traceback (most recent call last): File "/tmp/tmp7kkup063/tmpchaf8z59.py", line 37, in <module> vn=int(raw_input()) #????????° ^^^^^^^^^ NameError: name 'raw_input' is not defined
s649570266
p02373
u894114233
1471704919
Python
Python
py
Runtime Error
1080
82012
1385
# -*- coding: utf-8 -*- from math import log import sys sys.setrecursionlimit(10**7) def dfs(v,p,d): parent[0][v]=p depth[v]=d for i in xrange(len(G[v])): if G[v][i]!=p: dfs(G[v][i],v,d+1) def init(vn,root): dfs(root,-1,0) k=0 while k+1<log(vn,2): for v in xrange(vn...
Traceback (most recent call last): File "/tmp/tmpkdtwvtfa/tmpip4k8epx.py", line 39, in <module> vn=int(raw_input()) #????????° ^^^^^^^^^ NameError: name 'raw_input' is not defined
s423519560
p02373
u894114233
1471704965
Python
Python
py
Runtime Error
1100
81980
1385
# -*- coding: utf-8 -*- from math import log import sys sys.setrecursionlimit(10**9) def dfs(v,p,d): parent[0][v]=p depth[v]=d for i in xrange(len(G[v])): if G[v][i]!=p: dfs(G[v][i],v,d+1) def init(vn,root): dfs(root,-1,0) k=0 while k+1<log(vn,2): for v in xrange(vn...
Traceback (most recent call last): File "/tmp/tmpt38u4y8x/tmpzzrjmhdg.py", line 39, in <module> vn=int(raw_input()) #????????° ^^^^^^^^^ NameError: name 'raw_input' is not defined
s241355782
p02373
u022407960
1481776093
Python
Python3
py
Runtime Error
30
7968
1801
#!/usr/bin/env python # -*- coding: utf-8 -*- """ input: 16 3 1 2 3 3 4 5 6 0 2 7 8 0 2 9 10 2 14 15 0 0 0 3 11 12 13 0 0 0 0 0 10 1 3 4 5 4 9 4 10 4 13 9 13 9 14 9 8 13 14 13 7 output: 0 1 1 1 1 5 1 0 1 0 """ import sys import math def dfs(v, v_parent, v_depth): parent[0][v] = v_parent depth[v] = v_depth...
Traceback (most recent call last): File "/tmp/tmp58g5y3ir/tmpwvs5p8rr.py", line 103, in <module> v_num = int(_input[0]) ~~~~~~^^^ IndexError: list index out of range
s474160311
p02373
u022407960
1481776135
Python
Python3
py
Runtime Error
20
7904
1834
#!/usr/bin/env python # -*- coding: utf-8 -*- """ input: 16 3 1 2 3 3 4 5 6 0 2 7 8 0 2 9 10 2 14 15 0 0 0 3 11 12 13 0 0 0 0 0 10 1 3 4 5 4 9 4 10 4 13 9 13 9 14 9 8 13 14 13 7 output: 0 1 1 1 1 5 1 0 1 0 """ import sys import math sys.setrecursionlimit(int(1e5)) def dfs(v, v_parent, v_depth): parent[0][v] ...
Traceback (most recent call last): File "/tmp/tmprz7al9dp/tmpovc8ryln.py", line 105, in <module> v_num = int(_input[0]) ~~~~~~^^^ IndexError: list index out of range
s869009376
p02373
u022407960
1481806461
Python
Python3
py
Runtime Error
30
7960
1939
#!/usr/bin/env python # -*- coding: utf-8 -*- """ input: 16 3 1 2 3 3 4 5 6 0 2 7 8 0 2 9 10 2 14 15 0 0 0 3 11 12 13 0 0 0 0 0 10 1 3 4 5 4 9 4 10 4 13 9 13 9 14 9 8 13 14 13 7 output: 0 1 1 1 1 5 1 0 1 0 """ import sys import math sys.setrecursionlimit(int(1e5)) def dfs(v, v_parent, v_depth): # print(paren...
Traceback (most recent call last): File "/tmp/tmpsm9d8ieh/tmp3w0v9ca3.py", line 108, in <module> v_num = int(_input[0]) ~~~~~~^^^ IndexError: list index out of range
s560784192
p02373
u022407960
1481806815
Python
Python3
py
Runtime Error
860
105140
1939
#!/usr/bin/env python # -*- coding: utf-8 -*- """ input: 16 3 1 2 3 3 4 5 6 0 2 7 8 0 2 9 10 2 14 15 0 0 0 3 11 12 13 0 0 0 0 0 10 1 3 4 5 4 9 4 10 4 13 9 13 9 14 9 8 13 14 13 7 output: 0 1 1 1 1 5 1 0 1 0 """ import sys import math sys.setrecursionlimit(int(1e5)) def dfs(v, v_parent, v_depth): # print(paren...
Traceback (most recent call last): File "/tmp/tmpywjijz1b/tmpyvow28d7.py", line 108, in <module> v_num = int(_input[0]) ~~~~~~^^^ IndexError: list index out of range
s989481025
p02373
u022407960
1481971667
Python
Python3
py
Runtime Error
0
0
1685
#!/usr/bin/env python # -*- coding: utf-8 -*- """ input: 3 0.0 0.0 2.0 0.0 1.0 1.0 output: 1.41421356237 """ import sys from operator import attrgetter class ClosestPair(object): def __init__(self, in_data): """ Init closest pairs points set. """ self.p_num = int(in_data[0]) ...
Traceback (most recent call last): File "/tmp/tmpaucrqku2/tmps51z4z1m.py", line 65, in <module> case = ClosestPair(in_data=_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/tmpaucrqku2/tmps51z4z1m.py", line 24, in __init__ self.p_num = int(in_data[0]) ~~~~~~~^^^ IndexError: list...
s095425140
p02373
u022407960
1481971749
Python
Python3
py
Runtime Error
0
0
1697
#!/usr/bin/env python # -*- coding: utf-8 -*- """ input: 3 0.0 0.0 2.0 0.0 1.0 1.0 output: 1.41421356237 """ import sys from operator import attrgetter class ClosestPair(object): def __init__(self, in_data): """ Init closest pairs points set. """ self.p_num = int(in_data[0]) ...
Traceback (most recent call last): File "/tmp/tmph2_177ou/tmppuboy4zx.py", line 66, in <module> case = ClosestPair(in_data=_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/tmph2_177ou/tmppuboy4zx.py", line 24, in __init__ self.p_num = int(in_data[0]) ~~~~~~~^^^ IndexError: list...
s530115706
p02373
u408260374
1482328592
Python
Python3
py
Runtime Error
640
35864
2003
class Edge: def __init__(self, dst, weight): self.dst, self.weight = dst, weight def __lt__(self, e): return self.weight > e.weight class Graph: def __init__(self, V): self.V = V self.E = [[] for _ in range(V)] def add_edge(self, src, dst, weight): self.E[src]...
Traceback (most recent call last): File "/tmp/tmp7kp3fmq7/tmpjw5tj7my.py", line 64, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s665391174
p02373
u408260374
1482328676
Python
Python3
py
Runtime Error
980
95504
2045
import sys sys.setrecursionlimit(10**6) class Edge: def __init__(self, dst, weight): self.dst, self.weight = dst, weight def __lt__(self, e): return self.weight > e.weight class Graph: def __init__(self, V): self.V = V self.E = [[] for _ in range(V)] def add_edge(se...
Traceback (most recent call last): File "/tmp/tmpzmvgiz0t/tmpl0mhnyur.py", line 68, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s810976017
p02373
u797673668
1488274450
Python
Python3
py
Runtime Error
450
27696
1025
from math import log2 def build(): dfs(tree, 0, -1, 0) pk0 = parent[0] for k in range(1, logn): pk1 = parent[k] for v in range(n): pkv = pk0[v] pk1[v] = -1 if pkv < 0 else pk0[pkv] pk0 = pk1 def dfs(tree, v, p, d): parent[0][v] = p depth[v] = d ...
Traceback (most recent call last): File "/tmp/tmps4s8exqh/tmp7zstlnap.py", line 40, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s841520214
p02373
u797673668
1488274533
Python
Python3
py
Runtime Error
1340
96168
1068
import sys sys.setrecursionlimit(100000) from math import log2 def build(): dfs(tree, 0, -1, 0) pk0 = parent[0] for k in range(1, logn): pk1 = parent[k] for v in range(n): pkv = pk0[v] pk1[v] = -1 if pkv < 0 else pk0[pkv] pk0 = pk1 def dfs(tree, v, p, d)...
Traceback (most recent call last): File "/tmp/tmpbmp8hsug/tmpr6f5lagk.py", line 44, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s972907851
p02373
u260980560
1500114790
Python
Python
py
Runtime Error
20
6688
1079
from collections import deque n = input() C = [None]*n P = [None]*n for i in xrange(n): ipt = map(int, raw_input().split()) C[i] = ipt[1:] for c in C[i]: P[c] = i LEV = (n+1).bit_length() parent = [[None]*(LEV + 1) for i in xrange(n)] for i in xrange(n): parent[i][0] = P[i] for k in xrange(1, L...
File "/tmp/tmpkkiek6vi/tmpx98xiox9.py", line 40 print u ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s551298889
p02373
u798803522
1508767122
Python
Python3
py
Runtime Error
70
8152
1225
import math from collections import defaultdict def dfs(here, p, d, parent, depth, connect): parent[0][here] = p depth[here] = d for next_v in connect[here]: dfs(next_v, here, d + 1, parent, depth, connect) def lca(v1, v2, parent, depth): if depth[v2] > depth[v1]: v1, v2 = v2, v1 f...
Traceback (most recent call last): File "/tmp/tmpn79v33d9/tmp7rgtaqc4.py", line 25, in <module> v_num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s807828051
p02373
u798803522
1508767226
Python
Python3
py
Runtime Error
720
24764
1233
import math from collections import defaultdict def dfs(here, p, d, parent, depth, connect): parent[0][here] = p depth[here] = d for next_v in connect[here]: dfs(next_v, here, d + 1, parent, depth, connect) def lca(v1, v2, parent, depth): if depth[v2] > depth[v1]: v1, v2 = v2, v1 f...
Traceback (most recent call last): File "/tmp/tmpi2n1i50d/tmpvb5o89ps.py", line 25, in <module> v_num = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s496228135
p02374
u847485844
1559098521
Python
Python
py
Runtime Error
0
0
3808
N = 10 ** 5 prt = [0] * (N + 1) left = [-1] + [0] * N right = [-1] + [0] * N sz = [0] + [1] * N key = [0] * (N + 1) val = [0] * (N + 1) rev = [0] * (N + 1) def update(i, l, r): # assert 1 <= i <= N sz[i] = 1 + sz[l] + sz[r] val[i] = key[i] + val[l] + val[r] def swap(i): if i: left[i], right[...
Traceback (most recent call last): File "/tmp/tmpb9qu_vt3/tmpplcdj78o.py", line 177, in <module> N = int(readline()) ^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s187726677
p02374
u210794057
1559302739
Python
Python
py
Runtime Error
0
0
1132
import sys   sys.setrecursionlimit(int(1e6))     class BIT:     def __init__(self, n):         self.n = n         self.data = [0] * (n + 1)       def get_sum(self, i):         ret = 0         while i > 0:             ret += self.data[i]             i -= (i & -i)         return ret       def add(self, i, w):         if ...
File "/tmp/tmpzvxdq0uk/tmpm0yddm4a.py", line 2   ^ SyntaxError: invalid non-printable character U+00A0
s013981205
p02374
u210794057
1559302763
Python
Python3
py
Runtime Error
0
0
1132
import sys   sys.setrecursionlimit(int(1e6))     class BIT:     def __init__(self, n):         self.n = n         self.data = [0] * (n + 1)       def get_sum(self, i):         ret = 0         while i > 0:             ret += self.data[i]             i -= (i & -i)         return ret       def add(self, i, w):         if ...
File "/tmp/tmpubomh9ox/tmprf_gqmj1.py", line 2   ^ SyntaxError: invalid non-printable character U+00A0
s325049396
p02374
u210794057
1559302929
Python
Python
py
Runtime Error
0
0
765
import sys sys.setrecursionlimit(int(1e6)) class BIT: def __init__(self, n): self.n = n self.data = [0] * (n + 1) def get_sum(self, i): ret = 0 while i > 0: ret += self.data[i] i -= (i & -i) return ret def add(self, i, w): if i == 0: return while i <= self.n: self.data[i] += w i += ...
Traceback (most recent call last): File "/tmp/tmp84xt1iz6/tmpr4jo2zed.py", line 34, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s859652526
p02374
u686180487
1559377937
Python
Python3
py
Runtime Error
0
0
843
# -*- coding: utf-8 -*- N = int(input()) G = [None for i in range(N)] for i in range(N): temp = list(map(int, input().split())) G[i] = temp[1:] INF = 2**31 -1 temp = 1 while temp < N: temp *= 2 lis = [INF for i in range(2*temp-1)] def getSum(x): x += temp-1 w_sum = lis[x] while x > 0: x = (x-1) //...
File "/tmp/tmpwmp4ulzf/tmp6lie5v55.py", line 50 print(getSum() ^ SyntaxError: '(' was never closed
s216836427
p02374
u686180487
1559378172
Python
Python3
py
Runtime Error
0
0
900
# -*- coding: utf-8 -*- N = int(input()) G = [None for i in range(N)] for i in range(N): temp = list(map(int, input().split())) G[i] = temp[1:] INF = 2**31 -1 temp = 1 while temp < N: temp *= 2 lis = [INF for i in range(2*temp-1)] def getSum(x): x += temp-1 w_sum = lis[x] while x > 0: x = (x-1) //...
File "/tmp/tmpld0h_huk/tmpowd09eg5.py", line 53 print(getSum(arr[0][querry[1]]) ^ SyntaxError: '(' was never closed
s254865021
p02374
u686180487
1559482826
Python
Python3
py
Runtime Error
130
6344
1026
# -*- coding: utf-8 -*- class weightRtree: def __init__(self, num): self.num = num self.weight = [0] * (num+1) def add(self, v, w): if v == 0: return 0 while v <= self.num: self.weight[v] += w v += (-v) & v def getSum(self, u):...
Traceback (most recent call last): File "/tmp/tmpzidnbtd5/tmpwhyjlleb.py", line 21, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s682078303
p02376
u138546245
1535991164
Python
Python3
py
Runtime Error
20
5716
2157
from heapq import heappush, heappop class Edge: __slots__ = ('src', 'dest', 'capacity', 'flow') def __init__(self, v, w, capacity): self.src = v self.dest = w self.capacity = capacity self.flow = 0 def other(self, v): if v == self.src: return self.dest...
Traceback (most recent call last): File "/tmp/tmpl1ofrruc/tmpi4a9oo9l.py", line 93, in <module> run() File "/tmp/tmpl1ofrruc/tmpi4a9oo9l.py", line 81, in run v, e = [int(i) for i in input().split()] ^^^^^^^ EOFError: EOF when reading a line
s388674928
p02376
u419946054
1559523041
Python
Python3
py
Runtime Error
0
0
2046
V, E = map(int, input().split()) # -*- coding: utf-8 -*- import collections import queue class Dinic(): def __init__(self, N): self.N = N self.edges = collections.defaultdict(list) self.level = [0] * N self.iter = [0] * N def add(self, u, v, c, directed=True): """ ...
Traceback (most recent call last): File "/tmp/tmp_a4orcti/tmp7_cqs5g4.py", line 1, in <module> V, E = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s029485610
p02376
u647766105
1430392043
Python
Python
py
Runtime Error
0
0
1690
#test def ford_fulkerson(graph, source, sink): N = len(graph) def dfs(cur_node, visited): if cur_node == source: flag = True while flag: flag = False for next_node in xrange(N): if graph[cur_node][next_node] <= 0: ...
File "/tmp/tmpzkn_ardr/tmp9k_rnytt.py", line 44 print graph[0][source] ^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s245353289
p02376
u766807750
1432297930
Python
Python3
py
Runtime Error
0
0
1382
def read_data(): nV, nE = map(int, input().split()) cf = [dict() for v in range(nV)] for e in range(nE): u, v, c = map(int, input().split()) if u == t or v == s: continue C[u][v] = c C[v][u] = 0 return C, nV, 0, nV - 1 def dinic(cf, nV, s, t): dist = get_...
Traceback (most recent call last): File "/tmp/tmp8ecorvsf/tmpinawcx98.py", line 48, in <module> C, nV, s, t = read_data() ^^^^^^^^^^^ File "/tmp/tmp8ecorvsf/tmpinawcx98.py", line 2, in read_data nV, nE = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a l...
s413670266
p02376
u766807750
1432298046
Python
Python3
py
Runtime Error
0
0
1381
def read_data(): nV, nE = map(int, input().split()) C = [dict() for v in range(nV)] for e in range(nE): u, v, c = map(int, input().split()) if u == t or v == s: continue C[u][v] = c C[v][u] = 0 return C, nV, 0, nV - 1 def dinic(cf, nV, s, t): dist = get_d...
Traceback (most recent call last): File "/tmp/tmpemboeeo5/tmpbvquyjzj.py", line 48, in <module> C, nV, s, t = read_data() ^^^^^^^^^^^ File "/tmp/tmpemboeeo5/tmpbvquyjzj.py", line 2, in read_data nV, nE = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a l...
s306761428
p02376
u408260374
1433586979
Python
Python3
py
Runtime Error
40
6772
1623
class FordFulkerson: """Ford-Fulkerson Algorithm: find max-flow complexity: O(FE) (F: max flow) """ def __init__(self, V, E, source, sink): """ V: the number of vertexes E: adjacency list source: start point sink: goal point """ self.V = V ...
Traceback (most recent call last): File "/tmp/tmpptlk8x0l/tmpzxhlrsjv.py", line 44, in <module> V, E = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s951337363
p02376
u408260374
1433587196
Python
Python3
py
Runtime Error
30
6784
1662
import sys sys.setrecursionlimit(3000) class FordFulkerson: """Ford-Fulkerson Algorithm: find max-flow complexity: O(FE) (F: max flow) """ def __init__(self, V, E, source, sink): """ V: the number of vertexes E: adjacency list source: start point sink: goal...
Traceback (most recent call last): File "/tmp/tmp8l1k69tw/tmpwwkhvb86.py", line 46, in <module> V, E = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s023075135
p02376
u408260374
1433661442
Python
Python3
py
Runtime Error
0
0
2352
from collections import deque class Dinic: """Dinic Algorithm: find max-flow complexity: O(EV^2) """ class edge: def __init__(self, to, cap, rev): self.to, self.cap, self.rev = to, cap, rev def __init__(self, V, E, source, sink): """ V: the number of vertexes ...
Traceback (most recent call last): File "/tmp/tmpu33vpc24/tmp09g4hgc5.py", line 69, in <module> V, E = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s022150152
p02376
u797673668
1461730468
Python
Python3
py
Runtime Error
60
8776
1225
from queue import deque def hierarchize(source): global edges, hierarchy hierarchy = [-1] * n queue = deque([(0, source)]) while queue: h, v = queue.popleft() if hierarchy[v] != -1: continue hierarchy[v] = h if v == sink: return True queu...
Traceback (most recent call last): File "/tmp/tmp03vip9u8/tmpl6vd5l8l.py", line 39, in <module> n, m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s992039711
p02376
u797673668
1461730505
Python
Python3
py
Runtime Error
40
8752
1267
import sys from queue import deque sys.setrecursionlimit(200000) def hierarchize(source): global edges, hierarchy hierarchy = [-1] * n queue = deque([(0, source)]) while queue: h, v = queue.popleft() if hierarchy[v] != -1: continue hierarchy[v] = h if v == ...
Traceback (most recent call last): File "/tmp/tmpjxp9ksbr/tmpp213ura9.py", line 42, in <module> n, m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s169232643
p02376
u797673668
1461730565
Python
Python3
py
Runtime Error
40
8824
1267
import sys from queue import deque sys.setrecursionlimit(500000) def hierarchize(source): global edges, hierarchy hierarchy = [-1] * n queue = deque([(0, source)]) while queue: h, v = queue.popleft() if hierarchy[v] != -1: continue hierarchy[v] = h if v == ...
Traceback (most recent call last): File "/tmp/tmpily28id6/tmp7ivztefq.py", line 42, in <module> n, m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s307968750
p02376
u797673668
1461731046
Python
Python3
py
Runtime Error
20
7840
1266
def hierarchize(source): global edges, hierarchy l, r = 0, 1 hierarchy = [-1] * n hierarchy[source] = 0 queue[0] = source while l != r: v = queue[l] l += 1 if v == sink: break for remain, target, idx in edges[v]: if hierarchy[target] == -1 ...
Traceback (most recent call last): File "/tmp/tmph4di6zod/tmplv034zlz.py", line 39, in <module> n, m = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s412754155
p02376
u766163292
1468497395
Python
Python3
py
Runtime Error
2230
17292
2416
#!/usr/bin/env python3 # Based on https://en.wikipedia.org/wiki/Ford???Fulkerson_algorithm import collections import sys import uuid REC_LIMIT = 10000 class Edge(object): def __init__(self, source, sink, capacity): self.source = source self.sink = sink self.capacity = capacity ...
Traceback (most recent call last): File "/tmp/tmpldfngrav/tmpwla6gpgu.py", line 84, in <module> main() File "/tmp/tmpldfngrav/tmpwla6gpgu.py", line 75, in main v, e = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s182046559
p02376
u022407960
1481010021
Python
Python3
py
Runtime Error
0
0
1933
#!/usr/bin/env python # -*- coding: utf-8 -*- """ input: 4 5 0 1 2 0 2 1 1 2 1 1 3 1 2 3 2 output: 3 """ import sys from collections import deque def graph_bfs(source, target, parent): visited = [False] * v_num queue = deque() queue.appendleft(source) visited[source] = True while queue: ...
Traceback (most recent call last): File "/tmp/tmpus52giwo/tmp5z_otwss.py", line 77, in <module> v_num, e_num = map(int, _input[0].split()) ~~~~~~^^^ IndexError: list index out of range
s389260098
p02376
u072053884
1486747675
Python
Python3
py
Runtime Error
30
7916
1643
# Acceptance of input import sys file_input = sys.stdin V, E = map(int, file_input.readline().split()) adj_mat = [[0] * V for i in range(V)] for line in file_input: u, v, c = map(int, line.split()) adj_mat[u][v] = c # Dinic's algorithm import collections # BFS for residual capacity network to construct ...
Traceback (most recent call last): File "/tmp/tmpwt6xr38_/tmpj7otpmry.py", line 7, in <module> V, E = map(int, file_input.readline().split()) ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s462366180
p02376
u072053884
1486780992
Python
Python3
py
Runtime Error
30
7952
1707
# Acceptance of input import sys file_input = sys.stdin V, E = map(int, file_input.readline().split()) adj_mat = [[0] * V for i in range(V)] for line in file_input: u, v, c = map(int, line.split()) adj_mat[u][v] = c # Dinic's algorithm import collections # BFS for residual capacity network to construct ...
Traceback (most recent call last): File "/tmp/tmp9uydrlpv/tmpebjsz3d_.py", line 7, in <module> V, E = map(int, file_input.readline().split()) ^^^^ ValueError: not enough values to unpack (expected 2, got 0)
s000637086
p02376
u352394527
1528856584
Python
Python3
py
Runtime Error
30
6008
805
from collections import deque INF = 10 ** 20 V, E = map(int, input().split()) net = [[0] * V for _ in range(V)] for _ in range(E): u, v, c = map(int, input().split()) net[u][v] = c start = 0 goal = V - 1 def check_net(node, path, capacity): for i in range(V): cap = net[node][i] if cap != 0: if i...
Traceback (most recent call last): File "/tmp/tmpb2fzn3bh/tmpcc9s4jea.py", line 5, in <module> V, E = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s728249748
p02377
u797673668
1461749600
Python
Python3
py
Runtime Error
40
7900
1396
from heapq import heappop, heappush def trace(source, edge_trace): v = source for i in edge_trace: e = edges[v][i] yield e v = e[1] def min_cost_flow(source, sink, required_flow): res = 0 while required_flow: visited = set() queue = [(0, source, tuple())] ...
Traceback (most recent call last): File "/tmp/tmpc0y4_6q8/tmpytuyxdld.py", line 41, in <module> n, m, f = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s152935436
p02377
u798803522
1508603195
Python
Python3
py
Runtime Error
0
0
1601
v_num, e_num, flow = (int(n) for n in input().split(" ")) edges = defaultdict(list) for _ in range(e_num): s1, t1, cap, cost = (int(n) for n in input().split(" ")) edges[s1].append([t1, cap, cost, len(edges[t1])]) edges[t1].append([s1, cap, cost, len(edges[s1])]) answer = 0 before_vertice = [float("inf") fo...
Traceback (most recent call last): File "/tmp/tmpnois9c1s/tmpa07simbb.py", line 1, in <module> v_num, e_num, flow = (int(n) for n in input().split(" ")) ^^^^^^^ EOFError: EOF when reading a line
s891004489
p02377
u798803522
1508662467
Python
Python3
py
Runtime Error
0
0
909
from collections import defaultdict import sys sys.setrecursionlimit(200000) def dfs(source, used, all_weight, connect): max_weight = all_weight max_source = source used[source] = 1 for target, weight in connect[source]: if not used[target]: now_weight = all_weight + weight ...
Traceback (most recent call last): File "/tmp/tmpq63fmuoh/tmpgbxw1jid.py", line 18, in <module> vertice = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s072263069
p02377
u176732165
1523420075
Python
Python
py
Runtime Error
0
0
2851
# -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import sys import csv import argparse import time import heapq INF = sys.maxint/3 class Edge: def __init__(self, to, cap, cost, rev): self.to = to self.cap = cap self.cost =...
File "/tmp/tmporsifkbd/tmp2a_0za00.py", line 22 print "to: {0}, cap: {1}, cost: {2}, rev: {3}".format(self.to, self.cap, self.cost, self.rev) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(.....
s507700073
p02377
u176732165
1523420102
Python
Python
py
Runtime Error
0
0
2827
import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import sys import csv import argparse import time import heapq INF = sys.maxint/3 class Edge: def __init__(self, to, cap, cost, rev): self.to = to self.cap = cap self.cost = cost self.rev =...
File "/tmp/tmpr57gn0os/tmp_nfszgub.py", line 21 print "to: {0}, cap: {1}, cost: {2}, rev: {3}".format(self.to, self.cap, self.cost, self.rev) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(.....