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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s251990454 | p02357 | u279605379 | 1504749455 | Python | Python3 | py | Runtime Error | 0 | 0 | 519 | [N,L] = [int(x) for x in input().split()]
A = dict
ANS = [10**9+1]*N
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
try : A[x] += [i]
except KeyError : A[x] = [i]
for i in set(A) :
for j in A[i] :
for k in range(L) :
try :
if ANS[j+k] == 1... | Traceback (most recent call last):
File "/tmp/tmpqb_ar8ld/tmpcfgeopx8.py", line 1, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s290253862 | p02357 | u279605379 | 1504749525 | Python | Python3 | py | Runtime Error | 0 | 0 | 526 | [N,L] = [int(x) for x in input().split()]
A = {10**9+1:1}
ANS = [10**9+1]*N
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
try : A[x] += [i]
except KeyError : A[x] = [i]
for i in set(A) :
for j in A[i] :
for k in range(L) :
try :
if ANS[j+... | Traceback (most recent call last):
File "/tmp/tmpzx8o8rx9/tmplngr74i2.py", line 1, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s853937533 | p02357 | u279605379 | 1504749584 | Python | Python3 | py | Runtime Error | 0 | 0 | 530 | [N,L] = [int(x) for x in input().split()]
A = {10**9+1:1}
ANS = [10**9+1]*N
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
try : A[x] += [i]
except KeyError : A[x] = [i]
for i in set(A) :
for j in A[i] :
for k in range(L) :
try :
if ANS[j+... | Traceback (most recent call last):
File "/tmp/tmpa2367w27/tmprtus8f_l.py", line 1, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s668354891 | p02357 | u279605379 | 1504751770 | Python | Python3 | py | Runtime Error | 20 | 7736 | 434 | [N,L] = [int(x) for x in input().split()]
A = {}
ANS = {}
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
if x in A : A[x] += [i]
else : A[x] = [i]
for i in sorted(A) :
for j in A[i] :
for k in range(L) :
if j + k not in ANS :
ANS[j+k] = i
... | Traceback (most recent call last):
File "/tmp/tmplr2uj55s/tmpvuo79v2e.py", line 1, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s176012696 | p02357 | u279605379 | 1504752052 | Python | Python3 | py | Runtime Error | 0 | 0 | 537 | [N,L] = [int(x) for x in input().split()]
A = {}
ANS = {}
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
if x in A : A[x] += [i]
else : A[x] = [i]
for i in sorted(A) :
for j in A[i] :
for k in range(L) :
if j + k not in ANS :
ANS[j+k] = i
... | File "/tmp/tmpvpvktvym/tmpq5vwsnh5.py", line 18
if L = 1 :
^^^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
| |
s979665134 | p02357 | u279605379 | 1504752118 | Python | Python3 | py | Runtime Error | 60 | 7812 | 540 | [N,L] = [int(x) for x in input().split()]
A = {}
ANS = {}
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
if x in A : A[x] += [i]
else : A[x] = [i]
for i in sorted(A) :
for j in A[i] :
for k in range(L) :
if j + k not in ANS :
ANS[j+k] = i
... | Traceback (most recent call last):
File "/tmp/tmpfa03r5ju/tmp0gjhgpp9.py", line 1, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s169023592 | p02357 | u279605379 | 1504752140 | Python | Python3 | py | Runtime Error | 50 | 7800 | 439 | [N,L] = [int(x) for x in input().split()]
A = {}
ANS = {}
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
if x in A : A[x] += [i]
else : A[x] = [i]
for i in sorted(A) :
for j in A[i] :
for k in range(L) :
if j + k not in ANS :
ANS[j+k] = i
... | Traceback (most recent call last):
File "/tmp/tmpwz1fo1um/tmp3n2g5r3p.py", line 1, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s475732251 | p02357 | u279605379 | 1504752245 | Python | Python3 | py | Runtime Error | 20 | 7724 | 436 | [N,L] = [int(x) for x in input().split()]
A = {}
ANS = {}
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
if x in A : A[x] += [i]
else : A[x] = [i]
for i in sorted(A) :
for j in A[i] :
for k in range(L) :
if j + k not in ANS :
ANS[j+k] = i
... | Traceback (most recent call last):
File "/tmp/tmp_95l2wsd/tmp_x6i91e2.py", line 1, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s160569516 | p02357 | u279605379 | 1504752256 | Python | Python3 | py | Runtime Error | 20 | 7812 | 439 | [N,L] = [int(x) for x in input().split()]
A = {}
ANS = {}
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
if x in A : A[x] += [i]
else : A[x] = [i]
for i in sorted(A) :
for j in A[i] :
for k in range(L) :
if j + k not in ANS :
ANS[j+k] = i
... | Traceback (most recent call last):
File "/tmp/tmp_w0wxklc/tmp25ij9e39.py", line 1, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s286450965 | p02357 | u279605379 | 1504752262 | Python | Python3 | py | Runtime Error | 40 | 9276 | 440 | [N,L] = [int(x) for x in input().split()]
A = {}
ANS = {}
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
if x in A : A[x] += [i]
else : A[x] = [i]
for i in sorted(A) :
for j in A[i] :
for k in range(L) :
if j + k not in ANS :
ANS[j+k] = i
... | Traceback (most recent call last):
File "/tmp/tmp6oo_drnn/tmpd9jz0biu.py", line 1, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s921818781 | p02357 | u279605379 | 1504752270 | Python | Python3 | py | Runtime Error | 60 | 9340 | 440 | [N,L] = [int(x) for x in input().split()]
A = {}
ANS = {}
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
if x in A : A[x] += [i]
else : A[x] = [i]
for i in sorted(A) :
for j in A[i] :
for k in range(L) :
if j + k not in ANS :
ANS[j+k] = i
... | Traceback (most recent call last):
File "/tmp/tmp23jiq817/tmp2nwkat_1.py", line 1, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s711207582 | p02357 | u279605379 | 1504752935 | Python | Python3 | py | Runtime Error | 0 | 0 | 449 | [N,L] = [int(x) for x in input().split()]
A = {}
ANS = {}
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
if x in A : A[x] += [i]
else : A[x] = [i]
for i in sorted(A) :
for j in A[i] :
for k in range(L) :
if j + k not in ANS && j + k < N:
AN... | File "/tmp/tmpvhbph4pb/tmp7ic4wr_7.py", line 13
if j + k not in ANS && j + k < N:
^
SyntaxError: invalid syntax
| |
s219791767 | p02357 | u279605379 | 1504752954 | Python | Python3 | py | Runtime Error | 0 | 0 | 448 | [N,L] = [int(x) for x in input().split()]
A = {}
ANS = {}
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
if x in A : A[x] += [i]
else : A[x] = [i]
for i in sorted(A) :
for j in A[i] :
for k in range(L) :
if j + k not in ANS && j + k < N:
AN... | File "/tmp/tmpdcr8_0oy/tmpe74t8jch.py", line 13
if j + k not in ANS && j + k < N:
^
SyntaxError: invalid syntax
| |
s468278262 | p02357 | u279605379 | 1504752970 | Python | Python3 | py | Runtime Error | 0 | 0 | 452 | [N,L] = [int(x) for x in input().split()]
A = {}
ANS = {}
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
if x in A : A[x] += [i]
else : A[x] = [i]
for i in sorted(A) :
for j in A[i] :
for k in range(L) :
if j + k not in ANS && j + k < N:
AN... | File "/tmp/tmpj_u8wiyj/tmpnbftb45b.py", line 13
if j + k not in ANS && j + k < N:
^
SyntaxError: invalid syntax
| |
s563603577 | p02357 | u279605379 | 1504757494 | Python | Python3 | py | Runtime Error | 20 | 7736 | 553 | [N,L] = [int(x) for x in input().split()]
A = {}
B = [True]*N
ANS = {}
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
B[i] = x
if x in A : A[x] += [i]
else : A[x] = [i]
for i in sorted(A) :
for j in A[i] :
for k in range(L) :
if j + k not in ANS :
... | Traceback (most recent call last):
File "/tmp/tmpbsxdxgel/tmpsjmeeng9.py", line 1, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s458114600 | p02357 | u279605379 | 1504757584 | Python | Python3 | py | Runtime Error | 30 | 7748 | 624 | [N,L] = [int(x) for x in input().split()]
A = {}
B = [True]*N
ANS = {}
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
B[i] = x
if x in A : A[x] += [i]
else : A[x] = [i]
for i in sorted(A) :
for j in A[i] :
for k in range(L) :
if j + k not in ANS :
... | Traceback (most recent call last):
File "/tmp/tmps_4e5czr/tmpakrdrilk.py", line 1, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s288742332 | p02357 | u279605379 | 1504758591 | Python | Python3 | py | Runtime Error | 0 | 0 | 636 | from collections import deque
[N,L] = [int(x) for x in input().split()]
A = {}
B = deque([])
ANS = {}
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
B.append(x)
if x in A : A[x] += [i]
else : A[x] = [i]
for i in sorted(A) :
for j in A[i] :
for k in range(L) :
... | Traceback (most recent call last):
File "/tmp/tmpnh9m5oyp/tmpfqgncac3.py", line 2, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s845383789 | p02357 | u279605379 | 1504760095 | Python | Python3 | py | Runtime Error | 0 | 0 | 626 | [N,L] = [int(x) for x in input().split()]
A = {}
B = [0]*N
ANS = {}
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
B[i] = x
if x in A : A[x] += [i]
else : A[x] = [i]
for i in sorted(A) :
for j in A[i] :
for k in range(L) :
if j + k not in ANS :
... | Traceback (most recent call last):
File "/tmp/tmp8qlg60_4/tmpvfzf6gx3.py", line 1, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s250757320 | p02357 | u279605379 | 1504765482 | Python | Python3 | py | Runtime Error | 30 | 7948 | 957 | def SME(Part,L):
A = {}
B = []
ANS = {}
count = 0
N = len(Part)
for i,x in enumerate(Part):
B.append(x)
if x in A : A[x] += [i]
else : A[x] = [i]
for i in sorted(A) :
for j in A[i] :
for k in range(L) :
if j + k not in ANS :
... | Traceback (most recent call last):
File "/tmp/tmpntu5ylc5/tmprjxsw8rg.py", line 25, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s863096895 | p02357 | u279605379 | 1504765547 | Python | Python3 | py | Runtime Error | 40 | 7820 | 957 | def SME(Part,L):
A = {}
B = []
ANS = {}
count = 0
N = len(Part)
for i,x in enumerate(Part):
B.append(x)
if x in A : A[x] += [i]
else : A[x] = [i]
for i in sorted(A) :
for j in A[i] :
for k in range(L) :
if j + k not in ANS :
... | Traceback (most recent call last):
File "/tmp/tmpzp87xc5q/tmpl6g0h9k6.py", line 25, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s686948267 | p02357 | u279605379 | 1504767005 | Python | Python3 | py | Runtime Error | 80 | 9252 | 616 | import heapq
[N,L] = [int(x) for x in input().split()]
A = [[int(x),int(i)] for i,x in enumerate(input().split())]
heapq.heapify(A)
ANS = [10**9+1]*N
count = 0
for j in range(N):
a = heapq.heappop(A)
for i in range(L):
try :
if ANS[a[1]+i] == 10**9+1 :
ANS[a[1]+i] = a[0]
... | Traceback (most recent call last):
File "/tmp/tmpss1hvcwr/tmp3blpmllw.py", line 2, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s604482364 | p02357 | u279605379 | 1504767031 | Python | Python3 | py | Runtime Error | 0 | 0 | 615 | import heapq
[N,L] = [int(x) for x in input().split()]
A = [[int(x),int(i)] for i,x in enumerate(input().split())]
heapq.heapify(A)
ANS = [10**9+1]*N
count = 0
for j in range(N):
a = heapq.heappop(A)
for i in range(L):
try :
if ANS[a[1]+i] == 10**9+1 :
ANS[a[1]+i] = a[0]
... | Traceback (most recent call last):
File "/tmp/tmpnns4eitt/tmpiij1678y.py", line 2, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s558308068 | p02357 | u279605379 | 1504771836 | Python | Python3 | py | Runtime Error | 0 | 0 | 942 | import heapq
def SME(Whole,start,end,L,ANS):
A = []
if end > N : end = N
count = 0
for i,x in enumerate(Whole[start:end]):
heapq.heappush(A,[x,i])
for j in range(start,end):
a = heapq.heappop(A)
for i in range(L):
idx = a[1] + i
try :
i... | Traceback (most recent call last):
File "/tmp/tmp0xtv9l0z/tmp1oyfdqcu.py", line 24, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s560856122 | p02357 | u279605379 | 1504774506 | Python | Python3 | py | Runtime Error | 0 | 0 | 877 | import heapq
def SME(start,end):
A = []
if end > N : end = N
count = 0
for i,x in enumerate(Whole[start:end]):
heapq.heappush(A,[x,i])
for j in range(start,end):
a = heapq.heappop(A)
for i in range(L):
idx = a[1] + i
try :
if ANS[idx] =... | File "/tmp/tmpm4kr7dou/tmpb81q_a8s.py", line 26
if N = 10**5 :
^^^^^^^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
| |
s714428925 | p02357 | u279605379 | 1504824125 | Python | Python3 | py | Runtime Error | 0 | 0 | 906 | import heapq
def SME(start,end):
A = []
if end > N : end = N
count = 0
for i,x in enumerate(Whole[start:end]):
heapq.heappush(A,[x,i])
for j in range(start,end):
a = heapq.heappop(A)
if sum(ANS[a[1]:a[1]+L]) < (a[0]-1)*(L-1) + MAX + 1
for i in range(L):
id... | File "/tmp/tmpqez3ftna/tmpeq9t9fzi.py", line 10
if sum(ANS[a[1]:a[1]+L]) < (a[0]-1)*(L-1) + MAX + 1
^
SyntaxError: expected ':'
| |
s448481201 | p02357 | u279605379 | 1504832893 | Python | Python3 | py | Runtime Error | 0 | 0 | 964 | from functools import reduce
import operator
import heapq
def SME(start,end):
A = []
if end > N : end = N
count = 0
for i,x in enumerate(Whole[start:end]):
heapq.heappush(A,[x,i])
for j in range(start,end):
a = heapq.heappop(A)
if reduce(operator.mul,A[a[1]:a[1]+L])!... | Traceback (most recent call last):
File "/tmp/tmpmoxk0_m2/tmpzjaw2sj6.py", line 28, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s280811877 | p02357 | u279605379 | 1504838641 | Python | Python3 | py | Runtime Error | 0 | 0 | 964 | import heapq
def SME(Whole,start,end,L,ANS):
A = []
if end > N : end = N
count = 0
for i,x in enumerate(Whole[start:end]):
heapq.heappush(A,[x,i])
for j in range(start,end):
a = heapq.heappop(A)
for i in range(L):
idx = a[1] + i
try :
i... | Traceback (most recent call last):
File "/tmp/tmpuhz59ypi/tmp57pl4h50.py", line 24, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s741029774 | p02357 | u279605379 | 1504846855 | Python | Python3 | py | Runtime Error | 0 | 0 | 982 | #??????????????????
import heapq
def SME(start,end):
if end > N : end = N
count = 0
for i,x in enumerate(Whole[start:end]):
heapq.heappush(A,[x,i])
for j in range(start,end):
a = heapq.heappop(A)
if None not in ANS[a[1]:a[1]+L] : continue
for i in range(L):
id... | Traceback (most recent call last):
File "/tmp/tmpaqun2trj/tmpby8nndt9.py", line 27, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s207971184 | p02357 | u279605379 | 1504846878 | Python | Python3 | py | Runtime Error | 0 | 0 | 982 | #??????????????????
import heapq
def SME(start,end):
if end > N : end = N
count = 0
for i,x in enumerate(Whole[start:end]):
heapq.heappush(A,[x,i])
for j in range(start,end):
a = heapq.heappop(A)
if None not in ANS[a[1]:a[1]+L] : continue
for i in range(L):
id... | Traceback (most recent call last):
File "/tmp/tmpmvvqwl34/tmpxrzxir4k.py", line 27, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s189389613 | p02357 | u279605379 | 1504848196 | Python | Python3 | py | Runtime Error | 0 | 0 | 606 | [N,L] = [int(x) for x in input().split()]
A = {}
B = [0]*N
ANS = {}
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
B[i] = x
if x in A : A[x] += [i]
else : A[x] = [i]
for i in range(10**9) :
for j in A[i] :
for k in range(L) :
if j + k not in ANS :
... | Traceback (most recent call last):
File "/tmp/tmpzicqjma0/tmp_g9ih6g_.py", line 1, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s412471421 | p02357 | u279605379 | 1504849023 | Python | Python3 | py | Runtime Error | 0 | 0 | 1019 | #??????????????????
import heapq
def SME():
start = 0
parameter = 0.99
ANS = [None]*N
[end,L] = [int(x) for x in input().split()]
Whole = [int(x) for x in input().split()]
A = []
C = set([i for i in range(N)])
D = set([])
if end > N : end = N
count = 0
for i,x in enumerate(Wh... | Traceback (most recent call last):
File "/tmp/tmp_yygfwts/tmpdi1my52s.py", line 36, in <module>
ANS = SME()
^^^^^
File "/tmp/tmp_yygfwts/tmpdi1my52s.py", line 6, in SME
ANS = [None]*N
^
NameError: name 'N' is not defined
| |
s832753605 | p02357 | u279605379 | 1504849039 | Python | Python3 | py | Runtime Error | 0 | 0 | 999 | import heapq
def SME():
start = 0
parameter = 0.99
ANS = [None]*N
[end,L] = [int(x) for x in input().split()]
Whole = [int(x) for x in input().split()]
A = []
C = set([i for i in range(N)])
D = set([])
if end > N : end = N
count = 0
for i,x in enumerate(Whole[start:end]):
... | Traceback (most recent call last):
File "/tmp/tmpt2aywgo9/tmpzb55_dj5.py", line 35, in <module>
ANS = SME()
^^^^^
File "/tmp/tmpt2aywgo9/tmpzb55_dj5.py", line 5, in SME
ANS = [None]*N
^
NameError: name 'N' is not defined
| |
s321695327 | p02357 | u279605379 | 1504850563 | Python | Python3 | py | Runtime Error | 0 | 0 | 994 | import heapq
def SME():
A = []
ANS = [None] * N
C = set([i for i in range(N)])
D = set([])
E = [None] * N
parameter = 0.9997
count = 0
for i,x in enumerate(Whole) :
if 0 in E[i-L//2:i] and 0 in E[i:i+l//2+1] :
E[i] = 0
continue
E[i] = 0
hea... | Traceback (most recent call last):
File "/tmp/tmpt84lcxfh/tmp5er0k312.py", line 33, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s258992296 | p02357 | u279605379 | 1504851282 | Python | Python3 | py | Runtime Error | 0 | 0 | 973 | import heapq
def SME(start,end):
if end > N : end = N
count = 0
for i,x in enumerate(Whole[start:end]):
if i > N*0.5 : break
heapq.heappush(A,[x,i])
for j in range(start,end):
a = heapq.heappop(A)
if None not in ANS[a[1]:a[1]+L] : continue
for i in range(L):
... | Traceback (most recent call last):
File "/tmp/tmpcl12jwvp/tmpt6zl_w26.py", line 27, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s711063199 | p02357 | u279605379 | 1504851429 | Python | Python3 | py | Runtime Error | 0 | 0 | 861 | import heapq
def SME(start,end):
count = 0
ANS = [heapq.heappush(A,[x,i]) for i,x in enumerate(Whole)]
for j in range(start,end):
if None not in ANS[a[1]:a[1]+L] : continue
for i in range(L):
idx = a[1] + i
try :
if ANS[idx] : continue
... | Traceback (most recent call last):
File "/tmp/tmp4jwmeqru/tmpm32rdzd4.py", line 23, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s546725779 | p02357 | u279605379 | 1504852128 | Python | Python3 | py | Runtime Error | 20 | 8692 | 875 | import heapq
def SME(start,end):
count = 0
ANS = [None]*N
for j in range(start,end):
a = heapq.heappop(A)
if None not in ANS[a[1]:a[1]+L] : continue
for i in range(L):
idx = a[1] + i
try :
if ANS[idx] : continue
else :
... | Traceback (most recent call last):
File "/tmp/tmp9l7bwntl/tmpfts6xlwo.py", line 24, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s087587483 | p02357 | u279605379 | 1504852618 | Python | Python3 | py | Runtime Error | 80 | 8612 | 875 | import heapq
def SME(start,end):
count = 0
ANS = [None]*N
for j in range(start,end):
a = heapq.heappop(A)
if None not in ANS[a[1]:a[1]+L] : continue
for i in range(L):
idx = a[1] + i
try :
if ANS[idx] : continue
else :
... | Traceback (most recent call last):
File "/tmp/tmptt0j057r/tmpny_rlfzc.py", line 24, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s045440002 | p02357 | u279605379 | 1504853314 | Python | Python3 | py | Runtime Error | 0 | 0 | 748 | import heapq
def SME():
A = [[x,i] for i,x in enumerate(Whole)]
heapq.heapify(A)
C = set([i for i in range(N)])
D = set([])
parameter = 0.997
count = 0
ANS = [None] * N
for j in range(N) :
a = heapq.heappop(A)
for i in ANS[a[1]:a[1]+L]:
if ANS[i] : continue
... | Traceback (most recent call last):
File "/tmp/tmpwl4bja1a/tmp7jgie3ox.py", line 24, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s926416273 | p02357 | u279605379 | 1504856338 | Python | Python3 | py | Runtime Error | 20 | 7780 | 753 | [N,L] = [int(x) for x in input().split()]
A = {}
B = [0]*N
ANS = {}
count = 0
for i,x in enumerate(input().split()):
i = int(i)
x = int(x)
B[i] = x
if x in A : A[x] += [i]
else : A[x] = [i]
for i in A:
j=1
while j < len(A[i]) - 1:
if A[i][j+1]-A[i][j-1] < L*2 :
del A[i]
... | Traceback (most recent call last):
File "/tmp/tmpuraxlefk/tmpx9558l6f.py", line 1, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s726464700 | p02357 | u279605379 | 1504857435 | Python | Python3 | py | Runtime Error | 30 | 7868 | 910 | def SME():
A = [[x,i] for i,x in enumerate(Whole)]
A.sort()
i = 1
while i < len(A) - 1:
if A[i+1][1]-A[i-1][1] < L :
if A[i+1][0]==A[i-1][0] :
del A[i][j]
continue
i += 1
C = set([i for i in range(N)])
D = set([])
parameter = 0.997
... | Traceback (most recent call last):
File "/tmp/tmpfdpo8glq/tmpoqduts19.py", line 30, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s350957723 | p02357 | u279605379 | 1504857790 | Python | Python3 | py | Runtime Error | 40 | 10416 | 928 | def SME():
A = [[x,i] for i,x in enumerate(Whole)]
A.sort()
i = 1
while i < len(A) - 1:
if A[i+1][1]-A[i-1][1] < L :
if A[i+1][0]==A[i-1][0] :
del A[i]
continue
i += 1
C = set([i for i in range(N)])
D = set([])
parameter = 0.997
... | Traceback (most recent call last):
File "/tmp/tmpkb_48f0d/tmpu8ri0vn4.py", line 30, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s866854107 | p02357 | u279605379 | 1504858517 | Python | Python3 | py | Runtime Error | 0 | 0 | 348 | #DSL_3-D Sliding Window - Sliding Minimum Elements
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = []
if N == 10**5 :
try :
count += 1
except NameError :
count = 1
for i in range(N-L+1) : ans.append(min(A[i:i+L]))
for i in ans[:-1] : print(i, end=" ")
if co... | Traceback (most recent call last):
File "/tmp/tmp1jy06dsi/tmpmlmzr_kt.py", line 2, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s619489824 | p02357 | u279605379 | 1504859191 | Python | Python3 | py | Runtime Error | 0 | 0 | 221 | import random
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = []
for i in range(N-L+1) : ans.append(min(random.shuffle(A[i:i+L])))
for i in ans[:-1] : print(i, end=" ")
print(ans[-1]) | Traceback (most recent call last):
File "/tmp/tmp5lkcrmyq/tmpoeuiger6.py", line 2, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s194739372 | p02357 | u279605379 | 1504860427 | Python | Python3 | py | Runtime Error | 0 | 0 | 1214 | import heapq
def SME(start,end):
count = 0
for i,x in enumerate(Whole[start:end//2]):
heapq.heappush(A,[x,i])
for j in range(start,end):
a = heapq.heappop(A)
if None not in ANS[a[1]:a[1]+L] : continue
for i in range(L):
idx = a[1] + i
try :
... | Traceback (most recent call last):
File "/tmp/tmpboej3jdx/tmp1tt0vhn6.py", line 36, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s321235468 | p02357 | u279605379 | 1504860479 | Python | Python3 | py | Runtime Error | 0 | 0 | 1216 | import heapq
def SME(start,end):
count = 0
for i,x in enumerate(Whole[start:end]):
heapq.heappush(A,[x,i])
for j in range(start,end):
a = heapq.heappop(A)
if None not in ANS[a[1]:a[1]+L] : continue
for i in range(L):
idx = a[1] + i
try :
... | Traceback (most recent call last):
File "/tmp/tmpy7w5ft__/tmpz9a5md5l.py", line 36, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s093987960 | p02357 | u279605379 | 1504860559 | Python | Python3 | py | Runtime Error | 0 | 0 | 1150 | import heapq
def SME(start,end):
count = 0
for i,x in enumerate(Whole[start:end//2]):
heapq.heappush(A,[x,i])
for j in range(start,end):
a = heapq.heappop(A)
if None not in ANS[a[1]:a[1]+L] : continue
for i in range(L):
idx = a[1] + i
try :
... | Traceback (most recent call last):
File "/tmp/tmpwn2y9oc7/tmpuvog3qms.py", line 35, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s006346007 | p02357 | u279605379 | 1504874992 | Python | Python3 | py | Runtime Error | 0 | 0 | 1030 | import heapq
def SME(start,end):
if end > N : end = N
count = 0
for i,x in enumerate(Whole[start:end]):
heapq.heappush(A,[x,i])
for j in range(start,end):
a = heapq.heappop(A)
if ANS[a[1]+L-1] == None :
ANS[idx] = a[0]
count += 1
if None not in AN... | Traceback (most recent call last):
File "/tmp/tmpgsc3z_pq/tmpceemleq9.py", line 29, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s266369914 | p02357 | u279605379 | 1504875011 | Python | Python3 | py | Runtime Error | 0 | 0 | 1035 | import heapq
def SME(start,end):
if end > N : end = N
count = 0
for i,x in enumerate(Whole[start:end]):
heapq.heappush(A,[x,i])
for j in range(start,end):
a = heapq.heappop(A)
if ANS[a[1]+L-1] == None :
ANS[a[1]+L-1] = a[0]
count += 1
if None not ... | Traceback (most recent call last):
File "/tmp/tmpyib32azz/tmpalixxbm3.py", line 29, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s922974413 | p02357 | u279605379 | 1504875542 | Python | Python3 | py | Runtime Error | 0 | 0 | 430 | [N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
count = 0
for i in range(N-1):
if A[i] <= A[i+1] : count += 1
if count > N * 0.9 : print(1)
ans = []
mini = min(A[0:L])
ans.append(mini)
for i in range(1,N-L+1) :
if A[i+L-1] <= mini :
mini = A[i+L-1]
elif A[i-1] == mini... | Traceback (most recent call last):
File "/tmp/tmpj8dkk5of/tmpaznsxd8q.py", line 1, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s602108255 | p02357 | u279605379 | 1504875787 | Python | Python3 | py | Runtime Error | 0 | 0 | 425 | [N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
count = 0
for i in range(N-1):
if A[i] <= A[i+2] : count += 1
if count > N * 0.8 : print(1)
ans = []
mini = min(A[0:L])
ans.append(mini)
for i in range(1,N-L+1) :
if A[i+L-1] <= mini :
mini = A[i+L-1]
elif A[i-1] == mini... | Traceback (most recent call last):
File "/tmp/tmpmcnawuk_/tmp05tb68ss.py", line 1, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s781127711 | p02357 | u279605379 | 1505085770 | Python | Python3 | py | Runtime Error | 0 | 0 | 659 | def ascend(a,b):
mini = min(A[a:a+L])
ans[a] = mini
for i in range(a+1,b):
if A[i+L-1] <= mini :
mini = A[i+L-1]
elif A[i-1] == mini :
mini = min(A[i:i+L])
ans[i] = mini
def descend(a,b):
mini = min(A[b-1:b+L-1])
ans[b-1] = mini
for i in range(b-2... | Traceback (most recent call last):
File "/tmp/tmp1xbjxgkv/tmp95u5ay33.py", line 21, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s407086562 | p02357 | u279605379 | 1505085783 | Python | Python3 | py | Runtime Error | 50 | 7772 | 658 | def ascend(a,b):
mini = min(A[a:a+L])
ans[a] = mini
for i in range(a+1,b):
if A[i+L-1] <= mini :
mini = A[i+L-1]
elif A[i-1] == mini :
mini = min(A[i:i+L])
ans[i] = mini
def descend(a,b):
mini = min(A[b-1:b+L-1])
ans[b-1] = mini
for i in range(b-2... | Traceback (most recent call last):
File "/tmp/tmp0qkp57io/tmp094_500l.py", line 21, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s916191139 | p02357 | u279605379 | 1505117964 | Python | Python3 | py | Runtime Error | 60 | 8936 | 759 | def ascend(a,b):
mini = min(A[a:a+L])
ans[a] = mini
for i in range(a+1,b):
if A[i+L-1] <= mini : mini = A[i+L-1]
elif A[i-1] == mini : mini = min(A[i:i+L])
ans[i] = mini
def descend(a,b):
mini = min(A[b-1:b+L-1])
ans[b-1] = mini
for i in range(b-2,a-1,-1):
if A[i... | Traceback (most recent call last):
File "/tmp/tmpqfo1yxj5/tmp6vc6789e.py", line 17, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s635356935 | p02357 | u279605379 | 1505118000 | Python | Python3 | py | Runtime Error | 30 | 8944 | 758 | def ascend(a,b):
mini = min(A[a:a+L])
ans[a] = mini
for i in range(a+1,b):
if A[i+L-1] <= mini : mini = A[i+L-1]
elif A[i-1] == mini : mini = min(A[i:i+L])
ans[i] = mini
def descend(a,b):
mini = min(A[b-1:b+L-1])
ans[b-1] = mini
for i in range(b-2,a-1,-1):
if A[i... | Traceback (most recent call last):
File "/tmp/tmpr3ot6aks/tmpu9ltfzu8.py", line 17, in <module>
[N,L] = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s085281874 | p02357 | u960937651 | 1528386566 | Python | Python3 | py | Runtime Error | 0 | 0 | 263 | list = []
ans = []
n, l = map(int, input().split())
for i in range(n):
if(i < l-1):
list.append(int(input()))
else:
list.append(int(input()))
ans.append(min(list))
list.pop(0)
for i in range(len(ans)):
print(ans[i])
| Traceback (most recent call last):
File "/tmp/tmpv10t06wh/tmpighl7mhi.py", line 3, in <module>
n, l = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s403395875 | p02357 | u893844544 | 1528681138 | Python | Python3 | py | Runtime Error | 0 | 0 | 524 | #include <stdio.h>
#include <queue>
#include <utility>
using namespace std;
int main(){
int N,L,atmp;
priority_queue<pair<int,int>,vector<pair<int,int> >,greater<pair<int,int> > >pq;
scanf("%d%d",&N,&L);
for(int i=0;i<L;i++){
scanf("%d",&atmp);
pq.push(make_pair(atmp,i));
}
print... | File "/tmp/tmp0g7dm02l/tmpo64hq9w5.py", line 4
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s273897847 | p02359 | u256748051 | 1535103267 | Python | Python | py | Runtime Error | 0 | 0 | 217 | n, t = map(int,raw_input().split())
arr = [0 for i in range(t+1)]
for i in range(n):
start, end = map(int,raw_input().split())
arr[start] += 1
arr[end] -= 1
import numpy as np
cs = np.cumsum(arr)
print max(cs)
| File "/tmp/tmpgtnvhgeu/tmpwcp2nmg2.py", line 13
print max(cs)
^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s994284234 | p02359 | u256748051 | 1535103311 | Python | Python | py | Runtime Error | 0 | 0 | 217 | n, t = map(int,raw_input().split())
arr = [0 for i in range(t+1)]
for i in range(n):
start, end = map(int,raw_input().split())
arr[start] += 1
arr[end] -= 1
import numpy as np
cs = np.cumsum(arr)
print max(cs)
| File "/tmp/tmpih71wqo3/tmp3xaa6fa1.py", line 13
print max(cs)
^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s296776810 | p02360 | u797673668 | 1499923960 | Python | Python3 | py | Runtime Error | 20 | 7712 | 293 | from itertools import accumulate
n = int(input())
a = [[0] * 10 for _ in range(10)]
for x1, y1, x2, y2 in (map(int, input().split()) for _ in range(n)):
a[x1][y1] += 1
a[x1][y2] -= 1
a[x2][y1] -= 1
a[x2][y2] += 1
print(max(map(max, map(accumulate, zip(*map(accumulate, a)))))) | Traceback (most recent call last):
File "/tmp/tmpvae_sat4/tmp24foa0hu.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s147344893 | p02361 | u131811591 | 1531705072 | Python | Python3 | py | Runtime Error | 0 | 0 | 1273 | import sys
import queue
class Dijkstra:
class Edge:
def __init__(self, end, cost):
self.to = end
self.cost = cost
def __init__(self, node_size, inf):
self._node = node_size
self._graph = [[] for _ in range(self._node)]
self.inf = inf
self.dist =... | Traceback (most recent call last):
File "/tmp/tmpsz_c4ilh/tmphuac8x0a.py", line 35, in <module>
V, E, r = map(int, sys.stdin.readline().split())
^^^^^^^
ValueError: not enough values to unpack (expected 3, got 0)
| |
s321454489 | p02361 | u943441430 | 1559031467 | Python | Python3 | py | Runtime Error | 0 | 0 | 800 | # AOJ GRL_1_A
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_A
INF = 100000000
def solve(v, e, dic):
dp = []
for i in range(0, v):
dp += [[INF] * v ]
for t, d in dic[i]:
dp[i][t] = d
dp[i][i] = 0
for k in range(0, v):
for i in range(0, v):
... | Traceback (most recent call last):
File "/tmp/tmpr3w6ywhp/tmps661kxxi.py", line 22, in <module>
line = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s563287896 | p02361 | u943441430 | 1559031602 | Python | Python3 | py | Runtime Error | 0 | 0 | 812 | # AOJ GRL_1_A
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_A
INF = 100000000
def solve(v, e, dic):
dp = []
for i in range(0, v):
dp += [[INF] * v ]
for t, d in dic[i]:
dp[i][t] = d
dp[i][i] = 0
for k in range(0, v):
for i in range(0, v):
... | Traceback (most recent call last):
File "/tmp/tmp8y5r0ujy/tmp4r5wy3oh.py", line 22, in <module>
line = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s294611640 | p02361 | u943441430 | 1559032077 | Python | Python3 | py | Runtime Error | 0 | 0 | 812 | # AOJ GRL_1_A
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_A
INF = 100000000
def solve(v, e, dic):
dp = []
for i in range(0, v):
dp += [[INF] * v ]
for t, d in dic[i]:
dp[i][t] = d
dp[i][i] = 0
for k in range(0, v):
for i in range(0, v):
... | Traceback (most recent call last):
File "/tmp/tmpobc2mh2y/tmp7ho6u68p.py", line 22, in <module>
line = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s686424242 | p02361 | u943441430 | 1559032195 | Python | Python3 | py | Runtime Error | 0 | 0 | 806 | # AOJ GRL_1_A
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_A
INF = 100000000
def solve(v, dic):
dp = []
for i in range(0, v):
dp += [[INF] * v ]
for t, d in dic[i]:
dp[i][t] = d
dp[i][i] = 0
for k in range(0, v):
for i in range(0, v):
... | Traceback (most recent call last):
File "/tmp/tmp_bgfiwi3/tmpjjtqmrvt.py", line 22, in <module>
line = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s394998609 | p02361 | u943441430 | 1559032219 | Python | Python3 | py | Runtime Error | 0 | 0 | 818 | # AOJ GRL_1_A
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_A
import sys
INF = 100000000
def solve(v, dic):
dp = []
for i in range(0, v):
dp += [[INF] * v ]
for t, d in dic[i]:
dp[i][t] = d
dp[i][i] = 0
for k in range(0, v):
for i in range(0,... | Traceback (most recent call last):
File "/tmp/tmpikelle21/tmps614ocps.py", line 24, in <module>
line = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s817925964 | p02361 | u943441430 | 1559032406 | Python | Python3 | py | Runtime Error | 0 | 0 | 806 | # AOJ GRL_1_A
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_A
INF = 100000000
def solve(v, dic):
dp = []
for i in range(0, v):
dp += [[INF] * v ]
for t, d in dic[i]:
dp[i][t] = d
dp[i][i] = 0
for k in range(0, v):
for i in range(0, v):
... | Traceback (most recent call last):
File "/tmp/tmp8il8jp16/tmpnpn1ua7k.py", line 22, in <module>
line = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s411728331 | p02361 | u943441430 | 1559033390 | Python | Python3 | py | Runtime Error | 20 | 5664 | 893 | # AOJ GRL_1_A
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_A
from heapq import heappush, heappop
INF = 100000000
def solve(r, t, v, dic):
dp = []
q = []
dp = [INF] * v
dp[r] = 0
heappush(q, (0, r))
while q:
cost, vtx = heappop(q)
if dp[vtx] < cost:
... | Traceback (most recent call last):
File "/tmp/tmpjuz54km5/tmp7wvb56td.py", line 28, in <module>
line = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s302601411 | p02361 | u943441430 | 1559033404 | Python | Python3 | py | Runtime Error | 20 | 5664 | 893 | # AOJ GRL_1_A
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_A
from heapq import heappush, heappop
INF = 100000000
def solve(r, t, v, dic):
dp = []
q = []
dp = [INF] * v
dp[r] = 0
heappush(q, (0, r))
while q:
cost, vtx = heappop(q)
if dp[vtx] < cost:
... | Traceback (most recent call last):
File "/tmp/tmpbz1iwl75/tmp6h9sye5j.py", line 28, in <module>
line = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s076710660 | p02361 | u822971508 | 1559354180 | Python | Python3 | py | Runtime Error | 20 | 5692 | 2729 | class Dijkstra():
""" ダイクストラ法
重み付きグラフにおける単一始点最短路アルゴリズム
* 使用条件
- 負のコストがないこと
- 有向グラフ、無向グラフともにOK
* 計算量はO(E*log(V))
* ベルマンフォード法より高速なので、負のコストがないならばこちらを使うとよい
"""
def __init__(self):
""" 重み付き有向辺
無向辺を表現したいときは、_fromと_toを逆にした有向辺を加えればよい
"""
... | Traceback (most recent call last):
File "/tmp/tmp1s_0y4hl/tmpb5wipgrj.py", line 69, in <module>
V, E, s = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s474210986 | p02361 | u822971508 | 1559354258 | Python | Python3 | py | Runtime Error | 20 | 5692 | 2766 | class Dijkstra():
""" ダイクストラ法
重み付きグラフにおける単一始点最短路アルゴリズム
* 使用条件
- 負のコストがないこと
- 有向グラフ、無向グラフともにOK
* 計算量はO(E*log(V))
* ベルマンフォード法より高速なので、負のコストがないならばこちらを使うとよい
"""
def __init__(self):
""" 重み付き有向辺
無向辺を表現したいときは、_fromと_toを逆にした有向辺を加えればよい
"""
... | Traceback (most recent call last):
File "/tmp/tmpk8xqo4wd/tmp98nseqj4.py", line 69, in <module>
V, E, s = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s701821598 | p02361 | u822971508 | 1559354316 | Python | Python3 | py | Runtime Error | 0 | 0 | 2781 | class Dijkstra():
""" ダイクストラ法
重み付きグラフにおける単一始点最短路アルゴリズム
* 使用条件
- 負のコストがないこと
- 有向グラフ、無向グラフともにOK
* 計算量はO(E*log(V))
* ベルマンフォード法より高速なので、負のコストがないならばこちらを使うとよい
"""
def __init__(self):
""" 重み付き有向辺
無向辺を表現したいときは、_fromと_toを逆にした有向辺を加えればよい
"""
... | File "/tmp/tmpq8tkd3y8/tmpqg7n52g_.py", line 72
return
^^^^^^
SyntaxError: 'return' outside function
| |
s872385595 | p02361 | u822971508 | 1559354352 | Python | Python3 | py | Runtime Error | 0 | 0 | 2781 | class Dijkstra():
""" ダイクストラ法
重み付きグラフにおける単一始点最短路アルゴリズム
* 使用条件
- 負のコストがないこと
- 有向グラフ、無向グラフともにOK
* 計算量はO(E*log(V))
* ベルマンフォード法より高速なので、負のコストがないならばこちらを使うとよい
"""
def __init__(self):
""" 重み付き有向辺
無向辺を表現したいときは、_fromと_toを逆にした有向辺を加えればよい
"""
... | File "/tmp/tmppy_1vcrc/tmpu500awd2.py", line 72
return
^^^^^^
SyntaxError: 'return' outside function
| |
s932309856 | p02361 | u822971508 | 1559355954 | Python | Python3 | py | Runtime Error | 30 | 5692 | 3198 | class Dijkstra():
""" ダイクストラ法
重み付きグラフにおける単一始点最短路アルゴリズム
* 使用条件
- 負のコストがないこと
- 有向グラフ、無向グラフともにOK
* 計算量はO(E*log(V))
* ベルマンフォード法より高速なので、負のコストがないならばこちらを使うとよい
"""
def __init__(self, V=None):
""" 重み付き有向辺
無向辺を表現したいときは、_fromと_toを逆にした有向辺を加えればよい
A... | Traceback (most recent call last):
File "/tmp/tmp7vngz_dh/tmpzc_qk_72.py", line 77, in <module>
V, E, s = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s730960672 | p02361 | u822971508 | 1559356831 | Python | Python3 | py | Runtime Error | 30 | 5652 | 3000 | class BellmanFord():
""" ベルマンフォード法
重み付き有向グラフにおける単一始点最短路アルゴリズム
* 使用条件
- DAG(有向グラフで閉路を持たない)であること
- 負のコストがあってもOK
* 負の閉路がある場合、最短路は求まらないが、負の閉路の検出はできる
* 計算量はO(V*E)
"""
class Edge():
""" 重み付き有向辺 """
def __init__(self, _from, _to, _cost):
se... | Traceback (most recent call last):
File "/tmp/tmpaaamasrj/tmp8yfn6dla.py", line 78, in <module>
V, E, s = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s074676696 | p02361 | u822971508 | 1559455301 | Python | Python3 | py | Runtime Error | 950 | 158112 | 3743 | #http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_A&lang=jp
class Dijkstra():
""" ダイクストラ法
重み付きグラフにおける単一始点最短路アルゴリズム
* 使用条件
- 負のコストがないこと
- 有向グラフ、無向グラフともにOK
* 計算量はO(E*log(V))
* ベルマンフォード法より高速なので、負のコストがないならばこちらを使うとよい
"""
def __init__(self, V=None):
... | Traceback (most recent call last):
File "/tmp/tmpdgrjrdir/tmp0fy2p88g.py", line 83, in <module>
V, E, s = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s405924403 | p02361 | u822971508 | 1559458768 | Python | Python3 | py | Runtime Error | 0 | 0 | 3839 | #http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_A&lang=jp
class Dijkstra():
""" ダイクストラ法
重み付きグラフにおける単一始点最短路アルゴリズム
* 使用条件
- 負のコストがないこと
- 有向グラフ、無向グラフともにOK
* 計算量はO(E*log(V))
* ベルマンフォード法より高速なので、負のコストがないならばこちらを使うとよい
"""
class Edge():
""" 重み付き有向辺 """
... | Traceback (most recent call last):
File "/tmp/tmp55z5zylh/tmpcj4yz7p9.py", line 83, in <module>
V, E, s = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s308874763 | p02361 | u442472098 | 1433201021 | Python | Python3 | py | Runtime Error | 0 | 0 | 673 | from collections import defaultdict
from heapq import heappop, heappush
from math import isinf
V, E, r = map(int, input())
e = defaultdict(list)
for i in range(E):
s, t, length = map(int, input())
e[s].append((length, t))
distance = [float('inf')] * v # 各頂点への距離の初期値
distance[r] = 0 ... | Traceback (most recent call last):
File "/tmp/tmp8miwp3x1/tmp6dr0_frk.py", line 5, in <module>
V, E, r = map(int, input())
^^^^^^^
EOFError: EOF when reading a line
| |
s274818201 | p02361 | u260980560 | 1465545767 | Python | Python | py | Runtime Error | 0 | 0 | 521 | from heapq import heappush, heappop
V, E, r = map(int, raw_input().split())
g = [[] for i in xrange(V)]
for i in xrange(E):
s, t, d = map(int, raw_input().split())
g[s].append((t, d))
INF = 10**10
dist = [INF]*V
que = [(0,r)]
dist[r] = 0
while que:
c, v = heappop(que)
if dist[v] < c:
continue
... | File "/tmp/tmpdba3i7h_/tmp4vweaaly.py", line 21
print dist[i] if dist[i]<INF else "INF"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s745321338 | p02361 | u408260374 | 1474986031 | Python | Python3 | py | Runtime Error | 0 | 0 | 1899 | import heapq
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):
... | Traceback (most recent call last):
File "/tmp/tmpsfqwf1_m/tmp35n0sn_i.py", line 60, in <module>
V, E, start = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s337845818 | p02361 | u408260374 | 1474986279 | Python | Python3 | py | Runtime Error | 0 | 0 | 2102 | import heapq
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):
... | Traceback (most recent call last):
File "/tmp/tmp4hbrydd9/tmpv134w7sl.py", line 67, in <module>
V, E, start = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s819111838 | p02361 | u408260374 | 1474986762 | Python | Python3 | py | Runtime Error | 0 | 0 | 2103 | from heapq import heapify, heappush, heappop
from collections import Counter, defaultdict, deque, OrderedDict
from sys import setrecursionlimit as setreclim
from sys import maxsize
from bisect import bisect_left, bisect, insort_left, insort
from math import ceil, log, factorial, hypot, pi
from fractions import gcd
from... | File "/tmp/tmpzsgmjfaz/tmpsipx8d6q.py", line 13
????
^
SyntaxError: invalid syntax
| |
s324059661 | p02361 | u279546122 | 1485588850 | Python | Python3 | py | Runtime Error | 30 | 7992 | 744 | #!usr/bin/env python3
from collections import defaultdict
def main():
#Read stdin
fl = input().split(" ")
V = int(fl[0])
E = int(fl[1])
R = int(fl[2])
#Adjacency list
G = defaultdict(list)
for i in range(int(E)):
s, t, w = [int(x) for x in input().split(" ")]
G[s].appe... | Traceback (most recent call last):
File "/tmp/tmpgv42wnba/tmp7yfyjt8l.py", line 37, in <module>
main()
File "/tmp/tmpgv42wnba/tmp7yfyjt8l.py", line 8, in main
fl = input().split(" ")
^^^^^^^
EOFError: EOF when reading a line
| |
s405412201 | p02361 | u279546122 | 1485831086 | Python | Python3 | py | Runtime Error | 0 | 0 | 787 | def main():
#Read stdin
fl = input().split(" ")
V = int(fl[0])
E = int(fl[1])
R = int(fl[2])
#Adjacency list
G = defaultdict(list)
for i in range(int(E)):
s, t, w = [int(x) for x in input().split(" ")]
G[s].append((t,w))
#initialized
d = {}
INF = float('inf')... | Traceback (most recent call last):
File "/tmp/tmpcu7c4g33/tmps7p77_n8.py", line 38, in <module>
main()
File "/tmp/tmpcu7c4g33/tmps7p77_n8.py", line 3, in main
fl = input().split(" ")
^^^^^^^
EOFError: EOF when reading a line
| |
s560056381 | p02361 | u279546122 | 1485833144 | Python | Python3 | py | Runtime Error | 0 | 0 | 761 | #!usr/bin/env python3
#from collections import defaultdict
def main():
#Read stdin
fl = input().split(" ")
V = int(fl[0])
E = int(fl[1])
R = int(fl[2])
#Adjacency list
G = defaultdict(list)
for i in range(int(E)):
s, t, w = [int(x) for x in input().split(" ")]
#initialized
... | Traceback (most recent call last):
File "/tmp/tmpe6wy5iqy/tmpx_7_xu59.py", line 38, in <module>
main()
File "/tmp/tmpe6wy5iqy/tmpx_7_xu59.py", line 6, in main
fl = input().split(" ")
^^^^^^^
EOFError: EOF when reading a line
| |
s834860444 | p02361 | u279546122 | 1485922747 | Python | Python3 | py | Runtime Error | 0 | 0 | 1219 | #!usr/bin/env python3
'''
time score 7.88 for list
time score 03.17 for deque
time score 03.22 for defaultdict(dict)
'''
from collections import defaultdict
from collections import deque
#import time
def main():
# Read stdin
start = time.clock()
fl = input().split(" ")
V = int(fl[0])
E = int(fl... | Traceback (most recent call last):
File "/tmp/tmpr6fyuthf/tmpo7m_387e.py", line 54, in <module>
main()
File "/tmp/tmpr6fyuthf/tmpo7m_387e.py", line 16, in main
start = time.clock()
^^^^
NameError: name 'time' is not defined
| |
s755261679 | p02361 | u798803522 | 1486694169 | Python | Python3 | py | Runtime Error | 0 | 0 | 1124 | from collections import defaultdict
import heapq
with open("input.txt","r") as f:
vertice,edge,source = map(int,input().split(" "))
link = [[] for n in range(vertice)]
weight = defaultdict(dict)
for e in range(edge):
i,j,w = map(int,input().split(" "))
link[i].append(j)
weight[i... | Traceback (most recent call last):
File "/tmp/tmp3cs7cpz8/tmpfm4cpqt1.py", line 4, in <module>
with open("input.txt","r") as f:
^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'input.txt'
| |
s822895185 | p02361 | u798803522 | 1486695340 | Python | Python3 | py | Runtime Error | 20 | 7916 | 928 | from collections import defaultdict
import heapq
vertice,edge,source = map(int,input().split(" "))
link = defaultdict(dict)
weight = defaultdict(dict)
for e in range(edge):
i,j,w = map(int,input().split(" "))
link[i] = link.get(i,set()) | {j}
weight[i].update({j:w})
#print(weight,link)
for v in range(vert... | Traceback (most recent call last):
File "/tmp/tmpy86726fl/tmpxm89k_5h.py", line 5, in <module>
vertice,edge,source = map(int,input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s274563147 | p02361 | u798803522 | 1486695477 | Python | Python3 | py | Runtime Error | 0 | 0 | 1095 | from collections import defaultdict
import heapq
with open("input.txt","r") as f:
vertice,edge,source = map(int,f.readline().split(" "))
link = defaultdict(dict)
weight = defaultdict(dict)
for e in range(edge):
i,j,w = map(int,f.readline().split(" "))
link[i] = link.get(i,set()) | {j}
... | Traceback (most recent call last):
File "/tmp/tmpplo1hh97/tmplyh_0xjx.py", line 4, in <module>
with open("input.txt","r") as f:
^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'input.txt'
| |
s667556261 | p02361 | u798803522 | 1486703492 | Python | Python3 | py | Runtime Error | 0 | 0 | 772 | from collections import defaultdict
import heapq
vertice,edge,source = map(int,input().split(" "))
link = defaultdict(dict)
weight = defaultdict(dict)
answer = [-1] * vertice
for e in range(edge):
i,j,w = map(int,input().split(" "))
link[i] = link.get(i,set()) | {j}
weight[i].update({j:w})
goal = v
queue ... | Traceback (most recent call last):
File "/tmp/tmp5v_jmajy/tmp1rmfahdw.py", line 5, in <module>
vertice,edge,source = map(int,input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s151243499 | p02361 | u798803522 | 1486703608 | Python | Python3 | py | Runtime Error | 0 | 0 | 772 | from collections import defaultdict
import heapq
vertice,edge,source = map(int,input().split(" "))
link = defaultdict(dict)
weight = defaultdict(dict)
answer = [-1] * vertice
for e in range(edge):
i,j,w = map(int,input().split(" "))
link[i] = link.get(i,set()) | {j}
weight[i].update({j:w})
goal = v
queue ... | Traceback (most recent call last):
File "/tmp/tmpi7bh6sea/tmp42337h01.py", line 5, in <module>
vertice,edge,source = map(int,input().split(" "))
^^^^^^^
EOFError: EOF when reading a line
| |
s231473246 | p02361 | u279546122 | 1487571812 | Python | Python3 | py | Runtime Error | 0 | 0 | 723 | from collections import defaultdict
from heapq import heappush, heappop, heapify
from sys import stdin
def sp(G,R,V):
d = {}
q = [(0, R)]
d[R] = 0
heapify(q)
while q:
(cost, v) = heappop(q)
for (next, c) in G[v].items():
if v not in d:
d[v] = c
... | Traceback (most recent call last):
File "/tmp/tmpzvvf2k_p/tmpjhxa0044.py", line 23, in <module>
V, E, R = [int(x) for x in stdin.readline().split()]
^^^^^^^
ValueError: not enough values to unpack (expected 3, got 0)
| |
s259566687 | p02361 | u279546122 | 1487571836 | Python | Python3 | py | Runtime Error | 0 | 0 | 721 | from collections import defaultdict
from heapq import heappush, heappop, heapify
from sys import stdin
def sp(G,R,V):
d = {}
q = [(0, R)]
d[R] = 0
heapify(q)
while q:
(cost, v) = heappop(q)
for (next, c) in G[v].items():
if v not in d:
d[v] = c
... | Traceback (most recent call last):
File "/tmp/tmpq76illk5/tmpxpkgljup.py", line 21, in <module>
V, E, R = [int(x) for x in stdin.readline().split()]
^^^^^^^
ValueError: not enough values to unpack (expected 3, got 0)
| |
s559841448 | p02361 | u279546122 | 1487571874 | Python | Python3 | py | Runtime Error | 0 | 0 | 815 | from collections import defaultdict
from heapq import heappush, heappop, heapify
from sys import stdin
#import time
def sp(G,R,V):
d = {}
q = [(0, R)]
d[R] = 0
heapify(q)
while q:
(cost, v) = heappop(q)
for (next, c) in G[v].items():
if v not in d:
d[v] =... | Traceback (most recent call last):
File "/tmp/tmpwe3urers/tmpjwf0he3z.py", line 23, in <module>
V, E, R = [int(x) for x in stdin.readline().split()]
^^^^^^^
ValueError: not enough values to unpack (expected 3, got 0)
| |
s595472742 | p02361 | u923668099 | 1495867663 | Python | Python3 | py | Runtime Error | 30 | 7804 | 753 | import sys
from heapq import heappush, heappop
inf = 1<<30
def solve():
N, M, s = map(int, sys.stdin.readline().split())
Adj = [[] for i in range(N)]
for i in range(M):
ui, vi, ci = map(int, sys.stdin.readline().split())
Adj[ui].append((vi, ci))
d = dijkstra(N, Adj, s)
for di in... | Traceback (most recent call last):
File "/tmp/tmpdixq3296/tmpuvd5xbnl.py", line 39, in <module>
solve()
File "/tmp/tmpdixq3296/tmpuvd5xbnl.py", line 7, in solve
N, M, s = map(int, sys.stdin.readline().split())
^^^^^^^
ValueError: not enough values to unpack (expected 3, got 0)
| |
s045257157 | p02361 | u845643816 | 1511971038 | Python | Python3 | py | Runtime Error | 0 | 0 | 1081 | v, e, r = list(map(int, input().split()))
edgeList = [[0, 0, 0] for i in range(e)]
rootList = [-1 for i in range(v)]
parent = [-1 for i in range(v)]
lenList = [0 for i in range(v)]
for i in range(e):
a = list(map(int, input().split()))
edgeList[e] = [a[2], a[0], a[1]]
rootList = [-1 for i in range(n)]
pare... | Traceback (most recent call last):
File "/tmp/tmpphf5yki1/tmpo6662swh.py", line 1, in <module>
v, e, r = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s714387232 | p02361 | u835844653 | 1512197251 | Python | Python3 | py | Runtime Error | 40 | 6840 | 719 | '''
????????£????????????????????????
'''
import queue
v,e,s=map(int,input().split())
edge=[]
inf =1000000100
for i in range(v):
edge.append([])
for i in range(e):
vs,vt,d=map(int,input().split())
edge[vs].append((vt,d))
dis=[]
for i in range(v):
dis.append(inf)
dis[s]=0
q = queue.PriorityQueu... | Traceback (most recent call last):
File "/tmp/tmplu4covd2/tmpmrzwpju4.py", line 7, in <module>
v,e,s=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s588293368 | p02361 | u835844653 | 1512199718 | Python | Python3 | py | Runtime Error | 0 | 0 | 883 | '''
????????£????????????????????????
'''
import queue
v,e,s=map(int,input().split())
edge=[]
inf =1000000100
for i in range(v):
edge.append([])
for i in range(e):
vs,vt,d=map(int,input().split())
edge[vs].append((vt,d))
dis=[]
for i in range(v):
dis.append(inf)
dis[s]=0
q = queue.PriorityQueu... | File "/tmp/tmp3f4rj7jb/tmpn_31cowk.py", line 40
if now[0]>dis[nowv] continue;
^^^^^^^^
SyntaxError: invalid syntax
| |
s044388606 | p02361 | u904185678 | 1514481255 | Python | Python3 | py | Runtime Error | 20 | 5744 | 3788 | def main():
[V,E,r]=input().split(" ")
V=int(V)
E=int(E)
r=int(r)
edgeset=[]
for i in range(E):
[s,t,d]=input().split(" ")
edgeset.append([int(s),int(t),int(d)])
'''read the edge information and put them to edgeset'''
setS=[]
setV=[[i,500000*10000+1] for i in range(V... | Traceback (most recent call last):
File "/tmp/tmp4lk6j3tz/tmp39c8ko58.py", line 109, in <module>
main()
File "/tmp/tmp4lk6j3tz/tmp39c8ko58.py", line 2, in main
[V,E,r]=input().split(" ")
^^^^^^^
EOFError: EOF when reading a line
| |
s167894537 | p02361 | u742505495 | 1523428514 | Python | Python3 | py | Runtime Error | 0 | 0 | 739 | import queue
def Dijkstra(vertex,edges,start):
weight = [0 if i==start else float("inf") for i in range(vertex)]
Q = queue.PriorityQueue()
Q.put((weight[start],start))
while(not Q.Empty()):
cur = Q.get()
if weight[cur[1]] < cur[0]:
continue
for j in range(len(edges[cur[1]])):
if weight[edges[cur[1]][j... | Traceback (most recent call last):
File "/tmp/tmpdgpai3xx/tmpz1ikuyc1.py", line 18, in <module>
V,E,r = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s930504301 | p02361 | u825008385 | 1523454596 | Python | Python3 | py | Runtime Error | 0 | 0 | 1160 | # Single Source Shortest Path
infty = 99999
[vertex, edge, r] = list(map(int, input("").split()))
D = [[infty for j in range(vertex)] for i in range(vertex)]
for i in range(edge):
data = list(map(int, input("").split()))
D[data[0]][data[1]] = data[2]
def Dijkstra(root, n):
visited_order = 0
label = [0... | File "/tmp/tmp8id0i880/tmpz5dlmfgl.py", line 43
'''
^
SyntaxError: unterminated triple-quoted string literal (detected at line 51)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.