buggy
stringlengths
1
618k
fixed
stringlengths
16
618k
buggy_submission_id
stringlengths
10
10
fixed_submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
lang
stringclasses
1 value
buggy_verdict
stringclasses
2 values
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...
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: ...
s746865452
s417908155
p02238
python
Runtime Error
def bfs(graph, start, goal): visited = {start: None} unvisited = [start] while unvisited: now = unvisited[0] if now == goal: return "yes" unvisited = unvisited[1:] for next in graph[now][1:]: if not (next in visited): unvisited.append(n...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s299917511
s208042304
p02240
python
Time Limit Exceeded
def bfs(graph, start, goal, connection): visited = {start: None} unvisited = [start] while unvisited: now = unvisited[0] if now == goal or connection[1000000*now + goal] == 1: connection[1000000*start + goal] = 1 return "yes" unvisited = unvisited[1:] ...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s587501141
s208042304
p02240
python
Runtime Error
def bfs(graph, start, goal, connection): visited = {start: None} unvisited = [start] while unvisited: now = unvisited[0] if now == goal or (1000000*now + goal) in connection: connection[1000000*start + goal] = 1 return "yes" unvisited = unvisited[1:] f...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s659475018
s208042304
p02240
python
Time Limit Exceeded
def bfs(graph, start, goal, connection): visited = {start: None} unvisited = [start] while unvisited: now = unvisited[0] if now == goal or (1000000*now + goal) in connection: connection[1000000*start + goal] = 1 return "yes" unvisited = unvisited[1:] f...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s919171081
s208042304
p02240
python
Time Limit Exceeded
def bfs(graph, start, goal, connection): visited = {start: None} unvisited = [start] while unvisited: now = unvisited[0] if now == goal or (1000000*now + goal) in connection: connection[1000000*start + goal] = 1 return "yes" unvisited = unvisited[1:] f...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s194742667
s208042304
p02240
python
Runtime Error
def bfs(graph, start, goal, connection): visited = {start: None} unvisited = [start] while unvisited: now = unvisited[0] if now == goal or (1000000*now + goal) in connection: connection[1000000*start + goal] = 1 return "yes" unvisited = unvisited[1:] f...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s564812341
s208042304
p02240
python
Time Limit Exceeded
def bfs(graph, start, goal, connection): visited = {start: None} unvisited = [start] while unvisited: now = unvisited[0] if now == goal or (1000000*now + goal) in connection: connection[1000000*start + goal] = 1 connection[1000000*goal + start] = 1 return ...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s681371166
s208042304
p02240
python
Time Limit Exceeded
def bfs(graph, start, goal, connection): visited = {start: None} unvisited = [start] while unvisited: now = unvisited[0] if now == goal or (1000000*now + goal) in connection: connection[1000000*start + goal] = 1 connection[1000000*goal + start] = 1 return ...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s154964942
s208042304
p02240
python
Runtime Error
def bfs(graph, start, goal, connection): visited = {start: None} unvisited = [start] while unvisited: now = unvisited[0] if now == goal or (1000000*now + goal) in connection: connection[1000000*start + goal] = 1 connection[1000000*goal + start] = 1 return ...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s115018461
s208042304
p02240
python
Time Limit Exceeded
from collections import deque def bfs(graph, start, goal, connection): visited = {start: None} unvisited = deque(start) while unvisited: now = unvisited.popleft() if now == goal or (1000000*now + goal) in connection: connection[1000000*start + goal] = 1 connection[10...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s702764180
s208042304
p02240
python
Runtime Error
from collections import deque def bfs(graph, start, goal, connection): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() if now == goal or (1000000*now + goal) in connection: connection[1000000*start + goal] = 1 ...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s690019745
s208042304
p02240
python
Time Limit Exceeded
from collections import deque def bfs(graph, start, goal, connection): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() if now == goal or goal in c[now]: c[start].add(goal) c[goal].add(start) ...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s714663089
s208042304
p02240
python
Time Limit Exceeded
from collections import deque def bfs(graph, start, goal, connection): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() if now == goal or goal in connection[now]: connection[start].add(goal) connection...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s235452846
s208042304
p02240
python
Time Limit Exceeded
from collections import deque def bfs(graph, start, goal, connection): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() if now == goal or goal in connection[now]: connection[start].add(goal) connection...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s703685626
s208042304
p02240
python
Time Limit Exceeded
from collections import deque def bfs(graph, start, goal, connection): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() if now == goal or goal in connection[now]: connection[start].add(goal) connection...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s124531715
s208042304
p02240
python
Runtime Error
from collections import deque def bfs(graph, start, goal, connection): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() if now == goal or goal in connection[now]: connection[start].add(goal) connection...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s503368559
s208042304
p02240
python
Time Limit Exceeded
from collections import deque def bfs(graph, start, goal): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() if now == goal or goal in graph[now]: graph[start].add(goal) graph[goal].add(start) ...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s454306581
s208042304
p02240
python
Time Limit Exceeded
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s603437869
s208042304
p02240
python
Time Limit Exceeded
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s273450331
s208042304
p02240
python
Time Limit Exceeded
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
from collections import deque def bfs(graph, start): visited = {start: None} unvisited = deque() unvisited.append(start) while unvisited: now = unvisited.popleft() for next in graph[now]: if not (next in visited): unvisited.append(next) visite...
s468173104
s208042304
p02240
python
Time Limit Exceeded
n = int(input()) a = [] for i in range(n): inp = input() if "-1" in inp: inp = inp.replace("-1","10000") a.append(list(map(int, inp.split()))) w = 0 v = set(range(1,n)) edge = [ 0, 0] min_w = [-1,-1] min_idx = [-1,-1] while v: min_w[0] = min(a[edge[0]]) min_w[1] = min(a[edge[1]]) ...
n = int(input()) a = [] for i in range(n): inp = input() if "-1" in inp: inp = inp.replace("-1","10000") a.append(list(map(int, inp.split()))) w = 0 v = set() v.add(0) while len(v) < n: min_w = 10000 min_idx = 0 i = 0 for node in v: if min_w > min(a[node]): m...
s579017321
s623858315
p02241
python
Time Limit Exceeded
n = int(raw_input()) a = [] for i in range(n): inp = raw_input() if "-1" in inp: inp = inp.replace("-1","10000") a.append(list(map(int, inp.split()))) w = 0 v = set() v.add(0) while len(v) < n: min_w = 10000 min_idx = 0 i = 0 for node in v: if min_w > min(a[node]): ...
n = int(input()) a = [] for i in range(n): inp = input() if "-1" in inp: inp = inp.replace("-1","10000") a.append(list(map(int, inp.split()))) w = 0 v = set() v.add(0) while len(v) < n: min_w = 10000 min_idx = 0 i = 0 for node in v: if min_w > min(a[node]): m...
s737774930
s623858315
p02241
python
Runtime Error
import heapq def d_manhattan(node_list): s = 0 for i in range(9): x_goal = i%3 y_goal = i//3 x_now = (node_list[i] - 1)%3 y_now = (node_list[i] - 1)//3 if y_now == -1: y_now = 2 dx = abs(x_now - x_goal) dy = abs(y_now - y_goal) s += dx...
import heapq def d_manhattan(node_list): s = 0 for i in range(9): x_goal = i%3 y_goal = i//3 x_now = (node_list[i] - 1)%3 y_now = (node_list[i] - 1)//3 if y_now == -1: y_now = 2 dx = abs(x_now - x_goal) dy = abs(y_now - y_goal) s += dx...
s987136739
s602228517
p02245
python
Time Limit Exceeded
import heapq def d_manhattan(node_list): s = 0 for i in range(9): x_goal = i%3 y_goal = i//3 x_now = (node_list[i] - 1)%3 y_now = (node_list[i] - 1)//3 if y_now == -1: y_now = 2 dx = abs(x_now - x_goal) dy = abs(y_now - y_goal) s += dx...
import heapq def d_manhattan(node_list): s = 0 for i in range(9): x_goal = i%3 y_goal = i//3 x_now = (node_list[i] - 1)%3 y_now = (node_list[i] - 1)//3 if y_now == -1: y_now = 2 dx = abs(x_now - x_goal) dy = abs(y_now - y_goal) s += dx...
s183831576
s602228517
p02245
python
Runtime Error
import heapq def d_manhattan(node_list): s = 0 for i in range(9): x_goal = i%3 y_goal = i//3 x_now = (node_list[i] - 1)%3 y_now = (node_list[i] - 1)//3 if y_now == -1: y_now = 2 dx = abs(x_now - x_goal) dy = abs(y_now - y_goal) s += dx...
import heapq def d_manhattan(node_list): s = 0 for i in range(9): x_goal = i%3 y_goal = i//3 x_now = (node_list[i] - 1)%3 y_now = (node_list[i] - 1)//3 if y_now == -1: y_now = 2 dx = abs(x_now - x_goal) dy = abs(y_now - y_goal) s += dx...
s837433173
s602228517
p02245
python
Runtime Error
import heapq def d_manhattan(node_list): s = 0 for i in range(15): x_goal = i%4 y_goal = i//4 x_now = (node_list[i] - 1)%4 y_now = (node_list[i] - 1)//4 if y_now == -1: y_now = 3 dx = abs(x_now - x_goal) dy = abs(y_now - y_goal) s += d...
import heapq distance = ( (0,1,2,3,1,2,3,4,2,3,4,5,3,4,5,6), (1,0,1,2,2,1,2,3,3,2,3,4,4,3,4,5), (2,1,0,1,3,2,1,2,4,3,2,3,5,4,3,4), (3,2,1,0,4,3,2,1,5,4,3,2,6,5,4,3), (1,2,3,4,0,1,2,3,1,2,3,4,2,3,4,5), (2,1,2,3,1,0,1,2,2,1,2,3,3,2,3,4), ...
s515115311
s331792213
p02246
python
Runtime Error
import heapq def d_manhattan(node_list): s = 0 for i in range(15): x_goal = i%4 y_goal = i//4 x_now = (node_list[i] - 1)%4 y_now = (node_list[i] - 1)//4 if y_now == -1: y_now = 3 dx = abs(x_now - x_goal) dy = abs(y_now - y_goal) s += d...
import heapq distance = ( (0,1,2,3,1,2,3,4,2,3,4,5,3,4,5,6), (1,0,1,2,2,1,2,3,3,2,3,4,4,3,4,5), (2,1,0,1,3,2,1,2,4,3,2,3,5,4,3,4), (3,2,1,0,4,3,2,1,5,4,3,2,6,5,4,3), (1,2,3,4,0,1,2,3,1,2,3,4,2,3,4,5), (2,1,2,3,1,0,1,2,2,1,2,3,3,2,3,4), ...
s655613039
s331792213
p02246
python
Runtime Error
import heapq def d_manhattan(node_list): s = 0 for i in range(16): x_goal = i%4 y_goal = i//4 x_now = (node_list[i] - 1)%4 y_now = (node_list[i] - 1)//4 if y_now == -1: continue dx = abs(x_now - x_goal) dy = abs(y_now - y_goal) s += dx...
import heapq distance = ( (0,1,2,3,1,2,3,4,2,3,4,5,3,4,5,6), (1,0,1,2,2,1,2,3,3,2,3,4,4,3,4,5), (2,1,0,1,3,2,1,2,4,3,2,3,5,4,3,4), (3,2,1,0,4,3,2,1,5,4,3,2,6,5,4,3), (1,2,3,4,0,1,2,3,1,2,3,4,2,3,4,5), (2,1,2,3,1,0,1,2,2,1,2,3,3,2,3,4), ...
s594206986
s331792213
p02246
python
Time Limit Exceeded
import heapq def d_manhattan(node_list): s = 0 for i in range(16): x_goal = i%4 y_goal = i//4 x_now = (node_list[i] - 1)%4 y_now = (node_list[i] - 1)//4 if y_now == -1: continue dx = abs(x_now - x_goal) dy = abs(y_now - y_goal) s += dx...
import heapq distance = ( (0,1,2,3,1,2,3,4,2,3,4,5,3,4,5,6), (1,0,1,2,2,1,2,3,3,2,3,4,4,3,4,5), (2,1,0,1,3,2,1,2,4,3,2,3,5,4,3,4), (3,2,1,0,4,3,2,1,5,4,3,2,6,5,4,3), (1,2,3,4,0,1,2,3,1,2,3,4,2,3,4,5), (2,1,2,3,1,0,1,2,2,1,2,3,3,2,3,4), ...
s292302135
s331792213
p02246
python
Time Limit Exceeded
import heapq distance = ( (0,1,2,3,1,2,3,4,2,3,4,5,3,4,5,6), (1,0,1,2,2,1,2,3,3,2,3,4,4,3,4,5), (2,1,0,1,3,2,1,2,4,3,2,3,5,4,3,4), (3,2,1,0,4,3,2,1,5,4,3,2,6,5,4,3), (1,2,3,4,0,1,2,3,1,2,3,4,2,3,4,5), (2,1,2,3,1,0,1,2,2,1,2,3,3,2,3,4), ...
import heapq distance = ( (0,1,2,3,1,2,3,4,2,3,4,5,3,4,5,6), (1,0,1,2,2,1,2,3,3,2,3,4,4,3,4,5), (2,1,0,1,3,2,1,2,4,3,2,3,5,4,3,4), (3,2,1,0,4,3,2,1,5,4,3,2,6,5,4,3), (1,2,3,4,0,1,2,3,1,2,3,4,2,3,4,5), (2,1,2,3,1,0,1,2,2,1,2,3,3,2,3,4), ...
s083756368
s331792213
p02246
python
Time Limit Exceeded
import math a = list(map(int,input().split())) print(math.gcd(a[0],a[1])
a = input().split() x = int(a[0]) y = int(a[1]) while y: x, y = y, x%y print(x)
s427076002
s942951931
p02256
python
Runtime Error
import math a = list(map(int,input().split())) print(math.gcd(a[0],a[1]))
a = input().split() x = int(a[0]) y = int(a[1]) while y: x, y = y, x%y print(x)
s524876473
s942951931
p02256
python
Runtime Error
import math a = list(map(int,input().split())) print(math.gcd(a[0],a[1]))
a = input().split() x = int(a[0]) y = int(a[1]) while y: x, y = y, x%y print(x)
s474223872
s942951931
p02256
python
Runtime Error
n = int(input()) n_p = 0 for i in range(n): a = int(input()) if a == 2: n_p += 1 continue elif a % 2 == 0: continue else: j = 3 while j =< math.sqrt(a) if a%j == 0: break j += 2 else: n_p += 1 print n_p
import math n = int(input()) n_p = 0 for i in range(n): a = int(input()) if a == 2: n_p += 1 continue elif a % 2 == 0: continue else: j = 3 while j <= math.sqrt(a): if a%j == 0: break j += 2 else: n_p += ...
s766820641
s645818925
p02257
python
Runtime Error
n = int(input()) a = input().split() b = a[:] while flag: flag = 0 for i in range(n-1): if a[i][1] > a[i+1][1]: a[i][1], a[i+1][1] = a[i+1][1], a[i][1] flag = 1 print(*a) print("Stable") for i in range(n-1): min_j = i for j in range(i,n): if b[j][1] < b[min_j][1...
n = int(input()) a = input().split() b = a[:] flag = 1 while flag: flag = 0 for i in range(n-1): if a[i][1] > a[i+1][1]: a[i], a[i+1] = a[i+1], a[i] flag = 1 print(*a) print("Stable") for i in range(n-1): min_j = i for j in range(i,n): if b[j][1] < b[min_j][1]: ...
s270222431
s252960417
p02261
python
Runtime Error
n = int(input()) a = input().split() b = a[:] while flag: flag = 0 for i in range(n-1): if a[i][1] > a[i+1][1]: a[i][1], a[i+1][1] = a[i+1][1], a[i][1] flag = 1 print(*a) print("Stable") for i in range(n-1): min_j = i for j in range(i,n): if b[j][1] < b[min_j][1...
n = int(input()) a = input().split() b = a[:] flag = 1 while flag: flag = 0 for i in range(n-1): if a[i][1] > a[i+1][1]: a[i], a[i+1] = a[i+1], a[i] flag = 1 print(*a) print("Stable") for i in range(n-1): min_j = i for j in range(i,n): if b[j][1] < b[min_j][1]: ...
s890607117
s252960417
p02261
python
Runtime Error
def insertionSort(a,n,g): for i in range(g,n) v = a[i] j = i - g while j >= 0 and a[j] > v a[j + g] = a[j] j = j - g cnt += 1 a[j + g] = v n = int(input()) a = [int(input()) for i in range(n)] cnt = 0 i = 0 g = [1] while 3*g[i]+1 < n: g.appen...
def insertionSort(a,n,g): global cnt for i in range(g,n): v = a[i] j = i - g while j >= 0 and a[j] > v: a[j + g] = a[j] j = j - g cnt += 1 a[j + g] = v cnt = 0 n = int(input()) a = [int(input()) for i in range(n)] i = 0 g = [1] while 3*g[i]+1...
s281115840
s568759405
p02262
python
Runtime Error
def insertionSort(a,n,g): for i in range(g,n): v = a[i] j = i - g while j >= 0 and a[j] > v: a[j + g] = a[j] j = j - g global cnt += 1 a[j + g] = v cnt = 0 n = int(input()) a = [int(input()) for i in range(n)] i = 0 g = [1] while 3*g[i]+1 < n: ...
def insertionSort(a,n,g): global cnt for i in range(g,n): v = a[i] j = i - g while j >= 0 and a[j] > v: a[j + g] = a[j] j = j - g cnt += 1 a[j + g] = v cnt = 0 n = int(input()) a = [int(input()) for i in range(n)] i = 0 g = [1] while 3*g[i]+1...
s980335946
s568759405
p02262
python
Runtime Error
n = int(input()) l = [] for i in range(n): tmp = input().split() ope = tmp[0] if ope == "insert": m = tmp[1] l.insert(0,m) elif ope == "delete": m = tmp[1] if m in l: l.remove(m) elif ope == "deleteFirst": l.pop(0) elif ope == "deleteLast": ...
from collections import deque n = int(input()) d = deque() for i in range(n): tmp = input().split() ope = tmp[0] if ope == "insert": m = tmp[1] d.appendleft(m) elif ope == "delete": m = tmp[1] if m in d: d.remove(m) elif ope == "deleteFirst": d.po...
s096422476
s563096210
p02265
python
Time Limit Exceeded
n = int(input()) l = [] for i in range(n): line = input().split() if line[0] == "insert": l.append(line[1]) elif line[0] == "find": if line[1] in l: print("yes") else: print("no")
n = int(input()) d = {} for i in range(n): line = input().split() if line[0] == "insert": d[line[1]] = 1 elif line[0] == "find": if line[1] in d: print("yes") else: print("no")
s772468615
s070879101
p02269
python
Time Limit Exceeded
n = int(input()) l = [] for i in range(n): line = input().split() if line[0] == "insert": l.append(line[1]) elif line[0] == "find": if line[1] in l: print("yes") else: print("no")
n = int(input()) d = {} for i in range(n): line = input().split() if line[0] == "insert": d[line[1]] = 1 elif line[0] == "find": if line[1] in d: print("yes") else: print("no")
s715758133
s070879101
p02269
python
Time Limit Exceeded
n = int(input()) d = [] for i in range(n): line = input().split() if line[0] == "insert": d.append(line[1]) elif line[0] == "find": if line[1] in d: print("yes") else: print("no")
n = int(input()) d = {} for i in range(n): line = input().split() if line[0] == "insert": d[line[1]] = 1 elif line[0] == "find": if line[1] in d: print("yes") else: print("no")
s160094810
s070879101
p02269
python
Time Limit Exceeded
n = int(input()) d = [] for i in range(n): line = input().split() if line[0] == "insert": d.append(line[1]) elif line[0] == "find": if line[1] in d: print("yes") else: print("no")
n = int(input()) d = {} for i in range(n): line = input().split() if line[0] == "insert": d[line[1]] = 1 elif line[0] == "find": if line[1] in d: print("yes") else: print("no")
s059214343
s070879101
p02269
python
Time Limit Exceeded
n = int(input()) a = list(map(int,input().split())) q = int(input()) m = list(map(int,input().split())) def solve(i, m_i): if m_i == 0: return True if i >= n: return False res = solve(i + 1, m_i) or solve(i + 1, m_i - a[i]) return res for m_tmp in m: if solve(0, m_tmp): pri...
n = int(input()) a = list(map(int,input().split())) q = int(input()) m = list(map(int,input().split())) def solve(i, m_i): if m_i == 0: return True if i >= n: return False res = solve(i + 1, m_i) or solve(i + 1, m_i - a[i]) return res for m_tmp in m: if sum(a) < m_tmp: prin...
s569777027
s910190273
p02271
python
Time Limit Exceeded
n = int(input()) a = list(map(int,input().split())) flag = 1 count = 0 while flag: flag = 0 for i in range(n-1): if a[i] > a[i+1]: a[i], a[i+1] = a[i+1], a[i] count += 1 flag = 1 print(count)
n = int(input()) s = list(map(int,input().split())) count = 0 def merge(a, left, mid, right): global count l = a[left:mid] + [float("inf")] r = a[mid:right] + [float("inf")] i = j = 0 for k in range(left, right): if l[i] <= r[j]: a[k] = l[i] i += 1 else: ...
s497053542
s885612874
p02274
python
Time Limit Exceeded
n = int(input()) a = list(map(int,input().split())) x = a[-1] i = -1 for j in range(len(a)-1): if a[j] <= x: i += 1 a[i], a[j] = a[j], a[i] a[i + 1], a[n] = "[" + str(a[n]) + "]", a[i + 1] print(*a)
n = int(input()) a = list(map(int,input().split())) x = a[-1] i = -1 for j in range(len(a)-1): if a[j] <= x: i += 1 a[i], a[j] = a[j], a[i] a[i + 1], a[n - 1] = "[" + str(a[n - 1]) + "]", a[i + 1] print(*a)
s293091259
s102017440
p02276
python
Runtime Error
n = int(input()) tree = [None for i in range(n +1)] list_pre = list(map(int, input().split())) list_in = list(map(int, input().split())) def reconstruct(tree_pre, tree_in): if not tree_pre: return -1 root = tree_pre[0] idx = tree_in.index(root) tree[root] = (reconstruct(tree_pre[1:i + 1], tr...
n = int(input()) tree = [None for i in range(n +1)] list_pre = list(map(int, input().split())) list_in = list(map(int, input().split())) def solve(tree_pre, tree_in): if not tree_pre: return -1 root = tree_pre[0] idx = tree_in.index(root) tree[root] = (solve(tree_pre[1:idx + 1], tree_in[:idx...
s567997852
s258467208
p02282
python
Runtime Error
class BinaryTree(): def __init__(self): self.root = None def insert(self, insert_node): p = None r = self.root while r: p = r if insert_node.value < r.value: r = r.left else: r = r.right if not p: ...
class BinaryTree(): def __init__(self): self.root = None def insert(self, insert_node): p = None r = self.root while r: p = r if insert_node.value < r.value: r = r.left else: r = r.right if not p: ...
s092615453
s520941779
p02285
python
Runtime Error
class BinaryTree(): def __init__(self): self.root = None def insert(self, insert_node): p = None r = self.root while r: p = r if insert_node.value < r.value: r = r.left else: r = r.right if not p: ...
class BinaryTree(): def __init__(self): self.root = None def insert(self, insert_node): p = None r = self.root while r: p = r if insert_node.value < r.value: r = r.left else: r = r.right if not p: ...
s741820554
s520941779
p02285
python
Runtime Error
a = [] while True: inp = input().split() if inp[0] == "insert": a.append(int(inp[1])) elif inp[0] == "extract": a.sort() print(a.pop()) else: break
import heapq a = [] while True: inp = input().split() if inp[0] == "insert": heapq.heappush(a, -int(inp[1])) elif inp[0] == "extract": print(-heapq.heappop(a)) else: break
s435274818
s677648561
p02289
python
Time Limit Exceeded
a = [] while True: inp = input() if inp[0] == "i": a.append(int(inp[7:])) elif inp[0] == "e": a.sort() print(a.pop()) else: break
import heapq a = [] while True: inp = input().split() if inp[0] == "insert": heapq.heappush(a, -int(inp[1])) elif inp[0] == "extract": print(-heapq.heappop(a)) else: break
s107432913
s677648561
p02289
python
Runtime Error
a = [] while True: inp = input() if inp[0] == "i": a.append(int(inp[7:])) elif inp == "extract": a.sort() print(a.pop()) else: break
import heapq a = [] while True: inp = input().split() if inp[0] == "insert": heapq.heappush(a, -int(inp[1])) elif inp[0] == "extract": print(-heapq.heappop(a)) else: break
s872438540
s677648561
p02289
python
Time Limit Exceeded
n, q = map(int, input().split()) s =[set([i]) for i in range(n)] p =[i for i in range(n)] for i in range(q): com, x, y = map(int, input().split()) if com: if y in s[p[x]]: print(1) else: print(0) else: s[p[x]] = s[p[x]] | s[p[y]] p_x_tmp = p[x] p_y_tmp = p[y] ...
def find(x): global s if s[x] == x: return x s[x] = find(s[x]) return s[x] n, q = map(int, input().split()) s =[i for i in range(n)] for i in range(q): com, x, y = map(int, input().split()) if com: if find(x) == find(y): print(1) else: print(0) else: s[find...
s163780852
s859379953
p02343
python
Time Limit Exceeded
class dice: def __init__(self, pip): self.pip = pip def move(self,dir): if str(dir) == "E": self.pip[0],self.pip[2],self.pip[3],self.pip[5] = self.pip[3],self.pip[0],self.pip[5],self.pip[2] elif str(dir) == "W": self.pip[0],self.pip[2],self.pip[3],self.pi...
class dice: def __init__(self, pip): self.pip = pip def move(self,dir): if str(dir) == "E": self.pip[0],self.pip[2],self.pip[3],self.pip[5] = self.pip[3],self.pip[0],self.pip[5],self.pip[2] elif str(dir) == "W": self.pip[0],self.pip[2],self.pip[3],self.pi...
s516021491
s523104267
p02384
python
Runtime Error
l = input().split() print(int(l[0])*int(l[1]),2*int(l[0])+2*int(l[1])
inp=input().split() ab=[int(inp[0]),int(inp[1])] print(ab[0]*ab[1],ab[0]*2+ab[1]*2)
s081134996
s825520602
p02389
python
Runtime Error
ab=input() print(ab[0]*ab[1],ab[0]*2+ab[1]*2)
inp=input().split() ab=[int(inp[0]),int(inp[1])] print(ab[0]*ab[1],ab[0]*2+ab[1]*2)
s059816583
s825520602
p02389
python
Runtime Error
inp=input() a = int(inp[0]) b = int(inp[1]) if a < b: print("a < b") elif a > b: print("a > b") else: print("a == b")
inp=input().split() a = int(inp[0]) b = int(inp[1]) if a < b: print("a < b") elif a > b: print("a > b") else: print("a == b")
s799878173
s837907637
p02391
python
Runtime Error
a,b,c = int(input()) if a < b and b < c: print("Yes") else: print("No")
inp=input().split() if inp[0] < inp[1] and inp[1] < inp[2]: print("Yes") else: print("No")
s793240141
s219954368
p02392
python
Runtime Error
l = int(input()) if l[0] < l[1] and l[1] < l[2]: print("Yes") else: print("No")
inp=input().split() if inp[0] < inp[1] and inp[1] < inp[2]: print("Yes") else: print("No")
s827204843
s219954368
p02392
python
Runtime Error
l = input() if int(l[0]) < int(l[1]) and int(l[1]) < int(l[2]): print("Yes") else: print("No")
inp=input().split() if inp[0] < inp[1] and inp[1] < inp[2]: print("Yes") else: print("No")
s478062235
s219954368
p02392
python
Runtime Error
l = input() if int(l[0]) < int(l[1]) and int(l[1]) < int(l[2]): print("Yes") else: print("No")
inp=input().split() if inp[0] < inp[1] and inp[1] < inp[2]: print("Yes") else: print("No")
s961082452
s219954368
p02392
python
Runtime Error
inp = input().split() l = list(map(int,inp)).sort print(l[0],l[1],l[2])
inp = list(map(int,input().split())) inp.sort() print(inp[0],inp[1],inp[2])
s713439148
s497979190
p02393
python
Runtime Error
inp = input().split() l = list(map(int,inp)).sort() print(l[0],l[1],l[2])
inp = list(map(int,input().split())) inp.sort() print(inp[0],inp[1],inp[2])
s029899206
s497979190
p02393
python
Runtime Error
inp = input().split() l = list(map(int,inp)) l = l.sort() print(l[0],l[1],l[2])
inp = list(map(int,input().split())) inp.sort() print(inp[0],inp[1],inp[2])
s183843695
s497979190
p02393
python
Runtime Error
inp = list(map(int,input().split())) l = inp.sort() print(l[0],l[1],l[2])
inp = list(map(int,input().split())) inp.sort() print(inp[0],inp[1],inp[2])
s603593636
s497979190
p02393
python
Runtime Error
inp = list(map(int,input().split())) l = inp.sort() print(l[0],l[1],l[2])
inp = list(map(int,input().split())) inp.sort() print(inp[0],inp[1],inp[2])
s248196816
s497979190
p02393
python
Runtime Error
inp = list(map(int,input().split())) l = inp.sort() print(l[0],l[1],l[2])
inp = list(map(int,input().split())) inp.sort() print(inp[0],inp[1],inp[2])
s193781082
s497979190
p02393
python
Runtime Error
inp =list(map(int,input().split())) l=inp.sort() print(l[0],l[1],l[2])
inp = list(map(int,input().split())) inp.sort() print(inp[0],inp[1],inp[2])
s749355658
s497979190
p02393
python
Runtime Error
inp =list(map(int,input().split())) l=inp.sort() print(l[0],l[1],l[2])
inp = list(map(int,input().split())) inp.sort() print(inp[0],inp[1],inp[2])
s429159591
s497979190
p02393
python
Runtime Error
i = 1 while True: n = input() if n == 0: break print("Case ",i,": ",n,sep="")
i = 1 while True: n = int(input()) if n == 0: break print("Case ",i,": ",n,sep="") i += 1
s934805363
s465460886
p02396
python
Runtime Error
a,b = map(int,input().split())) print("%d %d %.5f\n" %(a//b,a%b,a/b))
a,b = map(int,input().split()) print("%d %d %.5f\n" % (a//b,a%b,a/b))
s026570895
s692974813
p02399
python
Runtime Error
a,b = map(int,input().split())) print("%d %d %.5f\n"%(a//b,a%b,a/b))
a,b = map(int,input().split()) print("%d %d %.5f\n" % (a//b,a%b,a/b))
s441468085
s692974813
p02399
python
Runtime Error
a,b = map(int,input().split())) print('%d %d %.5f\n'%(a//b,a%b,a/b))
a,b = map(int,input().split()) print("%d %d %.5f\n" % (a//b,a%b,a/b))
s883818198
s692974813
p02399
python
Runtime Error
while True: h,w = map(int,input().split()) if h == 0 and w == 0: break for i in range(h) print("#" * w) print()
while True: h,w = map(int,input().split()) if h == 0 and w == 0: break for i in range(h): print("#"*w) print("")
s411167706
s200521013
p02403
python
Runtime Error
while True: h,w = map(int,input().split()) if h == 0 and w == 0: break for i in range(h) print("#" * w) print("")
while True: h,w = map(int,input().split()) if h == 0 and w == 0: break for i in range(h): print("#"*w) print("")
s646334776
s200521013
p02403
python
Runtime Error
while True: h,w = map(int,input().split()) if h == 0 and w == 0: break for i in range(h) print("#"*w) print()
while True: h,w = map(int,input().split()) if h == 0 and w == 0: break for i in range(h): print("#"*w) print("")
s691968173
s200521013
p02403
python
Runtime Error
while True: h,w = map(int,input().split()) if h == 0 and w == 0: break for i in range(h) print("#") print()
while True: h,w = map(int,input().split()) if h == 0 and w == 0: break for i in range(h): print("#"*w) print("")
s457781825
s200521013
p02403
python
Runtime Error
while True: h,w = map(int,input().split()) if h == 0 and w == 0: break for i in range(h) print("#" * w)
while True: h,w = map(int,input().split()) if h == 0 and w == 0: break for i in range(h): print("#"*w) print("")
s422721603
s200521013
p02403
python
Runtime Error
while True: h,w = map(int,input().split())
while True: h,w = map(int,input().split()) if h == 0 and w == 0: break for i in range(h): print("#"*w) print("")
s521397624
s200521013
p02403
python
Runtime Error
while True: h,w = map(int,input().split()) if h == 0 and w == 0: break sym1 = "#" sym2 = "." for i in range(h): if i%2 = 1: sym1 = "#" sym2 = "." else: sym1 = "." sym2 = "#" for j in range(w): if j%2 == 1: print(sym1,end=...
while True: h,w = map(int,input().split()) if h == 0 and w == 0: break for i in range(h): if i%2 == 1: sym1 = "#" sym2 = "." else: sym1 = "." sym2 = "#" for j in range(w): if j%2 == 1: print(sym1,end...
s548302228
s221416183
p02405
python
Runtime Error
while True: h,w = map(int,input().split()) if h == 0 and w == 0: break for i in range(h): if i%2 = 1: sym1 = "#" sym2 = "." else: sym1 = "." sym2 = "#" for j in range(w): if j%2 == 1: print(sym1,end=...
while True: h,w = map(int,input().split()) if h == 0 and w == 0: break for i in range(h): if i%2 == 1: sym1 = "#" sym2 = "." else: sym1 = "." sym2 = "#" for j in range(w): if j%2 == 1: print(sym1,end...
s074855470
s221416183
p02405
python
Runtime Error
n = int(input()) inp = map(int,input().split()) inp.reverse() for i in range(n-1): print(inp[i]," ",sep="",end="") print(inp[n-1])
n = int(input()) inp = list(map(int,input().split())) inp.reverse() for i in range(n-1): print(inp[i]," ",sep="",end="") print(inp[n-1])
s410839263
s473339781
p02407
python
Runtime Error
n = int(input()) inp = map(int,input().split()) inp.reverse() print(inp[n-1])
n = int(input()) inp = list(map(int,input().split())) inp.reverse() for i in range(n-1): print(inp[i]," ",sep="",end="") print(inp[n-1])
s364964825
s473339781
p02407
python
Runtime Error
n = int(input()) inp = map(int,input().split()) inp.reverse() for i in range(n-1): print(inp[i]," ",sep="",end="")
n = int(input()) inp = list(map(int,input().split())) inp.reverse() for i in range(n-1): print(inp[i]," ",sep="",end="") print(inp[n-1])
s732680413
s473339781
p02407
python
Runtime Error
card = [] suit = ["S","H","C","D"] for s in suit: for i in range(1,14): card.append(s + " " + str(i)) n = int(input()) for i in range(n) card.remove(input()) for c in card: print(c)
card = [] suit = ["S","H","C","D"] for s in suit: for i in range(1,14): card.append(s + " " + str(i)) n = int(input()) for i in range(n): card.remove(input()) for c in card: print(c)
s673404524
s275142413
p02408
python
Runtime Error
of = [[0 for i in range(10)] for j in range(12)] n = int(input()) for i in range(n): b,f,r,v = map(int,input().split()) of[3*(b-1)+f][r] += v for i in range(12): if i%3 == 0: print("####################") for j in range(10): print(" ",of[i][j],sep="",end="") print("")
of = [[0 for i in range(10)] for j in range(12)] n = int(input()) for i in range(n): b,f,r,v = map(int,input().split()) of[3*(b-1)+f-1][r-1] += v for i in range(12): if i%3 == 0 and i !=0: print("####################") for j in range(10): print(" ",of[i][j],sep="",end="") print("")
s240267603
s694895656
p02409
python
Runtime Error
n,m = map(int,input().split()) a=[] for i in range(n): a[i] = list(map(int,input().split())) b=[] for i in range(m): b.append(int(input())) for i in range(n): c = 0 for j in range(m): c += a[i][j]*b[j] print(c)
n,m = map(int,input().split()) a = [[0 for i in range(m)] for j in range(n)] for i in range(n): a_tmp = list(map(int,input().split())) for j in range(m): a[i][j] = a_tmp[j] b=[] for i in range(m): b.append(int(input())) for i in range(n): c = 0 for j in range(m): c += a[i][j]...
s912345861
s131242353
p02410
python
Runtime Error
n,m = map(int,input().split()) a = [[0 for i in range(m)] for j in range(n)] for i in range(n): a_tmp = list(map(int,input().split())) for j in range(m): a[i][j] = a_tmp[j] b=[] for i in range(m): b.append(int(input())) for i in range(n): c = 0 for j in range(m): c += a[i][j]*b[j] ...
n,m = map(int,input().split()) a = [[0 for i in range(m)] for j in range(n)] for i in range(n): a_tmp = list(map(int,input().split())) for j in range(m): a[i][j] = a_tmp[j] b=[] for i in range(m): b.append(int(input())) for i in range(n): c = 0 for j in range(m): c += a[i][j]...
s559206194
s131242353
p02410
python
Runtime Error
n,m = map(int,input().split()) a = [[0 for i in range(m)] for j in range(n)] for i in range(n): a_tmp = list(map(int,input().split())) for j in range(m): a[i][j] = a_tmp[j]
n,m = map(int,input().split()) a = [[0 for i in range(m)] for j in range(n)] for i in range(n): a_tmp = list(map(int,input().split())) for j in range(m): a[i][j] = a_tmp[j] b=[] for i in range(m): b.append(int(input())) for i in range(n): c = 0 for j in range(m): c += a[i][j]...
s340573107
s131242353
p02410
python
Runtime Error
n,m = map(int,input().split()) a = [[0 for i in range(m)] for j in range(n)] for i in range(n): a_tmp = list(map(int,input().split())) for j in range(m): a[i][j] = a_tmp[j]
n,m = map(int,input().split()) a = [[0 for i in range(m)] for j in range(n)] for i in range(n): a_tmp = list(map(int,input().split())) for j in range(m): a[i][j] = a_tmp[j] b=[] for i in range(m): b.append(int(input())) for i in range(n): c = 0 for j in range(m): c += a[i][j]...
s974297183
s131242353
p02410
python
Runtime Error
n,m = map(int,input().split()) a = [[0 for i in range(n)] for j in range(m)] for i in range(n): a_tmp = list(map(int,input().split())) for j in range(m): a[i][j] = a_tmp[j] b=[] for i in range(m): b.append(int(input())) for i in range(n): c = 0 for j in range(m): c += a[i][j]*b[j] ...
n,m = map(int,input().split()) a = [[0 for i in range(m)] for j in range(n)] for i in range(n): a_tmp = list(map(int,input().split())) for j in range(m): a[i][j] = a_tmp[j] b=[] for i in range(m): b.append(int(input())) for i in range(n): c = 0 for j in range(m): c += a[i][j]...
s133956691
s131242353
p02410
python
Runtime Error
r,c = map(int,input().split()) a = [[0 for i in range(c+1)] for j in range(r+1)] for i in range(r): a_tmp = list(map(int,input().split())) for j in range(c): a[i][j] = a_tmp[j] a[i][c+1] += a_tmp[j] a[r+1][j] += a_tmp[j] a[r+1][c+1] += a_tmp[j] for i in range(r+1): print('...
r,c = map(int,input().split()) a = [[0 for i in range(c+1)] for j in range(r+1)] for i in range(r): a_tmp = list(map(int,input().split())) for j in range(c): a[i][j] = a_tmp[j] a[i][c] += a_tmp[j] a[r][j] += a_tmp[j] a[r][c] += a_tmp[j] for i in range(r+1): print(' '.join(...
s598149380
s424337956
p02413
python
Runtime Error
r,c = map(int,input().split()) a = [[0 for i in range(c+1)] for j in range(r+1)] for i in range(r): a_tmp = list(map(int,input().split())) for j in range(c): a[i][j] = a_tmp[j] a[i][c+1] += a_tmp[j] a[r+1][j] += a_tmp[j] a[r+1][c+1] += a_tmp[j] for i in range(r+1): print('...
r,c = map(int,input().split()) a = [[0 for i in range(c+1)] for j in range(r+1)] for i in range(r): a_tmp = list(map(int,input().split())) for j in range(c): a[i][j] = a_tmp[j] a[i][c] += a_tmp[j] a[r][j] += a_tmp[j] a[r][c] += a_tmp[j] for i in range(r+1): print(' '.join(...
s829105512
s424337956
p02413
python
Runtime Error
import sys w = input() t = sys.stdin.read().split() print(t.lower().count(w))
import sys w = input() t = sys.stdin.read().lower().split() print(t.count(w))
s298740933
s660280241
p02419
python
Runtime Error
import sys w = input() t = sys.stdin.read().split() print(t.lower().count(w))
import sys w = input() t = sys.stdin.read().lower().split() print(t.count(w))
s279103759
s660280241
p02419
python
Runtime Error
dxy = [[1, 0], [0, 1], [-1, 0], [0, -1]] field = [] H, W = 0, 0 def solver(x, y, symbol): global field, H, W if x < 0 or y < 0 or x >= H or y >= W: return for dx, dy in dxy: if x+dx < 0 or y+dy < 0 or x+dx >= H or y+dy >= W: continue if field[x+dx][y+dy] == symbol: field[x+dx][y+dy] = '.' ...
import Queue dxy = [[1, 0], [0, 1], [-1, 0], [0, -1]] field = [] H, W = 0, 0 q = Queue.Queue() def solver(x, y, symbol): global q, field, H, W while True: if x < 0 or y < 0 or x >= H or y >= W: continue for dx, dy in dxy: if x+dx < 0 or y+dy < 0 or x+dx >= H or y+dy >= W: continue ...
s038087022
s101458792
p00118
python
Runtime Error
dxy = [[1, 0], [0, 1], [-1, 0], [0, -1]] field = [] H, W = 0, 0 def solver(x, y, symbol): global field, H, W if x < 0 or y < 0 or x >= H or y >= W: return for dx, dy in dxy: if x+dx < 0 or y+dy < 0 or x+dx >= H or y+dy >= W: continue if field[x+dx][y+dy] == symbol: field[x+dx][y+dy] = '.'...
import Queue dxy = [[1, 0], [0, 1], [-1, 0], [0, -1]] field = [] H, W = 0, 0 q = Queue.Queue() def solver(x, y, symbol): global q, field, H, W while True: if x < 0 or y < 0 or x >= H or y >= W: continue for dx, dy in dxy: if x+dx < 0 or y+dy < 0 or x+dx >= H or y+dy >= W: continue ...
s820051097
s101458792
p00118
python
Runtime Error
dxy = [[1, 0], [0, 1], [-1, 0], [0, -1]] field = [] H, W = 0, 0 q = queue.Queue() def solver(x, y, symbol): global q, field, H, W while True: if x < 0 or y < 0 or x >= H or y >= W: continue for dx, dy in dxy: if x+dx < 0 or y+dy < 0 or x+dx >= H or y+dy >= W: continue if field[x+d...
import Queue dxy = [[1, 0], [0, 1], [-1, 0], [0, -1]] field = [] H, W = 0, 0 q = Queue.Queue() def solver(x, y, symbol): global q, field, H, W while True: if x < 0 or y < 0 or x >= H or y >= W: continue for dx, dy in dxy: if x+dx < 0 or y+dy < 0 or x+dx >= H or y+dy >= W: continue ...
s276510888
s101458792
p00118
python
Runtime Error
import sys def dijkstra(m, start, goal, matrix): defnode = {} cost = [sys.maxint for i in xrange(m+1)] cost[start] = 0 node = start while True: defnode[node] = True for i in xrange(1, m+1): if i in defnode: continue if matrix[node][i] == sys.maxint: continue cost[i] ...
import sys def dijkstra(m, start, goal, matrix): defnode = [False] * (m+1) cost = [sys.maxint] * (m+1) cost[start] = 0 node = start while True: defnode[node] = True for i in xrange(1, m+1): if defnode[i]: continue if matrix[node][i] == sys.maxint: continue cost[i] = ...
s565433124
s974283142
p00200
python
Time Limit Exceeded