s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
stringlengths
1
5
memory
stringlengths
1
7
code_size
stringlengths
1
6
code
stringlengths
1
539k
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...
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+...
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+...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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...
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...
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...
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 : ...
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 : ...
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) : ...
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 : ...
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 : ...
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 : ...
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] ...
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] ...
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...
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] =...
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...
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])!...
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...
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...
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...
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 : ...
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...
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]): ...
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...
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): ...
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 ...
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 : ...
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 : ...
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 ...
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] ...
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 ...
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 ...
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...
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])
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 : ...
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 : ...
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 : ...
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...
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 ...
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...
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...
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...
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...
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...
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...
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])
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...
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)
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)
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))))))
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 =...
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): ...
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): ...
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): ...
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): ...
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,...
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): ...
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: ...
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: ...
s076710660
p02361
u822971508
1559354180
Python
Python3
py
Runtime Error
20
5692
2729
class Dijkstra(): """ ダイクストラ法 重み付きグラフにおける単一始点最短路アルゴリズム * 使用条件 - 負のコストがないこと - 有向グラフ、無向グラフともにOK * 計算量はO(E*log(V)) * ベルマンフォード法より高速なので、負のコストがないならばこちらを使うとよい """ def __init__(self): """ 重み付き有向辺 無向辺を表現したいときは、_fromと_toを逆にした有向辺を加えればよい """ ...
s474210986
p02361
u822971508
1559354258
Python
Python3
py
Runtime Error
20
5692
2766
class Dijkstra(): """ ダイクストラ法 重み付きグラフにおける単一始点最短路アルゴリズム * 使用条件 - 負のコストがないこと - 有向グラフ、無向グラフともにOK * 計算量はO(E*log(V)) * ベルマンフォード法より高速なので、負のコストがないならばこちらを使うとよい """ def __init__(self): """ 重み付き有向辺 無向辺を表現したいときは、_fromと_toを逆にした有向辺を加えればよい """ ...
s701821598
p02361
u822971508
1559354316
Python
Python3
py
Runtime Error
0
0
2781
class Dijkstra(): """ ダイクストラ法 重み付きグラフにおける単一始点最短路アルゴリズム * 使用条件 - 負のコストがないこと - 有向グラフ、無向グラフともにOK * 計算量はO(E*log(V)) * ベルマンフォード法より高速なので、負のコストがないならばこちらを使うとよい """ def __init__(self): """ 重み付き有向辺 無向辺を表現したいときは、_fromと_toを逆にした有向辺を加えればよい """ ...
s872385595
p02361
u822971508
1559354352
Python
Python3
py
Runtime Error
0
0
2781
class Dijkstra(): """ ダイクストラ法 重み付きグラフにおける単一始点最短路アルゴリズム * 使用条件 - 負のコストがないこと - 有向グラフ、無向グラフともにOK * 計算量はO(E*log(V)) * ベルマンフォード法より高速なので、負のコストがないならばこちらを使うとよい """ def __init__(self): """ 重み付き有向辺 無向辺を表現したいときは、_fromと_toを逆にした有向辺を加えればよい """ ...
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...
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...
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): ...
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(): """ 重み付き有向辺 """ ...
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 ...
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 ...
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): ...
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): ...
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...
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...
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')...
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 ...
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...
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...
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...
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} ...
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 ...
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 ...
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 ...
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 ...
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] =...
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...
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...
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...
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...
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...
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...
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...