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
N = int(input()) bit = 0 for i in range(N): a = int(input()) bit = bit ^ 2 ** a bit = str(bin(bit)) count = 0 for i in bit: if i == "1": count += 1 print(count)
N = int(input()) L = [] for i in range(N): a = int(input()) L.append(a) L.sort() ptr = 0 temp = 0 num = 1 ans = 0 while ptr < N: cc = L[ptr] f = 0 while ptr < N and L[ptr] == cc:#同じ数字が続く終了条件 f += 1 ptr += 1 ans += f%2 print(ans)
s937227919
s392660831
p03607
python
Time Limit Exceeded
def kouyaku(a,b): aa = max(a,b) bb = min(a,b) if bb == 0: return aa else: return kouyaku(bb,aa%bb) N = int(input()) T = [] for i in range(N): T.append(int(input())) ans = T[0] for time in T: ans = int( ans / kouyaku(ans, time) * time) print(ans)
def kouyaku(a,b): aa = max(a,b) bb = min(a,b) if bb == 0: return aa else: return kouyaku(bb,aa%bb) N = int(input()) T = [] for i in range(N): T.append(int(input())) T.sort() ans = T[0] for time in T: kou = kouyaku(ans, time) if kou != time: ans = ans//kou * time ...
s708526037
s744244645
p03633
python
Runtime Error
def kouyaku(a,b): aa = max(a,b) bb = min(a,b) if bb == 0: return aa else: return kouyaku(bb,aa%bb) N = int(input()) T = [] for i in range(N): T.append(int(input())) ans = 0 for time in T: if ans: ans = int( ans * time / kouyaku(ans, time) ) else: ans = time ...
def kouyaku(a,b): aa = max(a,b) bb = min(a,b) if bb == 0: return aa else: return kouyaku(bb,aa%bb) N = int(input()) T = [] for i in range(N): T.append(int(input())) T.sort() ans = T[0] for time in T: kou = kouyaku(ans, time) if kou != time: ans = ans//kou * time ...
s801935897
s744244645
p03633
python
Runtime Error
def kouyaku(a,b): aa = max(a,b) bb = min(a,b) if bb == 0: return aa else: return kouyaku(bb,aa%bb) N = int(input()) T = [] for i in range(N): T.append(int(input())) T.sort() T.reverse() ans = 0 for time in T: if ans: ans = int( ans * time / kouyaku(ans, time) ) els...
def kouyaku(a,b): aa = max(a,b) bb = min(a,b) if bb == 0: return aa else: return kouyaku(bb,aa%bb) N = int(input()) T = [] for i in range(N): T.append(int(input())) T.sort() ans = T[0] for time in T: kou = kouyaku(ans, time) if kou != time: ans = ans//kou * time ...
s607728492
s744244645
p03633
python
Runtime Error
import sys input = sys.stdin.readline def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] prev = [None] * N d...
import sys input = sys.stdin.readline def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] prev = [None] * N d...
s249736845
s546207985
p03634
python
Runtime Error
import sys input = sys.stdin.readline def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] prev = [None] * N d...
import sys input = sys.stdin.readline def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] prev = [None] * N d...
s501202824
s546207985
p03634
python
Runtime Error
import sys input = sys.stdin.readline def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] prev = [None] * N d...
import sys input = sys.stdin.readline def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] prev = [None] * N d...
s935425439
s546207985
p03634
python
Runtime Error
import sys input = sys.stdin.readline def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] prev = [None] * N d...
import sys input = sys.stdin.readline def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] prev = [None] * N d...
s371342853
s546207985
p03634
python
Runtime Error
import sys input = sys.stdin.readline def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] prev = [None] * N d...
import sys input = sys.stdin.readline def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] prev = [None] * N d...
s721675215
s546207985
p03634
python
Time Limit Exceeded
def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] prev = [None] * N d = [float("inf")] * N Q.append(star...
import sys input = sys.stdin.readline def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] prev = [None] * N d...
s873301926
s546207985
p03634
python
Time Limit Exceeded
def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] d = [float("inf")] * N Q.append(start) d[start] = 0 ...
import sys input = sys.stdin.readline def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] prev = [None] * N d...
s407406237
s546207985
p03634
python
Time Limit Exceeded
def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] d = [float("inf")] * N Q.append(start) d[start] = 0 ...
import sys input = sys.stdin.readline def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] prev = [None] * N d...
s436233707
s546207985
p03634
python
Runtime Error
def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] d = [float("inf")] * N Q.append(start) d[start] = 0 ...
import sys input = sys.stdin.readline def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] prev = [None] * N d...
s479832013
s546207985
p03634
python
Time Limit Exceeded
def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] d = [float("inf")] * N Q.append(start) d[start] = 0 ...
import sys input = sys.stdin.readline def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] prev = [None] * N d...
s211719833
s546207985
p03634
python
Time Limit Exceeded
def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = {} for i in range(N): graph[i] = {} for edge in edges: a, b, c = edge graph[a][b] = c graph[b][a] = c return graph def BFS(N, graph, start): Q = [] V = [] prev = {} d = {} for i in range(N): ...
import sys input = sys.stdin.readline def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] prev = [None] * N d...
s843344804
s546207985
p03634
python
Time Limit Exceeded
def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = {} for i in range(N): graph[i] = {} for j in range(N): graph[i][j] = 0 for edge in edges: a, b, c = edge graph[a][b] = c graph[b][a] = c return graph def BFS(N, graph, start): Q = [] V = [] ...
import sys input = sys.stdin.readline def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = [ [] for i in range(N)] for edge in edges: a, b, c = edge graph[a].append((b,c)) graph[b].append((a,c)) return graph def BFS(N, graph, start): Q = [] V = [] prev = [None] * N d...
s909393442
s546207985
p03634
python
Time Limit Exceeded
H, W = (int(i) for i in input().split()) N = int(input()) A = [int(i) for i in input().split()] C = [] for i in range(N): for j in range(A[i]): C.append(i+1) ans = [[0]*W for i in range(H)] for i in range(H*W): y = i // W if y%2==0: x = i%W else: x = W-1-i%W ans[x][y] = C[i] for i in range(H): a...
N = int(input()) A = [int(i) for i in input().split()] c4=0 c2=0 for i in range(N): if A[i]%4==0: c4+=1 elif A[i]%2==0: c2+=1 if c4: a = c4*2+1 else: a = 0 if c2>1: b = c2 if a: a -= 1 else: b = 0 if a+b>=N: print("Yes") else: print("No")
s182790772
s710826656
p03639
python
Runtime Error
N = int(input()) A = [int(i) for i in input().split()] c4=0 c2=0 for i in range(N): if A[i]%4==0: c4+=1 elif A[i]%2==0: c2+=1 if c4: a = c4*2+1 else: a = 0 if c2>1: b = c2b if a: a -= 1 else: b = 0 if a+b>=N: print("Yes") else: print("No")
N = int(input()) A = [int(i) for i in input().split()] c4=0 c2=0 for i in range(N): if A[i]%4==0: c4+=1 elif A[i]%2==0: c2+=1 if c4: a = c4*2+1 else: a = 0 if c2>1: b = c2 if a: a -= 1 else: b = 0 if a+b>=N: print("Yes") else: print("No")
s570874696
s710826656
p03639
python
Runtime Error
H, W = (int(i) for i in input().split()) N = int(input()) A = [int(i) for i in input().split()] C = [] for i in range(N): for j in range(A[i]): C.append(i+1) ans = [[0]*W for i in range(H)] for i in range(H*W): y = i // W if y%2==0: x = i%W else: x = W-1-i%W ans[x][y] = C[i] for i in range(H): a...
H, W = (int(i) for i in input().split()) N = int(input()) A = [int(i) for i in input().split()] C = [] for i in range(N): for j in range(A[i]): C.append(i+1) ans = [[0]*W for i in range(H)] for i in range(H*W): y = i // W if y%2==0: x = i%W else: x = W-1-i%W ans[y][x] = C[i] for i in range(H): a...
s908265102
s163055391
p03640
python
Runtime Error
H, W = (int(i) for i in input().split()) N = int(input()) A = [int(i) for i in input().split()] C = [] for i in range(N): for j in range(a[i]): C.append(i+1) ans = [[0]*W for i in range(H)] for i in range(HW): y = i // W if y%2==0: x = i%W else: x = W-1-i%W ans[x][y] = C[i] for i in range(H): an...
H, W = (int(i) for i in input().split()) N = int(input()) A = [int(i) for i in input().split()] C = [] for i in range(N): for j in range(A[i]): C.append(i+1) ans = [[0]*W for i in range(H)] for i in range(H*W): y = i // W if y%2==0: x = i%W else: x = W-1-i%W ans[y][x] = C[i] for i in range(H): a...
s175268616
s163055391
p03640
python
Runtime Error
K = int(input()) ans = [K//50 + i for i in range(50)] if K%50: for i in range(K%50): ans[i] += 50 print(50) print(" ".join(ans))
K = int(input()) ans = [K//50 + i for i in range(50)] if K%50: for i in range(K%50): ans[i] += 51 ans = [a-1 for a in ans] print(50) ans = [str(a) for a in ans] print(" ".join(ans))
s687029102
s799086914
p03648
python
Runtime Error
K = int(input()) ans = [K//50 + i for i in range(50)] if K%50: for i in range(K%50): ans[i] += N print(50) print(" ".join(ans))
K = int(input()) ans = [K//50 + i for i in range(50)] if K%50: for i in range(K%50): ans[i] += 51 ans = [a-1 for a in ans] print(50) ans = [str(a) for a in ans] print(" ".join(ans))
s321595745
s799086914
p03648
python
Runtime Error
N = int(input()) G = [[] for i in range(N)] for i in range(N-1): a, b = (int(i) for i in input().split()) G[a-1].append(b-1) G[b-1].append(a-1) prev = [-1]*N dp = [0]*(N+1) def DFS(start): res = 0 for u in G[start]: if u != prev[start]: prev[u] = start res += DFS(u) ...
import sys sys.setrecursionlimit(100000) N = int(input()) G = [[] for i in range(N)] for i in range(N-1): a, b = (int(i) for i in input().split()) G[a-1].append(b-1) G[b-1].append(a-1) prev = [-1]*N def DFS(start): res = 0 for u in G[start]: if u != prev[start]: prev[u] = start...
s265688022
s254534600
p03662
python
Runtime Error
N, K = (int(i) for i in input().split()) L = [] for i in range(N): a, b = (int(i) for i in input().split()) L = L + [a]*b if len(L) > K: L.sort() L = L[:K] if L[-1] == 1: print(1) break else: print(L[-1])
N, K = (int(i) for i in input().split()) D = {} count = 0 for i in range(N): a, b = (int(i) for i in input().split()) if a in D: D[a] += b else: D[a] = b else: aL = [a for a in D.keys()] aL.sort() for a in aL: count += D[a] if count >= K: print(a) ...
s720598765
s266827761
p03721
python
Time Limit Exceeded
N, M = (int(i) for i in input().split()) DP = [False]*N for i in range(M): a, b = (int(k) for k in input().split()) for j in (a, b): DP[j-1] = not DP[j-1] for i in range(N): if DP[i]: print(NO) break else: print(YES)
N, M = (int(i) for i in input().split()) DP = [False]*N for i in range(M): a, b = (int(k) for k in input().split()) for j in (a, b): DP[j-1] = not DP[j-1] for i in range(N): if DP[i]: print('NO') break else: print('YES')
s673415900
s598069444
p03724
python
Runtime Error
N, M = (int(i) for i in input().split()) DP = [False]*N for i in range(M): a, b = (int(i) for i in input().split()) for j in (a, b): DP[j-1] = not DP[j-1] for i in range(N): if DP[i]: print(NO) break else: print(YES)
N, M = (int(i) for i in input().split()) DP = [False]*N for i in range(M): a, b = (int(k) for k in input().split()) for j in (a, b): DP[j-1] = not DP[j-1] for i in range(N): if DP[i]: print('NO') break else: print('YES')
s875873162
s598069444
p03724
python
Runtime Error
N, M = (int(i) for i in input().split()) DP[N] = [False]*N for i in range(M): a, b = (int(i) for i in input().split()) for j in (a, b): DP[j-1] = not DP[j-1] for i in range(N): if DP[i]: print(NO) break else: print(YES)
N, M = (int(i) for i in input().split()) DP = [False]*N for i in range(M): a, b = (int(k) for k in input().split()) for j in (a, b): DP[j-1] = not DP[j-1] for i in range(N): if DP[i]: print('NO') break else: print('YES')
s947881406
s598069444
p03724
python
Runtime Error
N, M = (int(i) for i in input().split()) DP[N] = [False]*N for i in range(M): a, b = (int(i) for i in input().split()) for i in (a, b): DP[i-1] = not DP[i-1] for i in range(N): if DP[i]: print(NO) break else: print(YES)
N, M = (int(i) for i in input().split()) DP = [False]*N for i in range(M): a, b = (int(k) for k in input().split()) for j in (a, b): DP[j-1] = not DP[j-1] for i in range(N): if DP[i]: print('NO') break else: print('YES')
s457794533
s598069444
p03724
python
Runtime Error
N, M = (int(i) for i in input().split()) DP[N] = [False]*N for i in range(M): a, b = (int(i) for i in input().split()) for i in (a, b): DP[i] = not DP[i] for i in range(N): if DP[i]: print(NO) break else: print(YES)
N, M = (int(i) for i in input().split()) DP = [False]*N for i in range(M): a, b = (int(k) for k in input().split()) for j in (a, b): DP[j-1] = not DP[j-1] for i in range(N): if DP[i]: print('NO') break else: print('YES')
s692693354
s598069444
p03724
python
Runtime Error
N, W = (int(i) for i in input().split()) w = [0]*N v = [0]*N for i in range(N): w[i], v[i] = (int(j) for j in input().split()) w0 = w[0] wh = [a - w0 for a in w] dp = [[[-1]*(N+1) for i in range(3*N+1)] for j in range(N+1)] dp[0][0][0] = 0 for i in range(N): for j in range(3*N+1): for k in range(N+1): if ...
N, W = (int(i) for i in input().split()) w = [0]*N v = [0]*N for i in range(N): w[i], v[i] = (int(j) for j in input().split()) w0 = w[0] wh = [a - w0 for a in w] dp = [[[-1]*(N+1) for i in range(3*N+1)] for j in range(N+1)] dp[0][0][0] = 0 for i in range(N): for j in range(3*N+1): for k in range(N+1): if ...
s081794233
s296130824
p03734
python
Runtime Error
N, W = (int(i) for i in input().split()) w = [0]*N v = [0]*N for i in range(N): w[i], v[i] = (int(j) for j in input().split()) w0 = w[0] wh = [a - w0 for a in w] dp = [[[-1]*(N+1) for i in range(3*N+1)] for j in range(N+1)] dp[0][0][0] = 0 for i in range(N): for j in range(3*N+1): for k in range(N+1): if ...
N, W = (int(i) for i in input().split()) w = [0]*N v = [0]*N for i in range(N): w[i], v[i] = (int(j) for j in input().split()) w0 = w[0] wh = [a - w0 for a in w] dp = [[[-1]*(N+1) for i in range(3*N+1)] for j in range(N+1)] dp[0][0][0] = 0 for i in range(N): for j in range(3*N+1): for k in range(N+1): if ...
s279767174
s296130824
p03734
python
Runtime Error
N, W = (int(i) for i in input().split()) w = [0]*N w0 = w[0] wh = [a - w0 for a in W] v = [0]*N for i in range(N): w[i], v[i] = (int(i) for i in input().split()) dp = [[[0]*(N+1) for i in range(3N+1)] for j in range(N+1)] for i in range(N): for j in range(3N+1): for k in range(N+1): dp[i+1][j][k] = max(dp...
N, W = (int(i) for i in input().split()) w = [0]*N v = [0]*N for i in range(N): w[i], v[i] = (int(j) for j in input().split()) w0 = w[0] wh = [a - w0 for a in w] dp = [[[-1]*(N+1) for i in range(3*N+1)] for j in range(N+1)] dp[0][0][0] = 0 for i in range(N): for j in range(3*N+1): for k in range(N+1): if ...
s195383836
s296130824
p03734
python
Runtime Error
S = input() T = input() N = len(S) M = len(M) Ss = [0]*(N+1) Ts = [0]*(M+1) for i in range(N): if S[i] == "A": temp = 1 else: temp = -1 Ss[i+1] = Ss[i] + temp for i in range(M): if T[i] == "A": temp = 1 else: temp = -1 Ts[i+1] = Ts[i] + temp Q = int(input()) for i in range(Q): a, b, c, d =...
S = input() T = input() N = len(S) M = len(T) Ss = [0]*(N+1) Ts = [0]*(M+1) for i in range(N): if S[i] == "A": temp = 1 else: temp = -1 Ss[i+1] = Ss[i] + temp for i in range(M): if T[i] == "A": temp = 1 else: temp = -1 Ts[i+1] = Ts[i] + temp Q = int(input()) for i in range(Q): a, b, c, d =...
s756643642
s666839377
p03765
python
Runtime Error
N, Ma, Mb= (int(i) for i in input().split()) L = [] for i in range(N): a, b, c = (int(i) for i in input().split()) L.append((a, b, c)) dp= [[[float("inf")] * (10 * N + 11) for a in range(10 * N + 11) ] for i in range(N + 1)] dp[0][0][0] = 0 for i in range(N): a, b, c = L[i] for ca in range(10 * N + 1)...
N, Ma, Mb= (int(i) for i in input().split()) L = [] for i in range(N): a, b, c = (int(i) for i in input().split()) L.append((a, b, c)) dp= [[[float("inf")] * (10 * N + 11) for a in range(10 * N + 11) ] for i in range(N + 1)] dp[0][0][0] = 0 for i in range(N): a, b, c = L[i] for ca in range(10 * N + 1)...
s514749655
s675749327
p03806
python
Time Limit Exceeded
N, Ma, Mb= (int(i) for i in input().split()) L = [] for i in range(N): a, b, c = (int(i) for i in input().split()) L.append((a-1, b-1, c)) dp= [[[float("inf")] * (10 * N + 11) for a in range(10 * N + 11) ] for i in range(N + 1)] dp[0][0][0] = 0 for i in range(N + 1): a, b, c = L[i] for ca in range(10 ...
N, Ma, Mb= (int(i) for i in input().split()) L = [] for i in range(N): a, b, c = (int(i) for i in input().split()) L.append((a, b, c)) dp= [[[float("inf")] * (10 * N + 11) for a in range(10 * N + 11) ] for i in range(N + 1)] dp[0][0][0] = 0 for i in range(N): a, b, c = L[i] for ca in range(10 * N + 1)...
s592674073
s675749327
p03806
python
Runtime Error
N, Ma, Mb= (int(i) for i in input().split()) L = [] for i in range(N): a, b, c = (int(i) for i in input().split()) L.append((a-1, b-1, c)) dp= [[[float("inf") for b in range(10 * N + 1)] for a in range(10 * N + 1) ] for i in range(N + 1)] dp[0][0][0] = 0 for i in range(N): a, b, c = L[i] for ca in ran...
N, Ma, Mb= (int(i) for i in input().split()) L = [] for i in range(N): a, b, c = (int(i) for i in input().split()) L.append((a, b, c)) dp= [[[float("inf")] * (10 * N + 11) for a in range(10 * N + 11) ] for i in range(N + 1)] dp[0][0][0] = 0 for i in range(N): a, b, c = L[i] for ca in range(10 * N + 1)...
s021693596
s675749327
p03806
python
Runtime Error
import heapq import math def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = {} for i in range(N): graph[i] = {} for j in range(N): graph[i][j] = 0 for edge in edges: a, b, c = edge graph[a][b] = c graph[b][a] = c return graph def Dijkstra(graph, sta...
import heapq import math def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける graph = {} for i in range(N): graph[i] = {} for j in range(N): graph[i][j] = 0 for edge in edges: a, b, c = edge graph[a][b] = c graph[b][a] = c return graph def Dijkstra(graph, sta...
s621636772
s187434965
p03837
python
Runtime Error
N= int(input()) bit = bin(N)[2:] k = len(bit) dp = [[0] * 2 for i in range(len(bit) + 1)] for i in range(k): j = int(bit[k-i+1]) a,b,c = [(1,0,0),(1,1,0)][j] d,e,f = [(2, 1, 1),(1, 2, 2)][j] dp[i+1][0] = a * dp[i][0] + b * dp[i][1] + c * 3**i dp[i+1][1] = d * dp[i][0] + e * dp[i][1] + f * 3**i print(dp[k][0]) ...
N= int(input()) bit = bin(N)[2:] k = len(bit) dp = [[0] * 2 for i in range(len(bit) + 1)] dp[0][0] = 1 dp[0][1] = 1 for i in range(k): j = int(bit[k-i-1]) a,b,c = [(1,0,0),(1,1,0)][j] d,e,f = [(1, 1, 1),(0, 1, 2)][j] dp[i+1][0] = (a * dp[i][0] + b * dp[i][1] + c * 3**i) % 1000000007 dp[i+1][1] = d * dp[i][0] + e *...
s440384736
s048629600
p03849
python
Runtime Error
N= int(input()) def b(N): if N < 2: res = N else: if N % 2 == 0: res = b(N//2) else: res = b( (N-1)//2 ) + b( (N+1)//2 ) return res def a(N): if N > 0: res = a(N-1) else: res = 0 return res + b(N+1) print(a(N))
N= int(input()) bit = bin(N)[2:] k = len(bit) dp = [[0] * 2 for i in range(len(bit) + 1)] dp[0][0] = 1 dp[0][1] = 1 for i in range(k): j = int(bit[k-i-1]) a,b,c = [(1,0,0),(1,1,0)][j] d,e,f = [(1, 1, 1),(0, 1, 2)][j] dp[i+1][0] = (a * dp[i][0] + b * dp[i][1] + c * 3**i) % 1000000007 dp[i+1][1] = d * dp[i][0] + e *...
s817773713
s048629600
p03849
python
Runtime Error
N = int(input()) L = [] for i in range(N): L.append((int(input),'a')) for i in range(N): L.append((int(input),'b')) L.sort() res = 1 cc = 0 nowcol = None mo = 1000000007 for i in range(2*N): if cc == 0: nowcol=L[i][1] if nowcol == L[i][1]: cc += 1 else: res *= cc res %= mo cc -= 1 print(re...
N = int(input()) L = [] for i in range(N): L.append((int(input()),'a')) for i in range(N): L.append((int(input()),'b')) L.sort() res = 1 cc = 0 nowcol = None mo = 1000000007 for i in range(2*N): if cc == 0: nowcol=L[i][1] if nowcol == L[i][1]: cc += 1 else: res *= cc res %= mo cc -= 1 prin...
s817887864
s465247336
p03878
python
Runtime Error
N = int(input) A = [int(i) for i in input().split()] a = [20000*i for i in range(N)] b = [20000*(N-i) for i in range(N)] for i in range(N): a[A[i]-1] += N-i-1 a = [str(i) for i in a] b = [str(i) for i in b] print(" ".join(a)) print(" ".join(b))
N = int(input()) A = [int(i) for i in input().split()] a = [20000*i+1 for i in range(N)] b = [20000*(N-i) for i in range(N)] for i in range(N): a[A[i]-1] += i a = [str(i) for i in a] b = [str(i) for i in b] print(" ".join(a)) print(" ".join(b))
s505796486
s062040185
p03938
python
Runtime Error
N, A = (int(i) for i in input().split()) x = [int(i) for i in input().split()] sumx = sum(x) DP = [[[0] * (N+1) for i in range(sumx+1)] for i in range(N+1)] DP[0][0][0] = 1 for i in range(N): for j in range(sumx+1): for k in range(i+1): if j - x[i] >= 0: DP[i+1][j][k+1] += DP[i][...
N, A = (int(i) for i in input().split()) x = [int(i) for i in input().split()] sumx = sum(x) DP = [[[0] * (N+1) for i in range(sumx+1)] for i in range(N+1)] DP[0][0][0] = 1 for i in range(N): for j in range(sumx+1): for k in range(i+1): if j - x[i] >= 0: DP[i+1][j][k+1] += DP[i][...
s893699040
s525214504
p04015
python
Time Limit Exceeded
N, A = (int(i) for i in input().split()) x = [int(i) for i in input().split()] sumx = sum(x) DP = [[[0] * (N+1) for i in range(sumx+1)] for i in range(N+1)] DP[0][0][0] = 1 for i in range(N): for j in range(sumx+1): for k in range(N): if j - x[i] >= 0: DP[i+1][j][k+1] += DP[i][j-...
N, A = (int(i) for i in input().split()) x = [int(i) for i in input().split()] sumx = sum(x) DP = [[[0] * (N+1) for i in range(sumx+1)] for i in range(N+1)] DP[0][0][0] = 1 for i in range(N): for j in range(sumx+1): for k in range(i+1): if j - x[i] >= 0: DP[i+1][j][k+1] += DP[i][...
s534910847
s525214504
p04015
python
Time Limit Exceeded
N, L = (int(i) for i in input().split()) a = [int(i) for i in input().split()] P = "Possible" for i in range(N-1): if a[i] + a[i+1] >= L: start = i break else: P = "Impossible" ans = [start] if start > 0: ans += list(range(start)) if start != N-2: ans += reversed(list(range(start+1, N-1))) ans.rever...
N, L = (int(i) for i in input().split()) a = [int(i) for i in input().split()] P = "Possible" for i in range(N-1): if a[i] + a[i+1] >= L: start = i break else: P = "Impossible" print(P) if P == "Possible": ans = [start] if start > 0: ans += reversed(list(range(start))) if start != N-2: ans ...
s434345256
s759611513
p04035
python
Runtime Error
N = int( input() ) A = list( map( int, input().split() ) ) ans = 0 s = A[ 0 ] for i in range( 1, N, 1 ): ns = s + A[ i ] if ns * s >= 0: ns = s // abs( s ) * -1 ans += abs( ns - ( s + A[ i ] ) ) s = ns print( ans )
N = int( input() ) A = list( map( int, input().split() ) ) s = 0 f = 0 for i in range( N ): s += A[ i ] x = s if i & 1: # -> -1 if x < 0: continue s -= x - ( -1 ) f += x - ( -1 ) else: if x > 0: continue s += 1 - x f += 1 - x s = 0 g = 0 for i in range( N ): s += A[ i ] x = s if ~i...
s235916388
s240202395
p03741
python
Runtime Error
import queue N, M = map( int, input().split() ) G = [ [] for i in range( N ) ] for i in range( M ): u, v = map( int, input().split() ) G[ u - 1 ].append( v - 1 ) G[ v - 1 ].append( u - 1 ) Q = int( input() ) V = [] D = [] C = [] for qi in range( Q ): v, d, c = map( int, input().split() ) V.append( v - 1 ) ...
from collections import deque N, M = map( int, input().split() ) G = [ [] for i in range( N ) ] for i in range( M ): u, v = map( int, input().split() ) G[ u - 1 ].append( v - 1 ) G[ v - 1 ].append( u - 1 ) Q = int( input() ) V = [] D = [] C = [] for qi in range( Q ): v, d, c = map( int, input().split() ) V...
s549131540
s496314804
p03768
python
Time Limit Exceeded
import queue N, M = map( int, input().split() ) G = [ [] for i in range( N ) ] for i in range( M ): u, v = map( int, input().split() ) G[ u - 1 ].append( v - 1 ) G[ v - 1 ].append( u - 1 ) Q = int( input() ) V = [] D = [] C = [] for qi in range( Q ): v, d, c = map( int, input().split() ) V.append( v - 1 ) ...
from collections import deque N, M = map( int, input().split() ) G = [ [] for i in range( N ) ] for i in range( M ): u, v = map( int, input().split() ) G[ u - 1 ].append( v - 1 ) G[ v - 1 ].append( u - 1 ) Q = int( input() ) V = [] D = [] C = [] for qi in range( Q ): v, d, c = map( int, input().split() ) V...
s675304203
s496314804
p03768
python
Time Limit Exceeded
from collections import deque N = int( input() ) + 1 # empty counts hi = 0 while 1 << hi + 1 <= N: hi += 1 hi -= 1 ans_A = deque() ans_B = deque() ptr = 1 for i in range( hi, -1, -1 ): ans_A.append( ptr ) ans_B.append( ptr ) ptr += 1 if N >> i & 1: ans_A.append( ptr ) ans_B.appendleft( ptr ) pt...
from collections import deque N = int( input() ) + 1 # empty counts hi = 0 while 1 << hi + 2 <= N: hi += 1 ans_A = deque() ans_B = deque() ptr = 1 for i in range( hi, -1, -1 ): ans_A.append( ptr ) ans_B.append( ptr ) ptr += 1 if N >> i & 1: ans_A.append( ptr ) ans_B.appendleft( ptr ) ptr += 1 ...
s451442396
s504156778
p03769
python
Runtime Error
from collections import deque N = int( input() ) hi = 0 while 1 << hi + 1 <= N: hi += 1 ans_A = deque() ans_B = deque() ptr = 1 for i in range( hi, -1, -1 ): ans_A.append( ptr ) ans_B.append( ptr ) ptr += 1 if N >> i & 1: ans_A.append( ptr ) ans_B.appendleft( ptr ) ptr += 1 print( len( ans_A )...
from collections import deque N = int( input() ) + 1 # empty counts hi = 0 while 1 << hi + 2 <= N: hi += 1 ans_A = deque() ans_B = deque() ptr = 1 for i in range( hi, -1, -1 ): ans_A.append( ptr ) ans_B.append( ptr ) ptr += 1 if N >> i & 1: ans_A.append( ptr ) ans_B.appendleft( ptr ) ptr += 1 ...
s992644355
s504156778
p03769
python
Runtime Error
n,a,b=map(int,input().split()) c == n%(a+b) if c >a: print(a*(n//(a+b))+a) elif c <=a print(a*(n//(a+b))+c)
n,a,b=map(int,input().split()) c = n%(a+b) d = n//(a+b) print(a*d+min(a,c))
s595402036
s000081700
p02754
python
Runtime Error
n,a,b=map(int,input().split()) c == n%(a+b) if c >a: print((n-c)*a/(a+b)+a) else: print((n-c)*a/(a+b)+c)
n,a,b=map(int,input().split()) c = n%(a+b) d = n//(a+b) print(a*d+min(a,c))
s346963257
s000081700
p02754
python
Runtime Error
import collections N=int(input()) s=[str(input()) for i in range(N)] c=collections.Counter(s) maximum =max(c.values()) max_c_list = soreted(key for key,value in c.items() if value == maximum) for s in max_c_list: print(s)
import collections N=int(input()) s=[str(input()) for i in range(N)] c=collections.Counter(s) maximum =max(c.values()) max_c_list = sorted(key for key,value in c.items() if value == maximum) for s in max_c_list: print(s)
s864447684
s409673963
p02773
python
Runtime Error
s,t = map(str,input().split()) a,b = map(int,input().split()) u = int(input()) if s == u: print(a-1,b) else: print(a,b-1)
s,t = map(str,input().split()) a,b = map(int,input().split()) u = str(input()) if s == u: print(a-1,b) else: print(a,b-1)
s675993152
s081150595
p02777
python
Runtime Error
a = str(input()) print(str(x)*len(a))
a = len(input()) print("x"*a)
s873476702
s351478626
p02778
python
Runtime Error
a = input() print(str(x)*len(a))
a = len(input()) print("x"*a)
s867641398
s351478626
p02778
python
Runtime Error
a,b=input().split() c = str(a)**b d = str(b)**a if a<b: print(c) else: print(d)
a,b=input().split() c = str(a)*int(b) d = str(b)*int(a) if a<b: print(c) else: print(d)
s328012030
s017880944
p02790
python
Runtime Error
a,b=input().split() c = a**b d = b**a if a<b: print(c) else: print(d)
a,b=input().split() c = str(a)*int(b) d = str(b)*int(a) if a<b: print(c) else: print(d)
s031674672
s017880944
p02790
python
Runtime Error
a,b=map(int,input().split()) c = ("a")**b d = ("b")**a if a<b: print(c) else: print(d)
a,b=input().split() c = str(a)*int(b) d = str(b)*int(a) if a<b: print(c) else: print(d)
s455490644
s017880944
p02790
python
Runtime Error
n = int(input()) x = list(map(int,input().split())) count = 1 if n >=2: for i in range(n-2): a = min(x(range(0,i,1))) if a >=x[i+1]: count+=1 else: count+=0 else: print(count) exit() print(count)
n = int(input()) x = list(map(int,input().split())) count = 1 m = x[0] for i in range(1,n): if m >=x[i]: count+=1 m = x[i] print(count)
s716568922
s255407328
p02791
python
Runtime Error
n = int(input()) x = list(map(int,input().split())) count = 1 if n >=2: for i in range(n-2): a = min(x(range(0,i))) if a >=x[i+1]: count+=1 else: count+=0 else: print(count) exit() print(count)
n = int(input()) x = list(map(int,input().split())) count = 1 m = x[0] for i in range(1,n): if m >=x[i]: count+=1 m = x[i] print(count)
s000290678
s255407328
p02791
python
Runtime Error
n = int(input()) x = list(map(int,input().split())) count = 1 if n >=2: for i in range(n-2): a = min(x(range(0,i))) if a>=x[i+1]: count+=1 else: count+=0 print(count)
n = int(input()) x = list(map(int,input().split())) count = 1 m = x[0] for i in range(1,n): if m >=x[i]: count+=1 m = x[i] print(count)
s673968406
s255407328
p02791
python
Runtime Error
n = int(input()) x = list(map(int,input().split())) count = 1 if n >=2: for i in range(n-2): if min(x[0:i])>=x[i+1]: count+=1 print(count)
n = int(input()) x = list(map(int,input().split())) count = 1 m = x[0] for i in range(1,n): if m >=x[i]: count+=1 m = x[i] print(count)
s669847015
s255407328
p02791
python
Runtime Error
n = int(input()) x = list(map(int,input().split())) count = 1 if n >=2: for i in range(n-1): if min(x[0:i])>=x[i+1]: count+=1 print(count)
n = int(input()) x = list(map(int,input().split())) count = 1 m = x[0] for i in range(1,n): if m >=x[i]: count+=1 m = x[i] print(count)
s107220662
s255407328
p02791
python
Runtime Error
n = int(input()) x = list(map(int,input().split())) count = 1 for i in range(1,n): if min(x[0:i-1])>=x[i]: count+=1 print(count)
n = int(input()) x = list(map(int,input().split())) count = 1 m = x[0] for i in range(1,n): if m >=x[i]: count+=1 m = x[i] print(count)
s482391440
s255407328
p02791
python
Runtime Error
n = input() x = list(map(int,input().split())) count = 1 for i in range(1,n): if min(x[0:i-1])>=x[i]: count+=1 print(count)
n = int(input()) x = list(map(int,input().split())) count = 1 m = x[0] for i in range(1,n): if m >=x[i]: count+=1 m = x[i] print(count)
s768938379
s255407328
p02791
python
Runtime Error
n = input() x = list(map(int,input().split())) count = 0 for i in range(1,n): if all(x[j]>x[i] for j in range(0,i-1)): count+=1 print(count)
n = int(input()) x = list(map(int,input().split())) count = 1 m = x[0] for i in range(1,n): if m >=x[i]: count+=1 m = x[i] print(count)
s611630298
s255407328
p02791
python
Runtime Error
n = input() x = list(map(int,input().split())) count = 0 for i in range(1,n): if all(x[j]>x[i]) for j in range(0,i-1): count+=1 print(count)
n = int(input()) x = list(map(int,input().split())) count = 1 m = x[0] for i in range(1,n): if m >=x[i]: count+=1 m = x[i] print(count)
s999238071
s255407328
p02791
python
Runtime Error
n = input() x = list(map(int,input().split())) count = 0 for i in range(1,n): if all(x[j]>x[i]) for for j in range(0,i-1): count+=1 print(count)
n = int(input()) x = list(map(int,input().split())) count = 1 m = x[0] for i in range(1,n): if m >=x[i]: count+=1 m = x[i] print(count)
s561744387
s255407328
p02791
python
Runtime Error
print(chr(ord((input())+1))
n = input() a = ord(n) print(chr(a+1))
s640450874
s922400087
p02801
python
Runtime Error
a = input() b = input() print(b+a)
s,t=input().split() print(t+s)
s674796805
s274286816
p02817
python
Runtime Error
a = input() b = input() print(b+a, end="")
s,t=input().split() print(t+s)
s476964980
s274286816
p02817
python
Runtime Error
a,b,k=map(int,input().split()) if a>=k: print(a-k,b) elif a<k and k<=a+b print(0,a+b-k) else: print(0,0)
a,b,k=map(int,input().split()) if a>=k: print(a-k,b) elif a<k and k<=a+b: print(0,a+b-k) else: print(0,0)
s630415693
s501981409
p02818
python
Runtime Error
x = int(input()) while True: flag ==0 for i in range(2,x//2): if x%i==0: flag ==1 break if flag ==1: print(x) exit() else: x = x+1
x = int(input()) while True: flag =0 for i in range(2,x//2): if x%i==0: flag =1 break if flag ==0: print(x) exit() x = x+1
s862433393
s148624850
p02819
python
Runtime Error
x = int(input()) flag ==0 while True: for i in range(2,x//2): if x%i==0: flag ==1 if flag ==1: print(x) exit() else: x = x+1
x = int(input()) while True: flag =0 for i in range(2,x//2): if x%i==0: flag =1 break if flag ==0: print(x) exit() x = x+1
s707288288
s148624850
p02819
python
Runtime Error
x = int(input()) y = int(x**0.5) while True: x % y != 0: y -=1 if y !=1: x +=1 continue elif y ==1: break print(x)
x = int(input()) while True: flag =0 for i in range(2,x//2): if x%i==0: flag =1 break if flag ==0: print(x) exit() x = x+1
s092227726
s148624850
p02819
python
Runtime Error
X = {1,2,3} a = int(input()) b = int(input()) print(list(X-set(a)-set(b))[0])
X = {1,2,3} a = {int(input())} b = {int(input())} print(list(X-a-b)[0])
s593208951
s428650516
p02829
python
Runtime Error
a = [1,2,3]- int(input()) print(list(a-int(input()))[0])
X = {1,2,3} a = {int(input())} b = {int(input())} print(list(X-a-b)[0])
s032271746
s428650516
p02829
python
Runtime Error
a = {1,2,3}- int(input()) print(int(a-int(input())))
X = {1,2,3} a = {int(input())} b = {int(input())} print(list(X-a-b)[0])
s495383130
s428650516
p02829
python
Runtime Error
a = {1,2,3}- int(input()) print(a-int(input()))
X = {1,2,3} a = {int(input())} b = {int(input())} print(list(X-a-b)[0])
s014796273
s428650516
p02829
python
Runtime Error
a = {(1,2,3)}- int(input()) print(a-int(input()))
X = {1,2,3} a = {int(input())} b = {int(input())} print(list(X-a-b)[0])
s806035574
s428650516
p02829
python
Runtime Error
N = int(input()) testimony = [[-1]*N for i in range(N)] count = 0 for i in range(N): A = int(input()) for j in range(A): x,y = map(int,input().split()) testimony[i][x-1]=y fro i in range(2**N): honest = [0]*N for j in range(N): if(i>>j)&1: honest[j]=1 flag=True for j in range(N): if ho...
N = int(input()) testimony = [[-1]*N for i in range(N)] count = 0 for i in range(N): A = int(input()) for j in range(A): x,y = map(int,input().split()) testimony[i][x-1]=y for i in range(2**N): honest = [0]*N for j in range(N): if(i>>j)&1: honest[j]=1 flag=True for j in range(N): if ho...
s103633228
s196681707
p02837
python
Runtime Error
n = str(input()) dic = {SUN:7, MON:6, TUE:5, WED:4, THU:3, FRI:2, SAT:1} print(dic(n))
n = str(input()) dic = {"SUN":7, "MON":6, "TUE":5, "WED":4, "THU":3, "FRI":2, "SAT":1} print(dic[str(n)])
s035335804
s680738396
p02847
python
Runtime Error
n = int(input()) A = list(input()) A_change={} B = [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z] for i in A: for j in B: if i==j: A_change[i] = str(B[(B.index(j)+n)%26]) print(list(A_change.values()))
n = int(input()) s = input() ans = "" for i in s: ans += chr(ord("A") + (ord(i)-ord("A")+n)%26) print(ans)
s444062727
s678766835
p02848
python
Runtime Error
n = int(input()) A = list(input()) A_change={} B = [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z] for i in A: for j in B: if i= j: A_change[i] = B[(B.index(j)+n)%26] print(list(A_change.values()))
n = int(input()) s = input() ans = "" for i in s: ans += chr(ord("A") + (ord(i)-ord("A")+n)%26) print(ans)
s174128487
s678766835
p02848
python
Runtime Error
n = int(input()) A = list(input()) A_change={} B = [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z] for i in A: for j in B: if A[i]=B[j] A_change[i] = B[(j+n)%26] print(list(A_change.values()))
n = int(input()) s = input() ans = "" for i in s: ans += chr(ord("A") + (ord(i)-ord("A")+n)%26) print(ans)
s120972784
s678766835
p02848
python
Runtime Error
n = int(input()) a = input() if a[:n/2+1]==a[n/2+1:]: print("Yes") else: print("No")
n = int(input()) a = input() if a[:n//2]==a[n//2:]: print("Yes") else: print("No")
s124563270
s856974098
p02860
python
Runtime Error
n = int(input()) a = input() if str(a[:n/2+1])==str(a[n/2+1:]): print("Yes") else: print("No")
n = int(input()) a = input() if a[:n//2]==a[n//2:]: print("Yes") else: print("No")
s312231303
s856974098
p02860
python
Runtime Error
n = int(input()) a = [list(map(int,input().split())) for i in range(n)] sum = 0 for i in range(n): for j in range(j+1,n): sum += ((a[i][0]-a[j][0])**2+(a[i][1]-a[j][1])**2)**0.5 print(2*sum/n)
n = int(input()) a = [list(map(int,input().split())) for i in range(n)] sum = 0 for i in range(n): for j in range(i+1,n): sum += ((a[i][0]-a[j][0])**2+(a[i][1]-a[j][1])**2)**0.5 print(2*sum/n)
s204891599
s188785983
p02861
python
Runtime Error
import numpy as np import itertools n = int(input()) l = [list(map(int,input().split())) for i in range(n)] a = np.array(l) dic = list(itertools.permutations(n,n)) sum = 0 for i in range(len(dic)): for j in range(n-1): sum += np.linalg.norm(a[dic[i][j]]-a[dic[i][j+1]]) print(sum//len(dic))
n = int(input()) a = [list(map(int,input().split())) for i in range(n)] sum = 0 for i in range(n): for j in range(i+1,n): sum += ((a[i][0]-a[j][0])**2+(a[i][1]-a[j][1])**2)**0.5 print(2*sum/n)
s210765735
s188785983
p02861
python
Runtime Error
import numpy as np import itertools n = int(input()) l = [list(map(int,input().split())) for i in range(n)] a = np.array(l) dic = itertools.permutations(n,n) sum = 0 for i in range(len(dic)): for j in range(n-1): sum += np.linalg.norm(a[dic[i][j]]-a[dic[i][j+1]]) print(sum//len(dic))
n = int(input()) a = [list(map(int,input().split())) for i in range(n)] sum = 0 for i in range(n): for j in range(i+1,n): sum += ((a[i][0]-a[j][0])**2+(a[i][1]-a[j][1])**2)**0.5 print(2*sum/n)
s128925039
s188785983
p02861
python
Runtime Error
n = int(input()) m = 10**12 a = int((n**0.5)//1) for i in a: if n%i==0: m=min(m,i+(n/i)-2) print(m)
n = int(input()) b = 10**12 a = int((n**0.5)//1) for i in range(1,a+1): if n%i==0: b = min(b,int(i+(n//i)-2)) print(b)
s292608376
s148010258
p02881
python
Runtime Error
n = int(input()) m = 10**12 a = (n**0.5)//1 for i in a: if n%i==0: m=min(m,i+(n/i)-2) print(m)
n = int(input()) b = 10**12 a = int((n**0.5)//1) for i in range(1,a+1): if n%i==0: b = min(b,int(i+(n//i)-2)) print(b)
s251810491
s148010258
p02881
python
Runtime Error
n = int(input()) m = 10**12 for i in int(n**0.5//1): if n%i==0: m=min(m,i+(n/i)-2) print(m)
n = int(input()) b = 10**12 a = int((n**0.5)//1) for i in range(1,a+1): if n%i==0: b = min(b,int(i+(n//i)-2)) print(b)
s374213698
s148010258
p02881
python
Runtime Error
n = int(input()) m = 10**12 for i in n: for j in n: if i*j==n: m=min(m,i+j-2) print(m)
n = int(input()) b = 10**12 a = int((n**0.5)//1) for i in range(1,a+1): if n%i==0: b = min(b,int(i+(n//i)-2)) print(b)
s092237173
s148010258
p02881
python
Runtime Error
n = int(input()) m = 10**12 for i in n: for j in n: if i*j=n: m=min(m,i+j-2) print(m)
n = int(input()) b = 10**12 a = int((n**0.5)//1) for i in range(1,a+1): if n%i==0: b = min(b,int(i+(n//i)-2)) print(b)
s235169003
s148010258
p02881
python
Runtime Error
n = int(input()) m = 10**12 for i in n: for j in n: if i*j==n: m=min(m,(i+j-2)) print(m)
n = int(input()) b = 10**12 a = int((n**0.5)//1) for i in range(1,a+1): if n%i==0: b = min(b,int(i+(n//i)-2)) print(b)
s542539966
s148010258
p02881
python
Runtime Error
n = int(input()) m = [] for i in n: for j in n: if i*j==n: m.append(i+j-2) print(min(m))
n = int(input()) b = 10**12 a = int((n**0.5)//1) for i in range(1,a+1): if n%i==0: b = min(b,int(i+(n//i)-2)) print(b)
s013422832
s148010258
p02881
python
Runtime Error
n = int(input()) x = list(input()) for i in range(n,1,-1): if x[i]==x[i-1]: x.pop(i) print(len(x))
n = int(input()) x = list(input()) count = n for i in range(n-1): if x[i]==x[i+1]: count-=1 print(count)
s294244065
s780438232
p02887
python
Runtime Error
n = int(input()) x = list(input()) for i in range(n-1): if x[i]==x[i+1]: x.pop(i) print(len(x))
n = int(input()) x = list(input()) count = n for i in range(n-1): if x[i]==x[i+1]: count-=1 print(count)
s604866108
s780438232
p02887
python
Runtime Error
n = int(input()) x = list(input()) for i in range(n): if x[i]==x[i+1]: x.pop(i) print(len(x))
n = int(input()) x = list(input()) count = n for i in range(n-1): if x[i]==x[i+1]: count-=1 print(count)
s658645837
s780438232
p02887
python
Runtime Error