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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s681464459 | p02238 | u970436839 | 1454337993 | Python | Python | py | Runtime Error | 0 | 0 | 540 | n = input()
color = [0 for i in range(n)]
d = [0 for i in range(n)]
f = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
t = 0
def dfsv(u):
color[u] = 1
t += 1
d[u] = t
for v in range(n):
if M[u][v] == 1 and color[v] == 0:
dfsv(v)
color[u] = 2
t += 1
f[u] = t
def dfs():
f... | File "/tmp/tmp4nrgv08k/tmpce3o7931.py", line 25
print u+1, d[u], f[u]
^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s953295337 | p02238 | u970436839 | 1454338458 | Python | Python | py | Runtime Error | 0 | 0 | 568 | n = input()
color = [0 for i in range(n)]
d = [0 for i in range(n)]
f = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
X = [0 for i in range(n)]
def dfsv(u):
color[u] = 1
t += 1
d[u] = t
for v in range(n):
if M[u][v] == 1 and color[v] == 0:
dfsv(v)
color[u] = 2
t += 1
f[u]... | File "/tmp/tmpzuhwqhfa/tmpx5vjft6m.py", line 26
print u+1, d[u], f[u]
^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s973740997 | p02238 | u970436839 | 1454338476 | Python | Python | py | Runtime Error | 0 | 0 | 569 | n = input()
color = [0 for i in range(n)]
d = [0 for i in range(n)]
f = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
X = [0 for i in range(n)]
def dfsv(u):
color[u] = 1
t += 1
d[u] = t
for v in range(n):
if M[u][v] == 1 and color[v] == 0:
dfsv(v)
color[u] == 2
t += 1
f[u... | File "/tmp/tmpa3e0cnxa/tmpq32itjx1.py", line 26
print u+1, d[u], f[u]
^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s715656881 | p02238 | u970436839 | 1454338646 | Python | Python | py | Runtime Error | 0 | 0 | 570 | n = input()
color = [0 for i in range(n)]
d = [0 for i in range(n)]
f = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
X = [0 for i in range(n)]
def dfsv(u):
color[u] = 1
t += 1
d[u] = t
for v in range(n):
if M[u][v] == 1 and color[v] == 0:
dfsv(v)
color[u] = 2
t += 1
f[u]... | Traceback (most recent call last):
File "/tmp/tmpwvxrsoev/tmpesa_i9i3.py", line 1, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s690502768 | p02238 | u970436839 | 1454339021 | Python | Python | py | Runtime Error | 0 | 0 | 566 | n = input()
color = [0 for i in range(n)]
d = [0 for i in range(n)]
f = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
X = [0 for i in range(n)]
t = 0
def DFSv(u):
color[u] = 1
t += 1
d[u] = t
for v in range(n):
if M[u][v] == 1 and color[v] == 0:
DFSv(v)
color[u] = 2
t += 1
... | File "/tmp/tmpa2co21nf/tmpxdqiq73f.py", line 26
print u+1, d[u], f[u]
^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s620225394 | p02238 | u970436839 | 1454339141 | Python | Python | py | Runtime Error | 0 | 0 | 566 | n = input()
color = [0 for i in range(n)]
d = [0 for i in range(n)]
f = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
X = [0 for i in range(n)]
t = 0
def DFSv(u):
color[u] = 1
t += 1
d[u] = t
for v in range(n):
if M[u][v] == 1 and color[v] == 0:
DFSv(v)
color[u] = 2
t += 1
... | File "/tmp/tmp9nrdx_r8/tmp2b8m5pln.py", line 26
print u+1, d[u], f[u]
^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s184233861 | p02238 | u970436839 | 1454339329 | Python | Python | py | Runtime Error | 0 | 0 | 1194 | n = input()
color = [0 for i in range(n)]
d = [0 for i in range(n)]
f = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
X = [0 for i in range(n)]
t = 0
def DFSv(u):
color[u] = 1
t += 1
d[u] = t
for v in range(n):
if M[u][v] == 1 and color[v] == 0:
DFSv(v)
color[u] = 2
t += 1
... | File "/tmp/tmphycza29k/tmp46mg07sy.py", line 60
print u+1, d[u], f[u])
^
SyntaxError: unmatched ')'
| |
s683675979 | p02238 | u970436839 | 1454339339 | Python | Python | py | Runtime Error | 0 | 0 | 631 | n = input()
d = [0 for i in range(n)]
f = [0 for i in range(n)]
X = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
color = [0 for i in range(n)]
t = 0
def DFS_v(u):
color[u] = 1
t += 1
d[u] = t[0]
for v in range(n):
if M[u][v] == 1 and st[v] == 0:
DFS_visit(v... | File "/tmp/tmpsy997pjf/tmptt1lkz8j.py", line 26
print u+1, d[u], f[u])
^
SyntaxError: unmatched ')'
| |
s905001498 | p02238 | u970436839 | 1454339367 | Python | Python | py | Runtime Error | 0 | 0 | 628 | n = input()
d = [0 for i in range(n)]
f = [0 for i in range(n)]
X = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
color = [0 for i in range(n)]
t = 0
def DFS_v(u):
color[u] = 1
t += 1
d[u] = t
for v in range(n):
if M[u][v] == 1 and st[v] == 0:
DFS_visit(v)
... | File "/tmp/tmpzvwui5c0/tmpqil3wr8c.py", line 26
print u+1, d[u], f[u])
^
SyntaxError: unmatched ')'
| |
s997973527 | p02238 | u970436839 | 1454339415 | Python | Python | py | Runtime Error | 0 | 0 | 631 | n = input()
d = [0 for i in range(n)]
f = [0 for i in range(n)]
X = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
color = [0 for i in range(n)]
t = 0
def DFS_v(u):
color[u] = 1
t += 1
d[u] = t
for v in range(n):
if M[u][v] == 1 and color[v] == 0:
DFS_visit(v... | File "/tmp/tmpp0tyn7jg/tmpfc87xxah.py", line 26
print u+1, d[u], f[u])
^
SyntaxError: unmatched ')'
| |
s231604861 | p02238 | u970436839 | 1454339426 | Python | Python | py | Runtime Error | 0 | 0 | 634 | n = input()
d = [0 for i in range(n)]
f = [0 for i in range(n)]
X = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
color = [0 for i in range(n)]
t = 0
def DFS_v(u):
color[u] = 1
t += 1
d[u] = t
for v in range(n):
if M[u][v] == 1 and color[v] == 0:
DFS_visit(v... | File "/tmp/tmp_7ivq1hi/tmpetb6t4lt.py", line 26
print u+1, d[u], f[u])
^
SyntaxError: unmatched ')'
| |
s211485008 | p02238 | u970436839 | 1454339481 | Python | Python | py | Runtime Error | 0 | 0 | 648 | n = input()
d = [0 for i in range(n)]
f = [0 for i in range(n)]
X = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
color = [0 for i in range(n)]
t = [0]
def DFS_v(u):
color[u] = 1
t[0] += 1
d[u] = t[0]
for v in range(n):
if M[u][v] == 1 and color[v] == 0:
DFS... | File "/tmp/tmpcehrhst4/tmpztxesys5.py", line 26
print u+1, d[u], f[u])
^
SyntaxError: unmatched ')'
| |
s154092211 | p02238 | u970436839 | 1454339604 | Python | Python | py | Runtime Error | 0 | 0 | 643 | n = int(raw_input())
d = [0 for i in range(n)]
f = [0 for i in range(n)]
X = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
color = [0 for i in range(n)]
t = 0
def DFS_v(u):
color[u] = 1
t += 1
d[u] = t
for v in range(n):
if M[u][v] == 1 and color[v] == 0:
DF... | File "/tmp/tmp017niwwf/tmpkpi6p1zd.py", line 26
print u+1, d[u], f[u])
^
SyntaxError: unmatched ')'
| |
s212422283 | p02238 | u970436839 | 1454339665 | Python | Python | py | Runtime Error | 0 | 0 | 633 | n = input()
d = [0 for i in range(n)]
f = [0 for i in range(n)]
X = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
color = [0 for i in range(n)]
t = 0
def DFS_v(u):
color[u] = 1
t += 1
d[u] = t
for v in range(n):
if M[u][v] == 1 and color[v] == 0:
DFS_visit(v... | File "/tmp/tmpt7_n7bpz/tmpxw177e_h.py", line 26
print u+1, d[u], f[u]
^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s997474322 | p02238 | u970436839 | 1454339704 | Python | Python | py | Runtime Error | 0 | 0 | 647 | n = input()
d = [0 for i in range(n)]
f = [0 for i in range(n)]
X = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
color = [0 for i in range(n)]
t = 0
def DFS_v(u):
color[u] = 1
t += 1
d[u] = t
for v in range(n):
if M[u][v] == 1 and color[v] == 0:
DFS_visit(v... | File "/tmp/tmpgu05fkh_/tmp9i36vhb4.py", line 26
print "%d %d %d" %(u+1, d[u], f[u])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s589580079 | p02238 | u970436839 | 1454339791 | Python | Python | py | Runtime Error | 0 | 0 | 646 | n = input()
d = [0 for i in range(n)]
f = [0 for i in range(n)]
X = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
color = [0 for i in range(n)]
t = 0
def DFS_v(u):
color[u] = 1
t += 1
d[u] = t
for v in range(n):
if M[u][v] == 1 and color[v] == 0:
DFS_visit(v... | File "/tmp/tmpntsotv_w/tmp7vpgg527.py", line 26
print "%d %d %d" %(u+1, d[u], f[u])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s093072660 | p02238 | u970436839 | 1454340330 | Python | Python | py | Runtime Error | 0 | 0 | 589 | n = input()
d = [0 for i in range(n)]
f = [0 for i in range(n)]
X = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
color = [0 for i in range(n)]
t = 0
def DFS_v(u):
color[u] = 1
t += 1
d[u] = t
for v in range(n):
if M[u][v] == 1 and color[v] == 0:
DFS_v(v)
color[u] = 2
t +... | File "/tmp/tmpp0fxjpm7/tmpe2jj6yoc.py", line 26
print "%d %d %d" %(u+1, d[u], f[u])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s365547628 | p02238 | u970436839 | 1454340483 | Python | Python | py | Runtime Error | 0 | 0 | 589 | n = input()
d = [0 for i in range(n)]
f = [0 for i in range(n)]
X = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
color = [0 for i in range(n)]
t = 0
def DFS_v(u):
color[u] = 1
t += 1
d[u] = t
for v in range(n):
if M[u][v] == 1 and color[v] == 0:
DFS_v(v)
color[u] = 2
t +... | File "/tmp/tmpxh9e83vl/tmpayywzpda.py", line 26
print '%d %d %d' %(u+1, d[u], f[u])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s246705085 | p02238 | u970436839 | 1454340648 | Python | Python | py | Runtime Error | 0 | 0 | 669 | n = int(raw_input())
d = [0 for i in range(n)]
f = [0 for i in range(n)]
X = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
col = [0 for i in range(n)]
t = [0]
def DFS_visit(u):
col[u] = 1
t[0] += 1
d[u] = t[0]
for v in range(n):
if M[u][v] == 1 and col[v] == 0:
... | File "/tmp/tmpnaed3n3q/tmpa9ibajbp.py", line 26
print'{0} {1} {2}'.format(s+1, d[s], f[s])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s796074038 | p02238 | u970436839 | 1454340707 | Python | Python | py | Runtime Error | 0 | 0 | 669 | n = int(raw_input())
d = [0 for i in range(n)]
f = [0 for i in range(n)]
G = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
col = [0 for i in range(n)]
t = [0]
def DFS_visit(u):
col[u] = 1
t[0] += 1
d[u] = t[0]
for v in range(n):
if M[u][v] == 1 and col[v] == 0:
... | File "/tmp/tmpp4lkd_31/tmp72f12g5e.py", line 26
print'{0} {1} {2}'.format(s+1, d[s], f[s])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s266267617 | p02238 | u078762447 | 1454344566 | Python | Python | py | Runtime Error | 0 | 0 | 420 | import sys
def dfs(i, t, l, a, b):
t += 1
a[i] = t
for j in l[i]:
if not a[j-1]:
t = dfs(j-1, t, l, a, b)
t += 1
b[i] = t
return t
n = input()
l=[]
for i in range(n):
x = int(s) for s in sys.stdin.readline().split()[2:]
l.append(x)
a = [0] * n
b = [0] * n
t = 0
for i in xran... | File "/tmp/tmpslnsr4nz/tmp0dlyh73m.py", line 17
x = int(s) for s in sys.stdin.readline().split()[2:]
^^^
SyntaxError: invalid syntax
| |
s771453568 | p02238 | u824204304 | 1454406664 | Python | Python | py | Runtime Error | 0 | 0 | 645 | n = int(raw_input())
d = [0 for i in range(n)]
f = [0 for i in range(n)]
a = [[0 for i in range(n)] for j in range(n)]
st = [0 for i in range(n)]
time = [0]
G = [0 for i in range(n)]
def dfs_visit(s):
st[s] = 1
time[0] += 1
d[s] = time[0]
for k in range(n):
if a[s][k] == 1 and st[k] == 0:... | Traceback (most recent call last):
File "/tmp/tmp8yq5yp98/tmp_ywcnzff.py", line 1, in <module>
n = int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s685187377 | p02238 | u824204304 | 1454406671 | Python | Python | py | Runtime Error | 0 | 0 | 645 | n = int(raw_input())
d = [0 for i in range(n)]
f = [0 for i in range(n)]
a = [[0 for i in range(n)] for j in range(n)]
st = [0 for i in range(n)]
time = [0]
G = [0 for i in range(n)]
def dfs_visit(s):
st[s] = 1
time[0] += 1
d[s] = time[0]
for k in range(n):
if a[s][k] == 1 and st[k] == 0:... | Traceback (most recent call last):
File "/tmp/tmpyd475wvc/tmpyuksw5vc.py", line 1, in <module>
n = int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s458887327 | p02238 | u824204304 | 1454406711 | Python | Python | py | Runtime Error | 0 | 0 | 645 | n = int(raw_input())
d = [0 for i in range(n)]
f = [0 for i in range(n)]
a = [[0 for i in range(n)] for j in range(n)]
st = [0 for i in range(n)]
time = [0]
G = [0 for i in range(n)]
def dfs_visit(s):
st[s] = 1
time[0] += 1
d[s] = time[0]
for k in range(n):
if a[s][k] == 1 and st[k] == 0:... | Traceback (most recent call last):
File "/tmp/tmp4w26jpnz/tmppr0w507n.py", line 1, in <module>
n = int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s778433591 | p02238 | u630265299 | 1454413661 | Python | Python | py | Runtime Error | 0 | 0 | 684 | n = int(raw_input())
d = [0 for i in range(n)]
f = [0 for i in range(n)]
a = [[0 for i in range(n)] for j in range(n)]
st = [0 for i in range(n)]
time = [0]
g = [0 for i in range(n)]
def dfs_visit(s):
st[s] = 1
time[0] += 1
d[s] = time[0]
for k in range(n):
if a[s][k] == 1 and st[k] ... | File "/tmp/tmp_o7rcvyg/tmpkci3r_03.py", line 28
print'{0} {1} {2}'.format(s+1, d[s], f[s])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s149860711 | p02238 | u630265299 | 1454413748 | Python | Python | py | Runtime Error | 0 | 0 | 683 | n = int(raw_input())
d = [0 for i in range(n)]
f = [0 for i in range(n)]
a = [[0 for i in range(n)] for j in range(n)]
st = [0 for i in range(n)]
time = [0]
g = [0 for i in range(n)]
def dfs_visit(s):
st[s] = 1
time[0] += 1
d[s] = time[0]
for k in range(n):
if a[s][k] == 1 and st[k] ... | File "/tmp/tmptbioqvfi/tmps00dpfvn.py", line 28
print'{0} {1} {2}'.format(s+1, d[s], f[s])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s335962664 | p02238 | u563876281 | 1454417472 | Python | Python | py | Runtime Error | 0 | 0 | 639 | def depth(s, time):
time += 1
f[s] = 1
d[s] = t
for i in range(1, n+1):
if G[s][i] == 1:
if f[i] == 0:
depth(i, time)
t = f[i]
f[s] = time + 1
n = int(raw_input())
G = [[0 for i in range(n+1)] for j in range(n+1)]
d = [0 for i in range(n+1)]
f = ... | Traceback (most recent call last):
File "/tmp/tmp9842x8g_/tmpmv3kxazd.py", line 12, in <module>
n = int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s056922577 | p02238 | u563876281 | 1454417551 | Python | Python | py | Runtime Error | 0 | 0 | 645 | def depth(s, time):
time += 1
flag[s] = 1
d[s] = t
for i in range(1, n+1):
if G[s][i] == 1:
if flag[i] == 0:
depth(i, time)
t = f[i]
f[s] = time + 1
n = int(raw_input())
G = [[0 for i in range(n+1)] for j in range(n+1)]
d = [0 for i in range(n+1)... | Traceback (most recent call last):
File "/tmp/tmp498jvkaw/tmprvnv9hkc.py", line 12, in <module>
n = int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s903041384 | p02238 | u563876281 | 1454417883 | Python | Python | py | Runtime Error | 0 | 0 | 645 | def depth(s, time):
time += 1
flag[s] = 1
d[s] = t
for i in range(1, n+1):
if G[s][i] == 1:
if flag[i] == 0:
depth(i, time)
t = f[i]
f[s] = time + 1
n = int(raw_input())
G = [[0 for i in range(n+1)] for j in range(n+1)]
d = [0 for i in range(n+1)... | Traceback (most recent call last):
File "/tmp/tmpx659kkh6/tmp8e2x8sav.py", line 12, in <module>
n = int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s870628373 | p02238 | u424209323 | 1454420591 | Python | Python | py | Runtime Error | 0 | 0 | 892 | N = 100
M = [[0 for i in range(N)] for j in range(N)]
color = [0 for i in range(N)]
d = [0 for i in range(N)]
f = [0 for i in range(N)]
tt = 0
###
def dfs_visit(u):
color[u] = 1
tt = tt + 1
d[u] = tt
for v in range(n):
if M[u][v] == 0:
continue
if color[... | File "/tmp/tmp4dptq_6l/tmpdkn1bs_p.py", line 35
print "%d %d %d" %(u + 1, d[u], f[u])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s887691671 | p02238 | u663227983 | 1454421885 | Python | Python | py | Runtime Error | 0 | 0 | 364 | n=0
m=input()
c=[0 for i in xrange(m)]
t=[0 for i in xrange(m)]
def d(u):
global n
if ts[u]:return
n = n + 1
ts[u]=[u+1,n]
for i in c[u]:d(i-1)
n = n + 1
ts[u][2:]=[n]
def dfs():
for i in range(m):
l=map(int,raw_input().split())
c[l[0]-1]=l[2:]
for i in range(m):
d(... | File "/tmp/tmp35tujivs/tmpj2ejsxgy.py", line 22
print " ".join(map(str,t[i]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s384982787 | p02238 | u663227983 | 1454421896 | Python | Python | py | Runtime Error | 0 | 0 | 365 | n=0
m=input()
c=[0 for i in xrange(m)]
t=[0 for i in xrange(m)]
def d(u):
global n
if ts[u]:return
n = n + 1
ts[u]=[u+1,n]
for i in c[u]:d(i-1)
n = n + 1
ts[u][2:]=[n]
def dfs():
for i in range(m):
l=map(int,raw_input().split())
c[l[0]-1]=l[2:]
for i in range(m):
d(... | File "/tmp/tmp14p5axcx/tmp5egjntlu.py", line 22
print " ".join(map(str,ts[i]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s446645088 | p02238 | u038005340 | 1454422463 | Python | Python | py | Runtime Error | 0 | 0 | 703 | n = int( raw_input() )
d = [ 0 for i in range(n) ]
f = [ 0 for i in range(n) ]
G = [ 0 for i in range(n) ]
v = [ [0 for i in range(n) ] for j in range(n) ]
st = [ 0 for i in range(n) ]
tm = [ 0 ]
def DFS_visit(s):
st[ s ] = 1
tm[ 0 ] += 1
d[ s ] = tm[ 0 ]
for e in range(n):
if v[ s ][ e ] == 1 and s... | File "/tmp/tmpn57e_gna/tmpa1oo4vpc.py", line 26
print'{ 0 } { 1 } { 2 }'.format( s+1 , d[ s ] , f[ s ] )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s410085817 | p02238 | u038005340 | 1454422526 | Python | Python | py | Runtime Error | 0 | 0 | 701 | n = int(raw_input())
d = [ 0 for i in range(n) ]
f = [ 0 for i in range(n) ]
G = [ 0 for i in range(n) ]
v = [ [0 for i in range(n) ] for j in range(n) ]
st = [ 0 for i in range(n) ]
tm = [ 0 ]
def DFS_visit(s):
st[ s ] = 1
tm[ 0 ] += 1
d[ s ] = tm[ 0 ]
for e in range(n):
if v[ s ][ e ] == 1 and st[... | File "/tmp/tmphc41xqa_/tmpeb0zc42k.py", line 26
print'{ 0 } { 1 } { 2 }'.format( s+1 , d[ s ] , f[ s ] )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s457334338 | p02238 | u885889402 | 1454425436 | Python | Python3 | py | Runtime Error | 0 | 0 | 616 | def curserch(N,k,t,P,n):
g = 0
t = t+1
P[k]["d"] = t
for i in range(1,n+1):
if N[k][i]==1 and P[i]["d"]==0:
P[i]["f"] = g = curserch(N,i,t,P,n)
if g !=0:
return g+1
else:
return t+1
n = int(input())
A = [[0 for j in range(n+1)] for i in range(n+1)]
for i in... | Traceback (most recent call last):
File "/tmp/tmpl33s7bwm/tmpb67ojg3u.py", line 13, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s111087398 | p02238 | u885889402 | 1454425547 | Python | Python3 | py | Runtime Error | 0 | 0 | 612 | def curserch(N,k,t,P,n):
g = 0
t = t+1
P[k]["d"] = t
for i in range(1,n+1):
if N[k][i]==1 and P[i]["d"]==0:
P[i]["f"] = g = curserch(N,i,t,P,n)
if g !=0:
return g+1
else:
return t+1
n = int(input())
A = [[0 for j in range(n+1)] for i in range(n+1)]
for i in... | Traceback (most recent call last):
File "/tmp/tmp9yoh3yfj/tmp68t3x2dp.py", line 13, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s264769312 | p02238 | u564398841 | 1485187201 | Python | Python3 | py | Runtime Error | 0 | 0 | 1229 | def dfs(u, node_info, matrix):
# ????????????????????¨??????????????????
colors = [0] * len(matrix)
detect_time = [0] * len(matrix)
finished_time = [0] * len(matrix)
time = 1
stack = list()
stack.append(u)
colors[u] = 1
detect_time[u] = time
while len(stack):
for i, val i... | File "/tmp/tmp7asq6ley/tmpui_pxj9w.py", line 42
dfs(0, None, matrix)
^
IndentationError: expected an indented block after 'for' statement on line 41
| |
s699636516 | p02238 | u112247126 | 1488334377 | Python | Python3 | py | Runtime Error | 0 | 0 | 1105 | from collections import deque
def dfs(root):
global time
stack.append(root)
color[root] = 'gray'
arrive[root] = time
time += 1
while len(stack) > 0:
node = stack[-1]
for next in range(n):
if adjMat[node][next] == 1:
if color[next] == 'white':
... | File "/tmp/tmpq0wamvcr/tmpkr6584mo.py", line 45
if color[root] = 'white':
^^^^^^^^^^^
SyntaxError: cannot assign to subscript here. Maybe you meant '==' instead of '='?
| |
s789523220 | p02238 | u112247126 | 1488335270 | Python | Python3 | py | Runtime Error | 0 | 0 | 701 | def dfs_recursive(u):
global time
color[u] = 'gray'
arrive[u] = time
time += 1
for v in range(n):
if adjMat[u][v] == 1 and color[v] == 'white':
dfs_recursive(v)
color[u] = 'black'
finish[u] = time
time += 1
n = int(input())
adjMat = [[0] * n for _ in range(n)]
colo... | Traceback (most recent call last):
File "/tmp/tmp43hanz5p/tmpzyz69ccm.py", line 14, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s435947941 | p02238 | u735204496 | 1500613946 | Python | Python | py | Runtime Error | 0 | 0 | 948 | import sys
d_num = int(sys.stdin.readline().strip())
graph_list = []
for _ in range(0, d_num):
array = sys.stdin.readline().strip().split(" ")
if len(array) > 2:
graph_list.append([])
else:
graph_list.append([int(array[i]) for i in range(2, len(array))])
t = 1
result = [[] for _ in range... | File "/tmp/tmpay9eqzge/tmpguhc0wic.py", line 37
print str(i+1) + " " + str(result[i][0] + 1) + " " + str(result[i][1] + 1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s861036808 | p02238 | u858885710 | 1500625898 | Python | Python3 | py | Runtime Error | 0 | 0 | 594 | from sys import stdin
d_num = int(stdin.readline().strip())
graph = [[] for _ in range(d_num+1)]
for _ in range(d_num):
u, k, *neighbors = map(int, stdin.readline().split())
for v in neighbors:
graph[u].append(v)
visited = set()
timestamps = [None for _ in range(d_num+1)]
def dfs(u, stmp):
visit... | Traceback (most recent call last):
File "/tmp/tmp2_ypc_9a/tmpgvjydm5s.py", line 3, in <module>
d_num = int(stdin.readline().strip())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s621342818 | p02238 | u659034691 | 1504947262 | Python | Python3 | py | Runtime Error | 0 | 0 | 769 | #depth first
N=int(input())
V=[]
a=[0]
for i in range(N):
V.append([int(i) for i in input().split()])
w=V[i][2:]
w.sort()
V[i]=V[i][:2]+w
a.append(0)
V=sorted(V,key=lambda x:x[0])
c=1
t=1
i=0
r=[1]
a[1]=1
p=[[1,t]]
q=[]
while t<N*2-1:
j=2
while t<N*2-1 and j-2<V[i][1] and V[i][1]>0 and a[... | Traceback (most recent call last):
File "/tmp/tmp171ydm54/tmppt68pm50.py", line 2, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s746865452 | p02238 | u024715419 | 1510546973 | Python | Python3 | py | Runtime Error | 0 | 0 | 533 | j = 1
def dfs(graph, start, result, visited=None):
global j
if visited == None:
visited = []
visited.append(start)
result[start][1] = j
for next in graph[start][2:]:
if next in visited:
continue
j += 1
dfs(graph, next, result, visited)
else:
j... | File "/tmp/tmphqclzan4/tmp2zeb7p23.py", line 24
for i in range(1:n+1)
^
SyntaxError: invalid syntax
| |
s615288734 | p02238 | u626266743 | 1511869704 | Python | Python3 | py | Runtime Error | 0 | 0 | 692 | WHITE = 0
GRAY = 1
BLACK = 2
color, d, f = [WHITE for i in range(n)]
def visit(u):
color[u] = GRAY
d[u] += tt
for v in range(n):
if (M[u-1][v-1] == 0):
continue
if (color[v] == WHITE):
visit(v)
color[u] = BLACK
f[u] += tt
def dfs():
tt = 0
for u in r... | File "/tmp/tmpx1htsh2u/tmpd6az09g3.py", line 20
if (color[u] = WHITE):
^^^^^^^^
SyntaxError: cannot assign to subscript here. Maybe you meant '==' instead of '='?
| |
s769307965 | p02238 | u626266743 | 1511870080 | Python | Python3 | py | Runtime Error | 0 | 0 | 635 | WHITE = 0
GRAY = 1
BLACK = 2
color, d, f = [WHITE for i in range(n)]
t = 1
def visit(u):
color[u] = GRAY
d[u] += t
t += 1
for v in range(n):
if (M[u-1][v-1] == 0):
continue
if (color[v] == WHITE):
visit(v)
color[u] = BLACK
f[u] = t
t += 1
for u in ra... | Traceback (most recent call last):
File "/tmp/tmpr8du7a8r/tmpqsay46xc.py", line 4, in <module>
color, d, f = [WHITE for i in range(n)]
^
NameError: name 'n' is not defined
| |
s563243183 | p02238 | u626266743 | 1511870187 | Python | Python3 | py | Runtime Error | 0 | 0 | 639 | WHITE = 0
GRAY = 1
BLACK = 2
color, d, f = [WHITE for i in range(n)]
t = 1
def visit(u):
color[u] = GRAY
d[u] += t
t += 1
for v in range(n):
if (M[u-1][v-1] == 0):
continue
if (color[v] == WHITE):
visit(v)
color[u] = BLACK
f[u] = t
t += 1
for u in ra... | Traceback (most recent call last):
File "/tmp/tmp7peeot1p/tmps_shfi3v.py", line 4, in <module>
color, d, f = [WHITE for i in range(n)]
^
NameError: name 'n' is not defined
| |
s660753569 | p02238 | u626266743 | 1511870200 | Python | Python3 | py | Runtime Error | 0 | 0 | 639 | WHITE = 0
GRAY = 1
BLACK = 2
color, d, f = [WHITE for i in range(n)]
t = 1
def visit(u):
color[u] = GRAY
d[u] += t
t += 1
for v in range(n):
if (M[u-1][v-1] == 0):
continue
if (color[v] == WHITE):
visit(v)
color[u] = BLACK
f[u] = t
t += 1
for u in ra... | Traceback (most recent call last):
File "/tmp/tmpiniylu2a/tmpabt80_kn.py", line 4, in <module>
color, d, f = [WHITE for i in range(n)]
^
NameError: name 'n' is not defined
| |
s330152833 | p02238 | u626266743 | 1511870217 | Python | Python3 | py | Runtime Error | 0 | 0 | 637 | WHITE = 0
GRAY = 1
BLACK = 2
color, d, f = [WHITE for i in range(n)]
t = 1
def visit(u):
color[u] = GRAY
d[u] += t
t += 1
for v in range(n):
if (M[u-1][v-1] == 0):
continue
if (color[v] == WHITE):
visit(v)
color[u] = BLACK
f[u] = t
t += 1
for u in ra... | Traceback (most recent call last):
File "/tmp/tmp9522zm1d/tmpd22tgi2h.py", line 4, in <module>
color, d, f = [WHITE for i in range(n)]
^
NameError: name 'n' is not defined
| |
s946163080 | p02238 | u626266743 | 1511870259 | Python | Python3 | py | Runtime Error | 0 | 0 | 638 |
n = int(input())
M = [[0 for i in range(n)] for i in range(n)]
for i in range(n):
temp = list(map(int, input().split()))
for i in range(temp[1]):
M[temp[0]-1][temp[i+2]-1] = 1
WHITE = 0
GRAY = 1
BLACK = 2
color, d, f = [WHITE for i in range(n)]
t = 1
def visit(u):
color[u] = GRAY
d[u] += t
... | Traceback (most recent call last):
File "/tmp/tmpqhqdd7vn/tmpqbe1ylv_.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s745307017 | p02238 | u626266743 | 1511870337 | Python | Python3 | py | Runtime Error | 0 | 0 | 662 | def visit(u):
global color, d, f, t
color[u] = GRAY
d[u] += t
t += 1
for v in range(n):
if (M[u-1][v-1] == 0):
continue
if (color[v] == WHITE):
visit(v)
color[u] = BLACK
f[u] = t
t += 1
n = int(input())
M = [[0 for i in range(n)] for i in range(n)... | Traceback (most recent call last):
File "/tmp/tmpbqeatpzz/tmpazm_oqpa.py", line 15, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s725778392 | p02238 | u626266743 | 1511870389 | Python | Python3 | py | Runtime Error | 0 | 0 | 658 | def visit(u):
global color, d, f, t
color[u] = GRAY
d[u] += t
t += 1
for v in range(n):
if (M[u][v] == 0):
continue
if (color[v] == WHITE):
visit(v)
color[u] = BLACK
f[u] = t
t += 1
n = int(input())
M = [[0 for i in range(n)] for i in range(n)]
fo... | Traceback (most recent call last):
File "/tmp/tmp0cfxlq3x/tmp4b7u8lf3.py", line 15, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s499441130 | p02238 | u626266743 | 1511870467 | Python | Python3 | py | Runtime Error | 0 | 0 | 665 | def visit(u):
global color, d, f, t
color[u] = GRAY
d[u] += t
t += 1
for v in range(n):
if (M[u][v] == 0):
continue
if (color[v] == WHITE):
visit(v)
color[u] = BLACK
f[u] = t
t += 1
n = int(input())
M = [[False for i in range(n)] for i in range(n)... | Traceback (most recent call last):
File "/tmp/tmpq9_8v86v/tmphh8nsahv.py", line 15, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s676438126 | p02238 | u626266743 | 1511870728 | Python | Python3 | py | Runtime Error | 0 | 0 | 658 | def visit(u):
global color, d, f, t
color[u] = GRAY
d[u] += t
t += 1
for v in range(n):
if (M[u][v] == 0):
continue
if (color[v] == WHITE):
visit(v)
color[u] = BLACK
f[u] = t
t += 1
n = int(input())
M = [[False for i in range(n)] for i in range(n)... | Traceback (most recent call last):
File "/tmp/tmpdihpsfqy/tmp66medm96.py", line 15, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s254785102 | p02238 | u626266743 | 1511870765 | Python | Python3 | py | Runtime Error | 0 | 0 | 664 | def visit(u):
global visit_color, d, f, t
color[u] = GRAY
d[u] += t
t += 1
for v in range(n):
if (M[u][v] == 0):
continue
if (color[v] == WHITE):
visit(v)
color[u] = BLACK
f[u] = t
t += 1
n = int(input())
M = [[False for i in range(n)] for i in ra... | Traceback (most recent call last):
File "/tmp/tmp_hgx6uqc/tmppu997glk.py", line 15, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s235193063 | p02238 | u626266743 | 1511870916 | Python | Python3 | py | Runtime Error | 0 | 0 | 680 | def visit(u):
global color, d, f, t
color[u] = GRAY
d[u] += t
t += 1
for v in range(n):
if (M[u][v] == 0):
continue
else:
if (color[v] == WHITE):
visit(v)
color[u] = BLACK
f[u] = t
t += 1
n = int(input())
M = [[False for i in range... | Traceback (most recent call last):
File "/tmp/tmpsrqd3r7j/tmpdzwg66k6.py", line 16, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s365771243 | p02238 | u626266743 | 1511871092 | Python | Python3 | py | Runtime Error | 0 | 0 | 699 | def visit(u):
global color, d, f, t
color[u] = GRAY
d[u] += t
t += 1
for v in range(n):
if (M[u][v] == 0):
continue
else:
if (color[v] == WHITE):
visit(v)
color[u] = BLACK
f[u] = t
t += 1
n = int(input())
M = [[0 for i in range(n)]... | Traceback (most recent call last):
File "/tmp/tmp1tswf097/tmpzvoa95pp.py", line 16, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s762466460 | p02238 | u626266743 | 1511871228 | Python | Python3 | py | Runtime Error | 0 | 0 | 699 | def visit(u):
global color, d, f, t
color[u] = GRAY
d[u] += t
t += 1
for v in range(n):
if (M[u][v] == 0):
continue
else:
if (color[v] == WHITE):
visit(v)
color[u] = BLACK
f[u] = t
t += 1
n = int(input())
M = [[0 for i in range(n)]... | Traceback (most recent call last):
File "/tmp/tmpnf2d4he0/tmpil5udsda.py", line 16, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s408228422 | p02238 | u626266743 | 1511871305 | Python | Python3 | py | Runtime Error | 0 | 0 | 701 |
WHITE = 0
GRAY = 1
BLACK = 2
color = [WHITE for i in range(n)]
d, f = [0 for i in range(n)]
t = 1
def visit(u):
global color, d, f, t
color[u] = GRAY
d[u] += t
t += 1
for v in range(n):
if (M[u][v] == 0):
continue
else:
if (color[v] == WHITE):
... | Traceback (most recent call last):
File "/tmp/tmp1_i_hwsm/tmpo0enr048.py", line 5, in <module>
color = [WHITE for i in range(n)]
^
NameError: name 'n' is not defined
| |
s107991839 | p02238 | u626266743 | 1511871810 | Python | Python3 | py | Runtime Error | 0 | 0 | 607 | def visit(u):
global visit_color, d, f, t
color[u] = GRAY
d[u] += t
t += 1
for v in range(n):
if (M[u][v] == 0):
continue
else:
if (color[v] == WHITE):
visit(v)
color[u] = BLACK
f[u] = t
t += 1
n = int(input())
M = [[0 for i in ran... | Traceback (most recent call last):
File "/tmp/tmph34kgzer/tmp5gjthkb_.py", line 16, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s729945116 | p02238 | u626266743 | 1511871853 | Python | Python3 | py | Runtime Error | 0 | 0 | 601 | def visit(u):
global color, d, f, t
color[u] = GRAY
d[u] += t
t += 1
for v in range(n):
if (M[u][v] == 0):
continue
else:
if (color[v] == WHITE):
visit(v)
color[u] = BLACK
f[u] = t
t += 1
n = int(input())
M = [[0 for i in range(n)]... | Traceback (most recent call last):
File "/tmp/tmphwttvya1/tmpvzvhl1dj.py", line 16, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s383066240 | p02238 | u626266743 | 1511871880 | Python | Python3 | py | Runtime Error | 0 | 0 | 607 | def visit(u):
global visit_color, d, f, t
color[u] = GRAY
d[u] += t
t += 1
for v in range(n):
if (M[u][v] == 0):
continue
else:
if (color[v] == WHITE):
visit(v)
color[u] = BLACK
f[u] = t
t += 1
n = int(input())
M = [[0 for i in ran... | Traceback (most recent call last):
File "/tmp/tmpffcglbd_/tmpr4y_jko4.py", line 16, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s949229901 | p02238 | u626266743 | 1511871957 | Python | Python3 | py | Runtime Error | 0 | 0 | 700 | def visit(u):
global color, d, f, t
color[u] = GRAY
d[u] += t
t += 1
for v in range(n):
if (M[u][v] == 0):
continue
else:
if (color[v] == WHITE):
visit(v)
color[u] = BLACK
f[u] = t
t += 1
n = int(input())
M = [[0 for i in range(n)]... | Traceback (most recent call last):
File "/tmp/tmpsrartfl0/tmpdws1k02z.py", line 16, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s808275038 | p02238 | u626266743 | 1511872149 | Python | Python3 | py | Runtime Error | 0 | 0 | 713 | def visit(u):
global visit_color, d, f, t
color[u] = GRAY
d[u] += t
t += 1
for v in range(n):
if (M[u][v] == 0):
continue
else:
if (color[v] == WHITE):
visit(v)
color[u] = BLACK
f[u] = t
t += 1
n = int(input())
M = [[False for i in... | Traceback (most recent call last):
File "/tmp/tmpos0h3zr6/tmp8_utlw29.py", line 16, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s485493562 | p02238 | u626266743 | 1511872203 | Python | Python3 | py | Runtime Error | 0 | 0 | 696 | def dfs(u):
global dfs_color, d, f, t
color[u] = GRAY
d[u] += t
t += 1
for v in range(n):
if (M[u][v] == 0):
continue
else:
if (color[v] == WHITE):
dfs(v)
color[u] = BLACK
f[u] = t
t += 1
n = int(input())
M = [[ for i in range(n)] f... | File "/tmp/tmpxitswjmd/tmpwlarg49i.py", line 17
M = [[ for i in range(n)] for j in range(n)]
^^^
SyntaxError: invalid syntax
| |
s538732389 | p02238 | u845643816 | 1511920630 | Python | Python3 | py | Runtime Error | 0 | 0 | 596 | n = int(input())
a = [[0]*n for i in range(n)]
for i in range(n):
v = list(map(int, input().split()))
u = v[0]
k = v[1]
for j in range(k):
a[u - 1][v[2 + j] - 1] = 1
d = [0] * n ## time:discover
f = [0] * n ## time:finish
isDiscovered = [False] * n
time_stamp = 0
def dfs(u):
globa... | File "/tmp/tmp06643l8g/tmpethnpacy.py", line 19
time_stamp++
^
SyntaxError: invalid syntax
| |
s571699553 | p02238 | u845643816 | 1511920765 | Python | Python3 | py | Runtime Error | 0 | 0 | 648 | n = int(input())
a = [[0]*n for i in range(n)]
for i in range(n):
v = list(map(int, input().split()))
u = v[0]
k = v[1]
for j in range(k):
a[u - 1][v[2 + j] - 1] = 1
d = [0] * n ## time:discover
f = [0] * n ## time:finish
isDiscovered = [False] * n
time_stamp = 0
def dfs(x):
globa... | File "/tmp/tmpb_obb3dk/tmppncnf_6h.py", line 19
time_stamp++
^
SyntaxError: invalid syntax
| |
s911026437 | p02238 | u845643816 | 1511920797 | Python | Python3 | py | Runtime Error | 0 | 0 | 610 | n = int(input())
a = [[0]*n for i in range(n)]
for i in range(n):
v = list(map(int, input().split()))
u = v[0]
k = v[1]
for j in range(k):
a[u - 1][v[2 + j] - 1] = 1
d = [0] * n
f = [0] * n
isDiscovered = [False] * n
time_stamp = 0
def dfs(x):
global time_stamp
isDiscovered [x] = Tr... | File "/tmp/tmpsoltl0gy/tmpn5y6dgri.py", line 19
time_stamp++
^
SyntaxError: invalid syntax
| |
s814116266 | p02238 | u845643816 | 1511920930 | Python | Python3 | py | Runtime Error | 0 | 0 | 640 | n = int(input())
a = [[0]*n for i in range(n)]
for i in range(n):
v = list(map(int, input().split()))
u = v[0]
k = v[1]
for j in range(k):
a[u - 1][v[2 + j] - 1] = 1
d = [0] * n
f = [0] * n
isDiscovered = [False] * n
time_stamp = 0
def dfs(x):
global time_stamp
isDiscovered [x] = Tr... | Traceback (most recent call last):
File "/tmp/tmpcigh8by2/tmpejygg1kj.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s056795454 | p02238 | u845643816 | 1511921428 | Python | Python3 | py | Runtime Error | 0 | 0 | 626 | n = int(input())
a = [[False]*n for i in range(n)]
for i in range(n):
v = list(map(int, input().split()))
u = v[0]
k = v[1]
for j in range(k):
a[u - 1][v[2 + j] - 1] = True
d = [0] * n
f = [0] * n
isDiscovered = [False] * n
time_stamp = 0
def dfs(x):
global time_stamp
isDiscovered [... | File "/tmp/tmp8dxf747x/tmpgv6lni89.py", line 22
if a[x][i]and !isDiscovered[i]:
^
SyntaxError: invalid syntax
| |
s297814093 | p02238 | u152085200 | 1518402105 | Python | Python | py | Runtime Error | 10 | 4696 | 1372 | from sys import stdin
global time
time = 0
def dfs(graph,start,state,discover,finish):
state[start-1] = 1
global time
time = time + 1
discover[start-1] = time
# print str(time) + " go to " + str(start)
neighbours = sorted(graph[start])
for neighbour in neighbours:
if state[neigh... | File "/tmp/tmpa01he9yz/tmp3meo4vzc.py", line 67
print str(i+1) + ' ' + str(d[i]) + ' ' + str(f[i])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s087988971 | p02238 | u126478680 | 1525502299 | Python | Python3 | py | Runtime Error | 0 | 0 | 1136 | class Color(Enum):
WHITE = auto() # 未訪問の頂点
GRAY = auto() # 訪問済みだが, 全ての接点の調査は済んでいない状態の接点
BLACK = auto() # 訪問, 調査済みの接点
n = int(input())
d = [0 for i in range(n)]
f = [0 for i in range(n)]
colors = [] # 頂点の訪問状態
A = [[0 for j in range(n)] for i in range(n)] # 隣接行列
# stack = [] ## スタックによる実装では頂点の保持が必要 => 再帰によって... | Traceback (most recent call last):
File "/tmp/tmpiqh3b94s/tmpl4g3d8co.py", line 1, in <module>
class Color(Enum):
^^^^
NameError: name 'Enum' is not defined
| |
s009252148 | p02238 | u372207695 | 1530015050 | Python | Python3 | py | Runtime Error | 0 | 0 | 2149 | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
int main(){
stack<int> st;
int n;
cin >> n;
int d[n] = {};
int f[n] = {};
int vnum[n][2] = {};
bool vflag[n] = {};
int tmp2;
int num;
vector<vector<int>> vertex;
vector<int> tmp;
for(int i=0;i<n... | File "/tmp/tmpdd_obon7/tmpwjtbdp7g.py", line 5
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s932887031 | p02239 | u609061402 | 1531294779 | Python | Python3 | py | Runtime Error | 0 | 0 | 466 | def f(v,c):
check[v]=c
c+=1
for i in edge[v]:
if check==-1:
c=f(i,c)
time[v]=c
c+=1
return c
n=int(input())
edge=[[]for in range(n)]
for i in range(n):
a=list(map(int,input().split())
edge[a[0]]=sorted(a[2:])
time=[-1]*n
check=[-1]*n
c=1
for i in range(n):
... | File "/tmp/tmp69tr00sw/tmp0yw0lvsy.py", line 12
edge=[[]for in range(n)]
^^
SyntaxError: invalid syntax
| |
s928960728 | p02239 | u609061402 | 1531294792 | Python | Python3 | py | Runtime Error | 0 | 0 | 466 | def f(v,c):
check[v]=c
c+=1
for i in edge[v]:
if check==-1:
c=f(i,c)
time[v]=c
c+=1
return c
n=int(input())
edge=[[]for in range(n)]
for i in range(n):
a=list(map(int,input().split())
edge[a[0]]=sorted(a[2:])
time=[-1]*n
check=[-1]*n
c=1
for i in range(n):
... | File "/tmp/tmp7cx74g19/tmpe5r0wxoc.py", line 12
edge=[[]for in range(n)]
^^
SyntaxError: invalid syntax
| |
s878837201 | p02239 | u726330006 | 1540440890 | Python | Python3 | py | Runtime Error | 0 | 0 | 720 | def get_depth(graph,tmp_depth,vertex_list,depth_list):
new_vertex_list=[]
for vertex in vertex_list:
for j in range(len(depth_list)):
if(graph[vertex][j]!=0 and depth_list[j]==-1):
depth_list[j]=tmp_depth + 1
new_vertex_list.append(j)
get_depth(graph,tmp_d... | Traceback (most recent call last):
File "/tmp/tmpmq6inr02/tmpcvq4yrpf.py", line 12, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s520975531 | p02239 | u805716376 | 1551367961 | Python | Python3 | py | Runtime Error | 0 | 0 | 397 | N= int(input());E = [input().split()[2:] for _ in range(N)]
frag, T, L,Q = [0]*N, [0]*N, [0]*N, [0]
a,frag[0] = 100, 1
def func(ide):
for i in E[ide]:
i = int(i) - 1
if frag[i] != 1:frag[i] = 1;L[i] = L[ide] +1 ;Q.append(i)
else:return
while Q:top = Q[0];func(top);del Q[0]
for i in n:
... | Traceback (most recent call last):
File "/tmp/tmp9lszxmqh/tmp7youu5__.py", line 1, in <module>
N= int(input());E = [input().split()[2:] for _ in range(N)]
^^^^^^^
EOFError: EOF when reading a line
| |
s970531091 | p02239 | u805716376 | 1551368001 | Python | Python3 | py | Runtime Error | 0 | 0 | 404 | N= int(input());E = [input().split()[2:] for _ in range(N)]
frag, T, L,Q = [0]*N, [0]*N, [0]*N, [0]
a,frag[0] = 100, 1
def func(ide):
for i in E[ide]:
i = int(i) - 1
if frag[i] != 1:frag[i] = 1;L[i] = L[ide] +1 ;Q.append(i)
else:return
while Q:top = Q[0];func(top);del Q[0]
for i in range(n... | Traceback (most recent call last):
File "/tmp/tmp64nbvqk6/tmpl4dq2b56.py", line 1, in <module>
N= int(input());E = [input().split()[2:] for _ in range(N)]
^^^^^^^
EOFError: EOF when reading a line
| |
s980935312 | p02239 | u805716376 | 1551368079 | Python | Python3 | py | Runtime Error | 0 | 0 | 404 | N= int(input())
E = [input().split()[2:] for _ in range(N)]
frag, T, L,Q = [0]*N, [0]*N, [0]*N, [0]
a,frag[0] = 100, 1
def func(ide):
for i in E[ide]:
i = int(i) - 1
if frag[i] != 1:frag[i] = 1;L[i] = L[ide] +1 ;Q.append(i)
else:return
while Q:top = Q[0];func(top);del Q[0]
for i in range(n... | Traceback (most recent call last):
File "/tmp/tmpyxyok_ck/tmpefnjjoo9.py", line 1, in <module>
N= int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s398936215 | p02239 | u805716376 | 1551369636 | Python | Python3 | py | Runtime Error | 0 | 0 | 267 | N= int(input())
E = [input().split()[2:] for _ in [0]*N]
Q = [0]
L = [0] + [-1]*N
def func(ide):
for i in E[ide]:
i = int(i) - 1
if L[i] < 0 :L[i] = L[ide] +1 ;Q += [i]
while Q:top = Q.pop();func(top)
for i in range(N):print(i + 1 ,int(L[i]))
| Traceback (most recent call last):
File "/tmp/tmpbb54s54n/tmp190tzyd2.py", line 1, in <module>
N= int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s244510275 | p02239 | u805716376 | 1551369731 | Python | Python3 | py | Runtime Error | 0 | 0 | 268 | N= int(input())
E = [input().split()[2:] for _ in [0]*N]
Q = [0]
L = [0] + [-1]*N
def func(ide):
for i in E[ide]:
i = int(i) - 1
if L[i] < 0 :L[i] = L[ide] +1 ; Q+= [i]
while Q:top = Q.pop(0);func(top)
for i in range(N):print(i + 1 ,int(L[i]))
| Traceback (most recent call last):
File "/tmp/tmp0vaud6cb/tmpkcunmif2.py", line 1, in <module>
N= int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s488307138 | p02239 | u805716376 | 1551370225 | Python | Python3 | py | Runtime Error | 0 | 0 | 325 | N= int(input())
E = [input().split()[2:] for _ in range(N)]
Q = [0]
L = [0] + [-1]*N
flag = [1] + [0]*N
def func(ide):
global Q
for i in E[ide]:
i = int(i) - 1
if frag[i] != 1:frag[i] = 1;L[i] = L[ide] +1 ;Q.append(i)
while Q:top = Q.pop(0);func(top)
for i in range(N):print(i + 1 ,int(L[i... | Traceback (most recent call last):
File "/tmp/tmpcrkijh21/tmp076a60pp.py", line 1, in <module>
N= int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s659214342 | p02239 | u805716376 | 1551370433 | Python | Python3 | py | Runtime Error | 0 | 0 | 350 | N= int(input())
E = [input().split()[2:] for _ in range(N)]
Q = [0]
L = [0] + [-1]*N
frag = [1] + [0]*N
def func(ide):
global Q
for i in E[ide]:
i = int(i) - 1
if frag[i] != 1:frag[i] = 1;L[i] = L[ide] +1 ;Q.append(i)
return else
while Q:top = Q[0];func(top);del Q[0]
for i in rang... | File "/tmp/tmp841wuhp4/tmptt2npga3.py", line 11
return else
^^^^
SyntaxError: invalid syntax
| |
s369225054 | p02239 | u805716376 | 1551371131 | Python | Python3 | py | Runtime Error | 0 | 0 | 545 | import numpy as np
N= int(input())
frag, T, L, Q = np.zeros(N),np.zeros(N),np.zeros(N),[0]
# frag, T, L,Q = [0]*N, [0]*N, [0]*N, [0]
a = 100
frag[0] = 1
def func(ide):
# print("frag = {}".format(frag))
for i in E[ide]:
i = int(i) - 1
if frag[i] != 1:
frag[i] = 1
L[i] = L[... | Traceback (most recent call last):
File "/tmp/tmp48w2_xut/tmppk0owzof.py", line 2, in <module>
N= int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s246866920 | p02239 | u669284080 | 1451226748 | Python | Python3 | py | Runtime Error | 30 | 7768 | 392 | #!/usr/bin/python3
def find(id, V, d, dist):
i = id - 1
dist[i] = d
for v in V[i]:
find(v, V, d + 1, dist)
n = int(input())
# [isFind, d, f]
A = [[False, 0, 0] for i in range(n)]
U = []
V = []
dist = [-1] * n
for i in range(n):
l = list(map(int, input().split()))
U.append(l[0])
V.a... | Traceback (most recent call last):
File "/tmp/tmpso0artlw/tmpa293ej20.py", line 9, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s229010596 | p02239 | u920118302 | 1454033080 | Python | Python | py | Runtime Error | 10 | 6476 | 437 | def BFS(s, r):
d[s] = r
for i in range(1, n+1):
if G[s][i] == 1 and flag[i] == 0:
BFS(i, r+1)
n = int(raw_input())
G = [[0 for i in range(n+1)] for j in range(n+1)]
d = [-1 for i in range(n+1)]
for i in range(n):
v = map(int, raw_input().split())
for j in range(v[1]):
G[v[0... | Traceback (most recent call last):
File "/tmp/tmpv194notc/tmpefa5cdpo.py", line 7, in <module>
n = int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s481251298 | p02239 | u885467869 | 1454074875 | Python | Python | py | Runtime Error | 10 | 6372 | 797 | class node:
def __init__(self, num):
self.number = num
self.distance = -1
self.link_node = []
self.is_serched = False
def BFS(node):
for item in node.link_node:
if item.is_serched == False:
item.distance = node.distance + 1
item.is_serched ... | File "/tmp/tmpv62l8igw/tmp55cf2gv_.py", line 31
print '%s %s' % (str(item.number), str(item.distance))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s269690104 | p02239 | u885467869 | 1454078145 | Python | Python | py | Runtime Error | 10 | 6528 | 1474 | class node:
def __init__(self, num):
self.number = num
self.distance = -1
self.link_node = []
self.is_serched = False
class queue:
def __init__(self):
self.top = 0
self.bottom = 0
self.que = [None] * 100
def dequeue(self):
self.top... | File "/tmp/tmpkrqzii8g/tmpyvscio29.py", line 56
print '%s %s' % (str(item.number), str(item.distance))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s893818759 | p02239 | u885467869 | 1454078253 | Python | Python | py | Runtime Error | 10 | 6524 | 1475 | class node:
def __init__(self, num):
self.number = num
self.distance = -1
self.link_node = []
self.is_serched = False
class queue:
def __init__(self):
self.top = 0
self.bottom = 0
self.que = [None] * 1000
def dequeue(self):
self.to... | File "/tmp/tmpws2qzsq1/tmpdx8h5kux.py", line 56
print '%s %s' % (str(item.number), str(item.distance))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s730015699 | p02239 | u119456964 | 1454083924 | Python | Python | py | Runtime Error | 0 | 0 | 708 | n = int(raw_input())
d = [99999 for i in range(n)]
G = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
g = [0 for i in range(n)]
temp_d = [0]
def BFS_visit(s, temp_d):
if temp_d == 99999:
temp_d = 0
if d[s] > temp_d:
d[s] = temp_d
temp_d += 1
for e in range(n):
... | File "/tmp/tmpisa1d44t/tmpeisxy_yo.py", line 26
print'{0} {1}'.format(s+1, d[s])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s775981277 | p02239 | u069446126 | 1454084507 | Python | Python | py | Runtime Error | 0 | 0 | 668 |
def BFS(s = 0, time = 0):
d[s] = time
if len(Q) != 0:
Q.pop(0)
color[s] = 2
for j in range(len(d)):
if A[i][j] == 1 and color[j] == 0:
Q.append(A[i][j])
color[j] = 1
for j in range(Q):
time = time + 1
BFS(Q[j], time)
n = int(raw_input())
... | Traceback (most recent call last):
File "/tmp/tmp8kbfisw0/tmpljh_axsg.py", line 15, in <module>
n = int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s637502257 | p02239 | u119456964 | 1454085134 | Python | Python | py | Runtime Error | 0 | 6284 | 702 | n = int(raw_input())
d = [99999 for i in range(n)]
G = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
g = [0 for i in range(n)]
temp_d = [0]
def BFS_visit(s, temp_d):
if temp_d == 99999:
temp_d = 0
if d[s] > temp_d:
d[s] = temp_d
temp_d += 1
for e in range(n):
... | File "/tmp/tmpcp87hwy0/tmpuyzi2cwb.py", line 26
print'{0} {1}'.format(s+1, d[s])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s088269564 | p02239 | u119456964 | 1454085239 | Python | Python | py | Runtime Error | 10 | 6404 | 702 | n = int(raw_input())
d = [99999 for i in range(n)]
G = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
g = [0 for i in range(n)]
temp_d = [0]
def BFS_visit(s, temp_d):
if temp_d == 99999:
temp_d = 0
if d[s] > temp_d:
d[s] = temp_d
temp_d += 1
for e in range(n):
... | File "/tmp/tmpe2pnfsi_/tmp7y6bdja4.py", line 26
print'{0} {1}'.format(s+1, d[s])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s324948836 | p02239 | u119456964 | 1454086061 | Python | Python | py | Runtime Error | 10 | 6408 | 705 | n = int(raw_input())
d = [99999 for i in range(n)]
G = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
g = [0 for i in range(n)]
temp_d = [0]
def BFS_visit(s, temp_d):
if temp_d == 99999:
temp_d = 0
if d[s] > temp_d:
d[s] = temp_d
temp_d += 1
for e in range(1, n):
... | File "/tmp/tmpmben3a0s/tmp5wxkayed.py", line 26
print'{0} {1}'.format(s+1, d[s])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s586408716 | p02239 | u828153094 | 1454145460 | Python | Python | py | Runtime Error | 0 | 0 | 542 | #!/usr/bin/env python
from _future_ import division, print_function
from sys import stdin
from Quene import Quene
def main()
num = int(stdin.readline())
L = []
for _ in xrange(num):
L.append([int(s) for s in stdin.readline().split()[2:]])
d = [-1] * num
d[0] = 0
q = Quene(100)
q.p... | File "/tmp/tmp0snlsx5j/tmpe27e5z6k.py", line 6
def main()
^
SyntaxError: expected ':'
| |
s165165995 | p02239 | u828153094 | 1454145634 | Python | Python | py | Runtime Error | 0 | 0 | 544 | #!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin
from Quene import Quene
def main()
num = int(stdin.readline())
L = []
for _ in xrange(num):
L.append([int(s) for s in stdin.readline().split()[2:]])
d = [-1] * num
d[0] = 0
q = Quene(100)
q... | File "/tmp/tmprrouumsn/tmpjb0smlvb.py", line 6
def main()
^
SyntaxError: expected ':'
| |
s091279291 | p02239 | u824204304 | 1454409504 | Python | Python | py | Runtime Error | 0 | 0 | 659 | n = int(raw_input())
G = [0 for i in range(n)]
a = [[0 for i in range(n)] for j in range(n)]
st = [0 for i in range(n)]
dis = [0]
b = [0 for i in range(n)]
def bfs_visit(s):
st[s] = 1
dis[0] = 0
for k in range(n):
if a[s][k] == 1 and st[k] == 0:
dis[0] += 1
b[k] = dis[0]
... | File "/tmp/tmprk1n9x4j/tmpm7p5reb7.py", line 28
for i in range(n):
^
IndentationError: unindent does not match any outer indentation level
| |
s235186688 | p02239 | u824204304 | 1454410419 | Python | Python | py | Runtime Error | 0 | 0 | 483 | n = int(raw_input())
G = [0 for i in range(n)]
a = [[0 for i in range(n)] for j in range(n)]
dis = [-1 for i in range(n)]
for i in range(n):
G = map(int, raw_input().split())
for j in range(G[1]):
a[G[0]-1][G[2+j]-1] = 1
def bfs_visit(s):
for k in range(n):
if a[s][k] == 1 and dis[k] == -1... | Traceback (most recent call last):
File "/tmp/tmpi9w4apu9/tmpvx24n53z.py", line 1, in <module>
n = int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s732379680 | p02239 | u824204304 | 1454410720 | Python | Python | py | Runtime Error | 0 | 0 | 494 | n = int(raw_input())
G = [0 for i in range(n)]
a = [[0 for i in range(n)] for j in range(n)]
dis = [-1 for i in range(n)]
dis[0] = 0
for i in range(n):
G = map(int, raw_input().split())
for j in range(G[1]):
a[G[0]-1][G[2+j]-1] = 1
def bfs_visit(s):
for k in range(n):
if a[s][k] == 1 and d... | Traceback (most recent call last):
File "/tmp/tmpmkdhzfoe/tmpmqvb_5sh.py", line 1, in <module>
n = int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s899802909 | p02239 | u824204304 | 1454410958 | Python | Python | py | Runtime Error | 0 | 0 | 466 | n = int(raw_input())
G = [0 for i in range(n)]
a = [[0 for i in range(n)] for j in range(n)]
dis = [-1 for i in range(n)]
dis[0] = 0
for i in range(n):
G = map(int, raw_input().split())
for j in range(G[1]):
a[G[0]-1][G[2+j]-1] = 1
def bfs_visit(s):
for k in range(n):
if a[s][k] == 1 an... | Traceback (most recent call last):
File "/tmp/tmpm1fzz84i/tmp9r_qthz3.py", line 1, in <module>
n = int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s134335111 | p02239 | u824204304 | 1454411858 | Python | Python | py | Runtime Error | 0 | 0 | 557 | n = int(raw_input())
G = [0 for i in range(n)]
a = [[0 for i in range(n)] for j in range(n)]
dis = [1000 for i in range(n)]
dis[0] = 0
for i in range(n):
G = map(int, raw_input().split())
for j in range(G[1]):
a[G[0]-1][G[2+j]-1] = 1
def bfs_visit(s):
for k in range(n):
if a[s][k] == 1:
... | File "/tmp/tmphkevndnp/tmp7_edxhbq.py", line 26
print'{0} {1}'.format(s+1, d[s])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.