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
while True: n=int(input()) if n==0:break m=int(input()) rel=sorted([[int(s)for s in input().split(" ")]for i in range(m)],key=lambda x:x[0]) isf=[False for i in range(n)] inv=[False for i in range(n)] isf[0]=True for r in rel: if r[0]==1: isf[r[1]]=True in...
while True: n=int(input()) if n==0:break m=int(input()) rel=sorted([[int(s)for s in input().split(" ")]for i in range(m)],key=lambda x:x[0]) isf=[False for i in range(n)] inv=[False for i in range(n)] isf[0]=True for r in rel: if r[0]==1:isf[r[1]-1]=True for r in rel: ...
s869343561
s745228092
p00468
python
Runtime Error
while True: n=int(input()) if n==0: break; li=[input() for i in range(n)] index=0 def pls(depth): k=0 global index while len(li[index])>depth and li[index][depth-1]=='.': if (not li[index][depth]=='+') and (not li[index][depth]=='*'): k+=in...
while True: n=int(input()) if n==0: break; elif n==1: print(input()) continue; li=[input() for i in range(n)] index=0 def pls(depth): k=0 global index while len(li[index])>depth and li[index][depth-1]=='.': if (not li[index][depth]=='+'...
s390056250
s235332726
p01087
python
Runtime Error
def isRTri(a, b, c): return a * a + b * b == c * c a = [0, 0, 0] n = input() for k in range(n): a = map(int, raw_input().split()) r = isRTri(a[0], a[1], a[2]) print "YES" if r else "NO"
def isRTri(a, b, c): return a * a + b * b == c * c a = [0, 0, 0] n = input() for k in range(n): a = map(int, raw_input().split()) a.sort() r = isRTri(a[0], a[1], a[2]) print "YES" if r else "NO"
s081314765
s584084676
p00003
python
Runtime Error
def isRTri(a, b, c): if a * a + b * b == c * c: return 1 else return 0 a = [0, 0, 0] n = input() for k in range(n): a = map(int, raw_input().split()) r = isRTri(a[0], a[1], a[2]) if r: print "YES" else: print "NO"
def isRTri(a, b, c): return a * a + b * b == c * c a = [0, 0, 0] n = input() for k in range(n): a = map(int, raw_input().split()) a.sort() r = isRTri(a[0], a[1], a[2]) print "YES" if r else "NO"
s604072027
s584084676
p00003
python
Runtime Error
from sys import stdin def deal(x): if abs(x) < 1e-6: return 0 else: return x def solve(a, b, c, d, e, f): x = 0 y = 0 if b == 0: x = c / a y = (f - d * x) / e else: x = (b * f - e * c) / (b * d - e * a) y = (c - a * x) / b p = [deal(x), deal(y)] ret...
from sys import stdin def deal(x): if abs(x) < 1e-6: return 0 else: return x def solve(a, b, c, d, e, f): x = 0 y = 0 if b == 0: x = c / a y = (f - d * x) / e else: x = (b * f - e * c) / (b * d - e * a) y = (c - a * x) / b p = [deal(x), deal(y)] ret...
s228862692
s772521001
p00004
python
Runtime Error
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3): print("YES") else: print("NO")
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if x1 == x2 and x3 == x4: print("YES") elif x1 == x2 or x3 == x4: print("NO") elif abs((y2 - y1) / (x2 - x1) - (y4 - y3) / (x4 - x3)) < 1e-10: print("YES") else: print("NO...
s642712403
s351179648
p00021
python
Runtime Error
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3): print("YES") else: print("NO")
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if x1 == x2 and x3 == x4: print("YES") elif x1 == x2 or x3 == x4: print("NO") elif abs((y2 - y1) / (x2 - x1) - (y4 - y3) / (x4 - x3)) < 1e-10: print("YES") else: print("NO...
s487557836
s351179648
p00021
python
Runtime Error
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if x1 == x2 and x3 == x4: print("YES") elif (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3): print("YES") else: print("NO")
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if x1 == x2 and x3 == x4: print("YES") elif x1 == x2 or x3 == x4: print("NO") elif abs((y2 - y1) / (x2 - x1) - (y4 - y3) / (x4 - x3)) < 1e-10: print("YES") else: print("NO...
s675720287
s351179648
p00021
python
Runtime Error
from math import ceil while True: v = input() if not v: break v = float(v) print(ceil(v * v / 98 + 1))
from math import ceil while True: try: v = input() v = float(v) t = v / 9.8 y = 4.9 * t * t n = ceil((y+5) / 5) print(n) except: break
s752823176
s636915194
p00024
python
Runtime Error
shapes = { 'A': '1100000011', 'B': '1000000010000000100000001', 'C': '1111', 'D': '01000000110000001', 'E': '11000000011', 'F': '100000001100000001', 'G': '0110000011' } while True: plane = '' for i in range(8): plane += input() for name in shapes: try: ...
shapes = { 'A': '1100000011', 'B': '1000000010000000100000001', 'C': '1111', 'D': '01000000110000001', 'E': '11000000011', 'F': '100000001100000001', 'G': '0110000011' } while True: try: plane = '' for i in range(8): plane += input() for name in shap...
s123918054
s268597259
p00036
python
Runtime Error
shapes = { 'A': '1100000011', 'B': '1000000010000000100000001', 'C': '1111', 'D': '01000000110000001', 'E': '11000000011', 'F': '100000001100000001', 'G': '0110000011' } while True: plane = '' for i in range(8): plane += input() for name in shapes: try: ...
shapes = { 'A': '1100000011', 'B': '1000000010000000100000001', 'C': '1111', 'D': '01000000110000001', 'E': '11000000011', 'F': '100000001100000001', 'G': '0110000011' } while True: try: plane = '' for i in range(8): plane += input() for name in shap...
s353974451
s268597259
p00036
python
Runtime Error
n, m = map(int, input().split()) friend = [[] for i in range(n)] for i in range(m): s, t = map(int, input().split()) friend[s].append(t) friend[t].append(s) def are_connected(s, t): q = [s] checked = [False] * n checked[s] = True while q: user = q.pop(0) for f in friend[use...
n, m = map(int, input().split()) friend = [[] for i in range(n)] for i in range(m): s, t = map(int, input().split()) friend[s].append(t) friend[t].append(s) group = [-1 for i in range(n)] for u in range(n): if group[u] == -1: group[u] = u q = [u] while q: u1 = q.pop(...
s055616036
s256263899
p02240
python
Time Limit Exceeded
n = int(input()) g = [] for i in range(n): line = list(map(int, input().split())) k = line[1] c = [100001] * n for j in range(k): v = line[2 + 2 * j] c[v] = line[3 + 2 * j] g.append(c) distance = [100001] * n distance[0] = 0 visited = [False] * n current = 0 while not all(visited):...
inf = float('inf') n = int(input()) g = [] for i in range(n): line = list(map(int, input().split())) k = line[1] c = [inf] * n for j in range(k): v = line[2 + 2 * j] c[v] = line[3 + 2 * j] g.append(c) distance = [inf] * n distance[0] = 0 visited = [False] * n current = 0 while not ...
s510798020
s993770804
p02242
python
Time Limit Exceeded
inf = float('inf') n = int(input()) g = [] for i in range(n): line = list(map(int, input().split()[2:])) g.append(zip(line[0::2], line[1::2])) distance = [inf] * n distance[0] = 0 visited = [False] * n current = 0 while not all(visited): visited[current] = True for v, c in g[current]: if not v...
from heapq import heappush, heappop inf = float('inf') n = int(input()) g = [] for i in range(n): line = list(map(int, input().split()[2:])) g.append(zip(line[0::2], line[1::2])) dist = [inf] * n dist[0] = 0 heap = [(0, 0)] while heap: current = heappop(heap)[1] for v, c in g[current]: new_di...
s624218561
s506455830
p02243
python
Time Limit Exceeded
height = [] for i in range(10) height.append(int(input())) height.sort() for i in range(9,6,-1) print(height[i])
a = [] for i in range(10): a.append(int(input())) a.sort() print(a[9]) print(a[8]) print(a[7])
s938044597
s616105983
p00001
python
Runtime Error
height = [] for i in range(10): height.append(int(input())) for i in range(3): most = max(height) print(most) height[index(most)] = 0
a = [] for i in range(10): a.append(int(input())) a.sort() print(a[9]) print(a[8]) print(a[7])
s567895026
s616105983
p00001
python
Runtime Error
import math class WeightedEdge: """Weighted edge.""" def __init__(self, a, b, weight): self.a = a self.b = b self.weight = weight def __repr__(self): return "(%d - %d: %d)" % (self.a, self.b, self.weight) def __lt__(self, other): return self.a < other.b cla...
from heapq import heappop, heappush class WeightedEdge: """Weighted edge.""" def __init__(self, a, b, weight): self.a = a self.b = b self.weight = weight def __repr__(self): return "(%d - %d: %d)" % (self.a, self.b, self.weight) def __lt__(self, other): retur...
s340273270
s146141005
p00200
python
Time Limit Exceeded
from heapq import heappop, heappush class WeightedEdge: """Weighted edge.""" def __init__(self, a, b, weight): self.a = a self.b = b self.weight = weight def __repr__(self): return "(%d - %d: %d)" % (self.a, self.b, self.weight) def __lt__(self, other): retur...
from heapq import heappop, heappush class WeightedEdge: """Weighted edge.""" def __init__(self, a, b, weight): self.a = a self.b = b self.weight = weight def __repr__(self): return "(%d - %d: %d)" % (self.a, self.b, self.weight) def __lt__(self, other): retur...
s244728517
s146141005
p00200
python
Time Limit Exceeded
M, N = map(int, input().split()) K = int(input()) P = ['_' * (N + 1) for _ in range(M + 1)] for mi in range(1, M + 1): P[mi] = '_' + input() # for p in P: # print('p', p) J = [[0 for _ in range(N + 1)] for _ in range(M + 1)] O = [[0 for _ in range(N + 1)] for _ in range(M + 1)] I = [[0 for _ in ran...
M, N = map(int, input().split()) K = int(input()) P = ['_' * (N + 1) for _ in range(M + 1)] for mi in range(1, M + 1): P[mi] = '_' + input() # for p in P: # print('p', p) J = [[0 for _ in range(N + 1)] for _ in range(M + 1)] O = [[0 for _ in range(N + 1)] for _ in range(M + 1)] I = [[0 for _ in range(N + 1)] f...
s972016185
s011320100
p00483
python
Runtime Error
from math import sqrt n=input() for i in range(n): x1,y1,x2,y2,x3,y3=map(float,raw_input().split()) A1=2*(x2-x1) B1=2*(y2-y1) C1=x2**2+y2**2-x1**2-y1**2 A2=2*(x3-x2) B2=2*(y3-y2) C2=x3**2+y3**2-x2**2-y2**2 x=(C1*B2-C2*B1)/(A1*B2-A2*B1) y=(A1*C2-A2*C1)/(A1*B2-A2*B1) R=sqrt((x1-x)*...
from math import sqrt n=input() for i in range(n): x1,y1,x2,y2,x3,y3=map(float,raw_input().split()) A1=2*(x2-x1) B1=2*(y2-y1) C1=x2**2+y2**2-x1**2-y1**2 A2=2*(x3-x2) B2=2*(y3-y2) C2=x3**2+y3**2-x2**2-y2**2 x=(C1*B2-C2*B1)/(A1*B2-A2*B1) y=(A1*C2-A2*C1)/(A1*B2-A2*B1) R=sqrt((x1-x)*...
s676750762
s820563602
p00010
python
Runtime Error
import math tate =int(input()) yoko=int(input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split() rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
tate =int(input()) yoko=int(input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split(",") rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
s420396297
s297051288
p00011
python
Runtime Error
import math tate =int(input()) yoko=int(input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split() rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
tate =int(input()) yoko=int(input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split(",") rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
s994044889
s297051288
p00011
python
Runtime Error
tate =int(input()) yoko=int(input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split() rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
tate =int(input()) yoko=int(input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split(",") rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
s460084583
s297051288
p00011
python
Runtime Error
tate =int(input()) yoko=int(input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split() rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
tate =int(input()) yoko=int(input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split(",") rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
s681172769
s297051288
p00011
python
Runtime Error
tate =int(input()); yoko=int(input()); arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split() rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
tate =int(input()) yoko=int(input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split(",") rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
s202557140
s297051288
p00011
python
Runtime Error
tate =int(input()); yoko=int(input()); arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split(); rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
tate =int(input()) yoko=int(input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split(",") rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
s115734457
s297051288
p00011
python
Runtime Error
tate =int(input()); yoko=int(input()); arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split(); rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
tate =int(input()) yoko=int(input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split(",") rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
s067957806
s297051288
p00011
python
Runtime Error
tate =int(raw_input()) yoko=int(raw_input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=raw_input().split(); rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
tate =int(input()) yoko=int(input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split(",") rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
s696794372
s297051288
p00011
python
Runtime Error
tate =int(raw_input()) yoko=int(raw_input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=raw_input().split(); rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
tate =int(input()) yoko=int(input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split(",") rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
s952492713
s297051288
p00011
python
Runtime Error
import math tate =int(input()) yoko=int(input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split(); rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
tate =int(input()) yoko=int(input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split(",") rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
s395143450
s297051288
p00011
python
Runtime Error
import math tate =int(input()) yoko=int(input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split(); rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
tate =int(input()) yoko=int(input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split(",") rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
s894833126
s297051288
p00011
python
Runtime Error
import math tate =int(input()) yoko=int(input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split(); rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k] )
tate =int(input()) yoko=int(input()) arr = [i+1 for i in range(tate)] for j in range(yoko): rep1,rep2=input().split(",") rep1=int(rep1)-1 rep2=int(rep2)-1 arr[rep1],arr[rep2] = arr[rep2],arr[rep1] for k in range(tate): print(arr[k])
s177066699
s297051288
p00011
python
Runtime Error
while 1: x1,y1,x2,y2,x3,y3,xp,yp=[float(p) for p in input().split()] d_max=max((x2-x1)**2+(y2-y1)**2,(x3-x2)**2+(y3-y2)**2,(x3-x1)**2+(y3-y1)**2) d1,d2,d3=(x2-x1)**2+(y2-y1)**2,(x3-x2)**2+(y3-y2)**2,(x3-x1)**2+(y3-y1)**2; if max(d_max,d1,d2,d3) > d_max: print("No") else: print("...
def cross(x, y): return (x.conjugate() * y).imag def inside_triangle(p, x, y, z): a = cross(y-x, p-y) b = cross(z-y, p-z) c = cross(x-z, p-x) if a*b > 0 and b*c > 0: return True return False import sys for line in sys.stdin: x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.spli...
s540392412
s946444748
p00012
python
Runtime Error
x1,y1,x2,y2,x3,y3,xp,yp=[float(p) for p in input().split()] x_vector_1to2=x2-x1; y_vector_1to2=y2-y1; x_vector_1to3=x3-x1; y_vector_1to3=y3-y1; x_vector_p=xp-x1; y_vector_p=yp-y1; def renritu(p,q,r,s,t,u): # renritu(p,q,r,s,t,u) px + qy = r sx+ty=u a=p; b=q; c=r; d=s; e=t; f=u; a1=a*d; b1=b*d; c1=c*d; d1=d...
def cross(x, y): return (x.conjugate() * y).imag def inside_triangle(p, x, y, z): a = cross(y-x, p-y) b = cross(z-y, p-z) c = cross(x-z, p-x) if a*b > 0 and b*c > 0: return True return False import sys for line in sys.stdin: x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.spli...
s649009155
s946444748
p00012
python
Runtime Error
while(true): x1,y1,x2,y2,x3,y3,xp,yp=[float(p) for p in input().split()] x_vector_1to2=x2-x1; y_vector_1to2=y2-y1; x_vector_1to3=x3-x1; y_vector_1to3=y3-y1; x_vector_p=xp-x1; y_vector_p=yp-y1; def renritu(p,q,r,s,t,u): # renritu(p,q,r,s,t,u) px + qy = r sx+ty=u a=p; b=q; c=r...
def cross(x, y): return (x.conjugate() * y).imag def inside_triangle(p, x, y, z): a = cross(y-x, p-y) b = cross(z-y, p-z) c = cross(x-z, p-x) if a*b > 0 and b*c > 0: return True return False import sys for line in sys.stdin: x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.spli...
s503808220
s946444748
p00012
python
Runtime Error
while(True): x1,y1,x2,y2,x3,y3,xp,yp=[float(p) for p in input().split()] x_vector_1to2=x2-x1; y_vector_1to2=y2-y1; x_vector_1to3=x3-x1; y_vector_1to3=y3-y1; x_vector_p=xp-x1; y_vector_p=yp-y1; def renritu(p,q,r,s,t,u): # renritu(p,q,r,s,t,u) px + qy = r sx+ty=u a=p; b=q; c=r...
def cross(x, y): return (x.conjugate() * y).imag def inside_triangle(p, x, y, z): a = cross(y-x, p-y) b = cross(z-y, p-z) c = cross(x-z, p-x) if a*b > 0 and b*c > 0: return True return False import sys for line in sys.stdin: x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.spli...
s920274659
s946444748
p00012
python
Runtime Error
while(True): x1,y1,x2,y2,x3,y3,xp,yp=[float(p) for p in input().split()] x_vector_1to2=x2-x1; y_vector_1to2=y2-y1; x_vector_1to3=x3-x1; y_vector_1to3=y3-y1; x_vector_p=xp-x1; y_vector_p=yp-y1; def renritu(p,q,r,s,t,u): # renritu(p,q,r,s,t,u) px + qy = r sx+ty=u a=p; b=q; c=r...
def cross(x, y): return (x.conjugate() * y).imag def inside_triangle(p, x, y, z): a = cross(y-x, p-y) b = cross(z-y, p-z) c = cross(x-z, p-x) if a*b > 0 and b*c > 0: return True return False import sys for line in sys.stdin: x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.spli...
s581318147
s946444748
p00012
python
Runtime Error
while(True): x1,y1,x2,y2,x3,y3,xp,yp=[float(p) for p in input().split()] x_vector_1to2=x2-x1; y_vector_1to2=y2-y1; x_vector_1to3=x3-x1; y_vector_1to3=y3-y1; x_vector_p=xp-x1; y_vector_p=yp-y1; def renritu(p,q,r,s,t,u): # renritu(p,q,r,s,t,u) px + qy = r sx+ty=u a=p; b=q; c=r...
def cross(x, y): return (x.conjugate() * y).imag def inside_triangle(p, x, y, z): a = cross(y-x, p-y) b = cross(z-y, p-z) c = cross(x-z, p-x) if a*b > 0 and b*c > 0: return True return False import sys for line in sys.stdin: x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.spli...
s072074434
s946444748
p00012
python
Runtime Error
while(True): x1,y1,x2,y2,x3,y3,xp,yp=[float(p) for p in input().split()] x_vector_1to2=x2-x1; y_vector_1to2=y2-y1; x_vector_1to3=x3-x1; y_vector_1to3=y3-y1; x_vector_p=xp-x1; y_vector_p=yp-y1; def renritu(p,q,r,s,t,u): # renritu(p,q,r,s,t,u) px + qy = r sx+ty=u a=p; b=q; c=r...
def cross(x, y): return (x.conjugate() * y).imag def inside_triangle(p, x, y, z): a = cross(y-x, p-y) b = cross(z-y, p-z) c = cross(x-z, p-x) if a*b > 0 and b*c > 0: return True return False import sys for line in sys.stdin: x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.spli...
s761608732
s946444748
p00012
python
Runtime Error
a,b=map(int,split()) print(abs(a-b))
a,b=map(int,input().split()) print(abs(a-b))
s032703592
s743658396
p00376
python
Runtime Error
l = [i for i in range(1,10)] for i in l: for j in l: print(str(i)+ 'x' + str(j) + '=' str(i*j))
for i in range(1,10): for j in range(1,10): print(str(i) + "x" + str(j) + "=" + str(i * j))
s291569605
s926778712
p00000
python
Runtime Error
while True: a,b = map(int,input().split()) if a + b == 0: break print(len(str(a+b)))
import sys for line in sys.stdin.readlines(): a,b = map(int,line.split()) print(len(str(a+b)))
s019615126
s577346121
p00002
python
Runtime Error
import sys.stdin.readlines for line in sys.stdin.readlines(): a,b = map(int,line.split()) print(len(str(a+b)))
import sys for line in sys.stdin.readlines(): a,b = map(int,line.split()) print(len(str(a+b)))
s743953644
s577346121
p00002
python
Runtime Error
import sys for line in sys.stdin.readlines(): n = int(line) count_ = 0 for i in range(n): count = 0 for j in range(i+1): if (i+1) % (j+1) == 0: count += 1 if count == 2: count_ += 1 print(count_)
lst = [1 for i in range(10 ** 6 + 1)] lst[0] = lst[1] = 0 for i in range(10 ** 6 + 1): if lst[i] == 1: for j in range(i * 2, 10 ** 6 + 1, i): lst[j] = 0 while 0 == 0: try: n = int(input()) c = 0 for i in range(n + 1): c += lst[i] print(c) except EOFError: break
s841225791
s997677111
p00009
python
Time Limit Exceeded
import sys def prime(n): l = [2] for i in range(3,n+1): count = 0 for j in l: if i % j == 0: count += 1 if count == 0: l.append(i) return l for line in sys.stdin.readlines(): n = int(line) if n == 1: print(0) else: print(len(prime(n)))
lst = [1 for i in range(10 ** 6 + 1)] lst[0] = lst[1] = 0 for i in range(10 ** 6 + 1): if lst[i] == 1: for j in range(i * 2, 10 ** 6 + 1, i): lst[j] = 0 while 0 == 0: try: n = int(input()) c = 0 for i in range(n + 1): c += lst[i] print(c) except EOFError: break
s160235593
s997677111
p00009
python
Time Limit Exceeded
import sys def prime(n): i = 2 if n == 1: l = [] else: l = [2] while i < n: i += 1 for j in l: if i % j == 0: break else: l.append(i) return len(l) for line in sys.stdin.readlines(): n = int(line) print(prime(n))
lst = [1 for i in range(10 ** 6 + 1)] lst[0] = lst[1] = 0 for i in range(10 ** 6 + 1): if lst[i] == 1: for j in range(i * 2, 10 ** 6 + 1, i): lst[j] = 0 while 0 == 0: try: n = int(input()) c = 0 for i in range(n + 1): c += lst[i] print(c) except EOFError: break
s288086289
s997677111
p00009
python
Time Limit Exceeded
w = int(raw_input()) n = int(raw_input()) l = [i for i in range(1,w+1)] while n > 0: a,b = map(int,raw_input().split(',')) l[a-1],l[b-1] = l[b-1],l[a-1] n -= 1 for i in l: print(i)
w = int(input()) n = int(input()) l = [i for i in range(1,w+1)] while n > 0: a,b = map(int,input().split(',')) l[a-1],l[b-1] = l[b-1],l[a-1] n -= 1 for i in l: print(i)
s646828689
s192476986
p00011
python
Runtime Error
import math x,y,r = 0,0,90 while True: m,n = map(int,raw_input().split(',')) if (m,n) == (0,0): break y += m * math.sin(math.radians(r)) y x+= m * math.cos(math.radians(r)) r -= n print(int(x)) print(int(y))
import math x,y,r = 0,0,90 while True: m,n = map(int,input().split(',')) if (m,n) == (0,0): break y += m * math.sin(math.radians(r)) x += m * math.cos(math.radians(r)) r -= n print(int(x)) print(int(y))
s129774133
s676890771
p00016
python
Runtime Error
def f(n,s,x): if n == s == 0: return 1 elif n == 0 or x == 0: return 0 else: a = 0 for i in range(x): a += f(n-1,s-i,i) return a while True: n,s = map(int,raw_input().split()) if n == s == 0: break print(f(n,s,10))
def f(n,s,x): if n == s == 0: return 1 elif n == 0 or x == 0: return 0 else: a = 0 for i in range(x): a += f(n-1,s-i,i) return a while True: n,s = map(int,input().split()) if n == s == 0: break print(f(n,s,10))
s423646646
s737007900
p00030
python
Runtime Error
import sys def primegen(): l = [2] while True: yield max(l) n = max(l) while True: n += 1 flag = 1 for i in l: if n % i == 0: flag = 0 break if flag: l.append(n) break for line in sys.stdin: n = int(line) seq = primegen() i1 = 0...
MAX = 60000 lst = [i for i in range(MAX)] lst[0] = lst[1] = 0 for i in range(MAX): if lst[i] != 0: for j in range(i * 2, MAX, i): lst[j] = 0 while 0 == 0: try: n = int(input()) i = n - 1 j = n + 1 while lst[i] == 0: i -= 1 while lst[j] == 0: j += 1 print(lst[i],lst[j]) ...
s931782522
s235575413
p00044
python
Time Limit Exceeded
def primes(n): l = [1 for i in range(n+1)] l[0] = l[1] = 0 for i in range(2,int((n)**(1/2))+1): if l[i] == 1: for j in range(2,(n)//i+1): l[i*j] = 0 return l l = primes(50000) while True: n = int(input()) if n == 0: break count = 0 for i in range(1,n//2+1): if (l[i] and l[n-i...
def primes(n): l = [1 for i in range(n+1)] l[0] = l[1] = 0 for i in range(2,int((n)**(1/2))+1): if l[i] == 1: for j in range(2,n//i+1): l[i*j] = 0 return l l = primes(50000) while True: n = int(input()) if n == 0: break count = 0 if not(n%2): for i in range(3,n//2+1,2): ...
s500051260
s593177737
p00056
python
Time Limit Exceeded
def primes(n): l = [1 for i in range(n+1)] l[0] = l[1] = 0 for i in range(2,int((n)**(1/2))+1): if l[i] == 1: for j in range(2,(n)//i+1): l[i*j] = 0 l2 = [n for n in range(len(l)) if l[n]] return l2 l = primes(50000) while True: n = int(input()) if n == 0: break count = 0 for i...
def primes(n): l = [1 for i in range(n+1)] l[0] = l[1] = 0 for i in range(2,int((n)**(1/2))+1): if l[i] == 1: for j in range(2,n//i+1): l[i*j] = 0 return l l = primes(50000) while True: n = int(input()) if n == 0: break count = 0 if not(n%2): for i in range(3,n//2+1,2): ...
s187726916
s593177737
p00056
python
Time Limit Exceeded
def primes(n): l = [1 for i in range(n+1)] l[0] = l[1] = 0 for i in range(2,int((n)**(1/2))+1): if l[i] == 1: for j in range(2,(n)//i+1): l[i*j] = 0 l2 = [n for n in range(len(l)) if l[n]] return l2 l = primes(50000) while True: n = int(input()) if n == 0: break count = 0 for i ...
def primes(n): l = [1 for i in range(n+1)] l[0] = l[1] = 0 for i in range(2,int((n)**(1/2))+1): if l[i] == 1: for j in range(2,n//i+1): l[i*j] = 0 return l l = primes(50000) while True: n = int(input()) if n == 0: break count = 0 if not(n%2): for i in range(3,n//2+1,2): ...
s757834711
s593177737
p00056
python
Time Limit Exceeded
def primes(n): l = [1 for i in range(n+1)] l[0] = l[1] = 0 for i in range(2,int((n)**(1/2))+1): if l[i] == 1: for j in range(2,(n)//i+1): l[i*j] = 0 return l l = primes(50000) while True: n = int(input()) if n == 0: break count = 0 for i in range(2,n//2+1): if (l[i] and l[n-i]...
def primes(n): l = [1 for i in range(n+1)] l[0] = l[1] = 0 for i in range(2,int((n)**(1/2))+1): if l[i] == 1: for j in range(2,n//i+1): l[i*j] = 0 return l l = primes(50000) while True: n = int(input()) if n == 0: break count = 0 if not(n%2): for i in range(3,n//2+1,2): ...
s912425589
s593177737
p00056
python
Time Limit Exceeded
def primes(n): l = [1 for i in range(n+1)] l[0] = l[1] = 0 for i in range(2,int((n)**(1/2))+1): if l[i] == 1: for j in range(2,n//i+1): l[i*j] = 0 return l while True: n = int(input()) if n == 0: break l = primes(n) count = 0 for i in range(2,n//2+1): if (l[i] and l[n-i]): ...
def primes(n): l = [1 for i in range(n+1)] l[0] = l[1] = 0 for i in range(2,int((n)**(1/2))+1): if l[i] == 1: for j in range(2,n//i+1): l[i*j] = 0 return l l = primes(50000) while True: n = int(input()) if n == 0: break count = 0 if not(n%2): for i in range(3,n//2+1,2): ...
s117378650
s593177737
p00056
python
Time Limit Exceeded
print(sum([int(input()) for i in range(10)])
print(sum([int(input()) for i in range(10)]))
s860708242
s659458471
p00251
python
Runtime Error
a,b,c = map(int,input().spit()) if b <= a: print(No) elif c <= b: print(No) else: print(Yes)
a,b,c = map(int,input().split()) if b <= a: print('No') elif c <= b: print('No') else: print('Yes')
s311166476
s178485083
p02392
python
Runtime Error
a,b,c = map(int,input().split()) if b <= a: print(No) elif c <= b: print(No) else: print(Yes)
a,b,c = map(int,input().split()) if b <= a: print('No') elif c <= b: print('No') else: print('Yes')
s413956027
s178485083
p02392
python
Runtime Error
from math import pi r = int(input()) d = pi*r*r l = 2*pi*r print(d,l)
from math import pi r = float(input()) d = pi*r*r l = 2*pi*r print(d,l)
s711574000
s941435706
p02400
python
Runtime Error
n = input() l = [int(i) for i in input().split()] print(' '.join([str(min(l)),str(max(l)),str(sum(l))])
n = input() l = [int(i) for i in input().split()] print(' '.join([str(min(l)),str(max(l)),str(sum(l))]))
s059901472
s232360011
p02402
python
Runtime Error
l = [] while True: h,w = map(int,input().split()) if (h,w) == (0,0): break else: l.append([h,w]) for i in l: r1 = '' r2 = '' for jin range(i[1]//2): r1 += '#.' r2 += '.#' if i[1]%2 == 1: r1 += '#' r2 += '.' for m in range(i[0]//2): print(r1) print(r2) if i[0]%2 == 1: ...
l = [] while True: h,w = map(int,input().split()) if (h,w) == (0,0): break else: l.append([h,w]) for i in l: r1 = '' r2 = '' for j in range(i[1]//2): r1 += '#.' r2 += '.#' if i[1]%2 == 1: r1 += '#' r2 += '.' for m in range(i[0]//2): print(r1) print(r2) if i[0]%2 == 1: ...
s450435996
s641491586
p02405
python
Runtime Error
l = [x+' '+y for x in ['S','H','C','D'] for y in [str(i) for i in range(1,14)]] n = int(input()) while n > 0: l.remove(input()) n += 1 for i in l: print(i)
l = [x+' '+y for x in ['S','H','C','D'] for y in [str(i) for i in range(1,14)]] n = int(input()) while n > 0: l.remove(input()) n -= 1 for i in l: print(i)
s933151122
s183169691
p02408
python
Runtime Error
l = [] l= [] while True: m,f,r = map(int,input().split()) if m == f == r == -1: break else: l.append([m,f,r]) for i in l: s = '' x = i[0] + i[1] if i[0] == -1 or i[1] == -1: s = 'F' elif x >= 80: s = 'A' elif x >= 65: s = 'B': elif x >= 50: s = 'C': elif x >= 30: s = 'D' ...
def code(): l = [] while True: m,f,r = map(int,input().split()) if m == f == r == -1: break else: l.append([m,f,r]) for i in l: s = '' x = i[0]+i[1] if i[0] == -1 or i[1] == -1: s = 'F' elif x >= 80: s = 'A' elif x >= 65: s = 'B' elif x >= 50: s = 'C' elif x >= 30: s = 'D' ...
s694562194
s320993377
p02411
python
Runtime Error
l = [] while True: m,f,r = map(int,input().split()) if m == f == r == -1: break else: l.append([m,f,r]) for i in l: s = '' x = i[0] + i[1] if i[0] == -1 or i[1] == -1: s = 'F' elif x >= 80: s = 'A' elif x >= 65: s = 'B': elif x >= 50: s = 'C': elif x >= 30: s = 'D' if...
def code(): l = [] while True: m,f,r = map(int,input().split()) if m == f == r == -1: break else: l.append([m,f,r]) for i in l: s = '' x = i[0]+i[1] if i[0] == -1 or i[1] == -1: s = 'F' elif x >= 80: s = 'A' elif x >= 65: s = 'B' elif x >= 50: s = 'C' elif x >= 30: s = 'D' ...
s646162265
s320993377
p02411
python
Runtime Error
import sys import math for line in sys.stdin: a,b = map(int, line.split()) gc = math.gcd(a,b) print("{} {}".format(gc, a*b//gc))
import sys def gcd(a,b): if a%b == 0: return b else: return gcd(b, a%b) for line in sys.stdin: a,b = map(int, line.split()) if a<b: tem = a a = b b = tem gc = gcd(a,b) print(gc, a*b//gc)
s953064430
s089397247
p00005
python
Runtime Error
import sys import math for line in sys.stdin: a,b = map(int, line.split()) gc = math.gcd(a,b) print("{0} {1}".format(gc, a*b//gc))
import sys def gcd(a,b): if a%b == 0: return b else: return gcd(b, a%b) for line in sys.stdin: a,b = map(int, line.split()) if a<b: tem = a a = b b = tem gc = gcd(a,b) print(gc, a*b//gc)
s554724703
s089397247
p00005
python
Runtime Error
while True: n = int(input()) if n==0 : break a = [] for i in range(n): a.append(int(input())) maxi = 0 for i in range(1,1+n): for j in range(n-i+1): if maxi < sum(a[j:j+i]): maxi = sum(a[j:j+i]) print(maxi)
while True: n = int(input()) if n==0 : break a = [] for i in range(n): a.append(int(input())) maxp = -100001 maxcont = -100001 for i in range(n): maxcont = max(a[i], maxcont + a[i]) maxp = max(maxp, maxcont) print(maxp)
s965756400
s320965266
p00022
python
Time Limit Exceeded
while True: instr = str(bin(int(input()))) ans = [] for i in range(len(instr)): if instr[-i]=="1": ans.append(1<<i-1) print(" ".join(map(lambda x: str(x), ans)))
while True: try: instr = str(bin(int(input()))) ans = [] for i in range(len(instr)): if instr[-i]=="1": ans.append(1<<i-1) print(" ".join(map(lambda x: str(x), ans))) except EOFError: break
s445424539
s170835292
p00031
python
Runtime Error
from math import gcd def unzip(strlist,a,b): ret = [] for word in strlist: tmp = "" for i in range(len(word)): tmp += chr(((ord(word[i])-97)*a+b)%26+97) ret.append(tmp) return ret n = int(input()) for _ in range(n): instr = input().split() for a in range(1,26): ...
def gcd(a, b): if a < b: a, b = b, a if b == 0: return a return gcd(b, a%b) def unzip(strlist,a,b): ret = [] for word in strlist: tmp = "" for i in range(len(word)): tmp += chr(((ord(word[i])-97)*a+b)%26+97) ret.append(tmp) return ret n = int...
s147883287
s965912499
p00040
python
Runtime Error
import math class Mobile: def __init__(self,leftratio=0,rightratio=0,left=-1,right=-1): self.weight = 0 self.leftratio = leftratio self.rightratio = rightratio self.left = left self.leftweight = 0 self.right = right self.rightweight = 0 def calc(self): ...
''' Created on 2017/03/09 @author: 03key ''' def gcd(x,y): if x<y: tmp = x x = y y = tmp ans = y if x%y != 0: ans = gcd(y,x%y) return ans class Mobile: def __init__(self,leftratio=0,rightratio=0,left=-1,right=-1): self.weight = 0 self.leftratio = le...
s518732952
s339327012
p00443
python
Runtime Error
import math class Mobile: def __init__(self,leftratio=0,rightratio=0,left=-1,right=-1): self.weight = 0 self.leftratio = leftratio self.rightratio = rightratio self.left = left self.leftweight = 0 self.right = right self.rightweight = 0 def calc(self): ...
''' Created on 2017/03/09 @author: 03key ''' def gcd(x,y): if x<y: tmp = x x = y y = tmp ans = y if x%y != 0: ans = gcd(y,x%y) return ans class Mobile: def __init__(self,leftratio=0,rightratio=0,left=-1,right=-1): self.weight = 0 self.leftratio = le...
s774335012
s339327012
p00443
python
Runtime Error
def gcd(x,y): if x<y: tmp = x x = y y = tmp if x%y == 0: return y else: gcd(y,x%y) class Mobile: def __init__(self,leftratio=0,rightratio=0,left=-1,right=-1): self.weight = 0 self.leftratio = leftratio self.rightratio = rightratio ...
''' Created on 2017/03/09 @author: 03key ''' def gcd(x,y): if x<y: tmp = x x = y y = tmp ans = y if x%y != 0: ans = gcd(y,x%y) return ans class Mobile: def __init__(self,leftratio=0,rightratio=0,left=-1,right=-1): self.weight = 0 self.leftratio = le...
s920746675
s339327012
p00443
python
Runtime Error
def searchstar(i,j): global vector global star global n flag = False for k in range(n): if star[i][0] + vector[j][0] == star[k][0] and star[i][1] + vector[j][1] == star[k][1]: flag = True break return flag while True: m = int(input()) if m==0: break ...
def searchstar(i,j): global vector global star global n flag = False for k in range(n): if star[i][0] + vector[j][0] == star[k][0] and star[i][1] + vector[j][1] == star[k][1]: flag = True break return flag while True: m = int(input()) if m==0: break ...
s703349573
s056874358
p00447
python
Time Limit Exceeded
def searchstar(i,j): global vector global star global n flag = False for k in range(n): if star[i][0] + vector[j][0] == star[k][0] and star[i][1] + vector[j][1] == star[k][1]: flag = True break return flag while True: m = int(input()) if m==0: break ...
def searchstar(i,j): global vector global star global n flag = False for k in range(n): if star[i][0] + vector[j][0] == star[k][0] and star[i][1] + vector[j][1] == star[k][1]: flag = True break return flag while True: m = int(input()) if m==0: break ...
s658230006
s056874358
p00447
python
Time Limit Exceeded
while True: r,c = map(int, input().split()) if (r|c)==0: break array = [] for i in range(r): array.append(list(map(int, input().split()))) num = [0]*c for i in range(r): for j in range(c): num[j] = num[j]*2+array[i][j] maxx = -1 for i in range(1 << r): ...
while True: r,c = map(int, input().split()) if (r|c)==0: break num = [0]*c for i in range(r): instr = input() for j in range(c): num[j] = (num[j]<<1) + (instr[2*j]=="1") maxx = -1 for i in range(1 << r): answer = 0 for j in range(c): okse...
s889452094
s914408811
p00448
python
Time Limit Exceeded
while True: r,c = map(int, input().split()) if (r|c)==0: break array = [] for i in range(r): array.append(input()) num = [0]*c for i in range(r): for j in range(c): num[j] = num[j]*2+int(array[i][2*j]) maxx = -1 for i in range(1 << r): answer = 0 ...
while True: r,c = map(int, input().split()) if (r|c)==0: break num = [0]*c for i in range(r): instr = input() for j in range(c): num[j] = (num[j]<<1) + (instr[2*j]=="1") maxx = -1 for i in range(1 << r): answer = 0 for j in range(c): okse...
s058226706
s914408811
p00448
python
Time Limit Exceeded
import bisect def xins(x): if not x in xlist: insp = bisect.bisect(xlist,x) xlist.insert(insp,x) for lst in zaatu: ins = 1 if insp == 0 else lst[insp-1] lst.insert(insp,ins) def yins(y): if not y in ylist: insp = bisect.bisect(ylist,y) ylist.inse...
import bisect from collections import deque def xins(x): if not x in xlist: insp = bisect.bisect(xlist,x) xlist.insert(insp,x) for lst in zaatu: ins = 1 if insp == 0 else lst[insp-1] lst.insert(insp,ins) def yins(y): if not y in ylist: insp = bisect.bise...
s308048118
s011657325
p00454
python
Runtime Error
import bisect import sys sys.setrecursionlimit(100000) def xins(x): if not x in xlist: insp = bisect.bisect(xlist,x) xlist.insert(insp,x) for lst in zaatu: ins = 1 if insp == 0 else lst[insp-1] lst.insert(insp,ins) def yins(y): if not y in ylist: insp = ...
import bisect from collections import deque def xins(x): if not x in xlist: insp = bisect.bisect(xlist,x) xlist.insert(insp,x) for lst in zaatu: ins = 1 if insp == 0 else lst[insp-1] lst.insert(insp,ins) def yins(y): if not y in ylist: insp = bisect.bise...
s858215481
s011657325
p00454
python
Runtime Error
def listrep(n,m,s): tab = [[[0]*(s+1) for j in range(n+1)] tab[0][0] = 1 for i in range(1,n+1): for k in range(s+1): if i <= k: tab[i][k] += tab[i][k-i] + tab[i-1][k-i] if j-1 >= m: tab[i][k] -= tab[i-1][j-1-m] return tab[n][m][s] while Tr...
def listrep(n,m,s): tab = [[0]*(s+1) for j in range(n+1)] tab[0][0] = 1 for i in range(1,n+1): for k in range(s+1): if i <= k: tab[i][k] += tab[i][k-i] + tab[i-1][k-i] if k-1 >= m: tab[i][k] -= tab[i-1][k-1-m] tab[i][k] %= 100000 ...
s978873961
s240543859
p00460
python
Runtime Error
n,m = map(int,input().split()) lng = [] for _ in range(n-1): lng.append(int(input())) i = 0 sm = 0 for _ in range(m): j = i+int(input()) mv = sum(lng[i:j]) if j > i else sum(lng[j:i]) sm += mv i = j print(sm%100000)
n,m = map(int,input().split()) lng = [0] for _ in range(n-1): lng.append(lng[-1] + int(input())) i = 0 sm = 0 for _ in range(m): j = i+int(input()) sm += abs(lng[i]-lng[j]) sm %= 100000 i = j print(sm)
s710768916
s206364464
p00472
python
Runtime Error
n,m = map(int,input().split()) lng = [] for _ in range(n-1): lng.append(int(input())) i = 0 sm = 0 for _ in range(m): j = i+int(input()) mv = sum(lng[i:j]) if j > i else sum(lng[j:i]) sm += mv if sm >= 100000: sm -= 100000 i = j print(sm)
n,m = map(int,input().split()) lng = [0] for _ in range(n-1): lng.append(lng[-1] + int(input())) i = 0 sm = 0 for _ in range(m): j = i+int(input()) sm += abs(lng[i]-lng[j]) sm %= 100000 i = j print(sm)
s754859966
s206364464
p00472
python
Runtime Error
n,m = map(int,input().split()) lng = [] for _ in range(n-1): lng.append(int(input())) i = 0 sm = 0 for _ in range(m): j = i+int(input()) mv = sum(lng[i:j]) if j > i else sum(lng[j:i]) sm += mv sm %= 100000 i = j print(sm)
n,m = map(int,input().split()) lng = [0] for _ in range(n-1): lng.append(lng[-1] + int(input())) i = 0 sm = 0 for _ in range(m): j = i+int(input()) sm += abs(lng[i]-lng[j]) sm %= 100000 i = j print(sm)
s347679962
s206364464
p00472
python
Runtime Error
n = int(input()) dp = [float('inf')]*(n+1) dp[0] = 0 for i in range(1,n): cost = int(input()) for j in range(i): dp[j] = min(dp[j],dp[i-j]+cost) dp[i-j] = min(dp[j]+cost,dp[i-j]) #print(dp) print(dp[n//2])
n = int(input()) dp = [float('inf')]*(n+1) dp[0] = 0 cost = [int(input()) for _ in range(n-1)] for i in range(1,n): for j in range(i): if dp[i-j]+cost[i-1] < dp[j]: dp[j] = dp[i-j]+cost[i-1]# = min(dp[j],dp[i-j]+cost[i-1]) if dp[j]+cost[i-1] < dp[i-j]: dp[i-j] = dp[j]+cost[i-1]# = min(dp[i-j],dp[j]...
s601057742
s731200047
p00473
python
Runtime Error
def SimultaneousEquation(): for line in sys.stdin: a,b,c,d,e,f=map(float,line.split()) y=(c*d-f*a)/(b*d-e*a) x=(c-b*y)/a print("{0:.3f} {1:.3f}".format(x,y)) SimultaneousEquation()
import sys def SimultaneousEquation(): for line in sys.stdin: a,b,c,d,e,f=map(float,line.split()) y=(c*d-f*a)/(b*d-e*a) x=(c-b*y)/a print("{0:.3f} {1:.3f}".format(x,y)) #testWriteFile() SimultaneousEquation()
s693020112
s052459205
p00004
python
Runtime Error
def GcdLCM(): while 1: x,y=map(int,input().split()) gcd = Gcd(x,y) lcm = int(x*y/gcd) print("{} {}".format(gcd,lcm)) def Gcd(x,y): while x!=0: x,y=y%x,x return y GcdLCM()
import sys def GcdLCM(): for line in sys.stdin: x,y=map(int,line.split()) if x==None: break gcd = Gcd(x,y) lcm = int(x*y/gcd) print("{} {}".format(gcd,lcm)) def Gcd(x,y): while x!=0: x,y=y%x,x return y GcdLCM()
s061553740
s276679462
p00005
python
Runtime Error
def GcdLCM(): while 1: x,y=map(int,input().split()) if x==None: break gcd = Gcd(x,y) lcm = int(x*y/gcd) print("{} {}".format(gcd,lcm)) def Gcd(x,y): while x!=0: x,y=y%x,x return y GcdLCM()
import sys def GcdLCM(): for line in sys.stdin: x,y=map(int,line.split()) if x==None: break gcd = Gcd(x,y) lcm = int(x*y/gcd) print("{} {}".format(gcd,lcm)) def Gcd(x,y): while x!=0: x,y=y%x,x return y GcdLCM()
s227324122
s276679462
p00005
python
Runtime Error
def GcdLCM(): for line in sys.stdin: x,y=map(int,line.split()) if x==None: break gcd = Gcd(x,y) lcm = int(x*y/gcd) print("{} {}".format(gcd,lcm)) def Gcd(x,y): while x!=0: x,y=y%x,x return y GcdLCM()
import sys def GcdLCM(): for line in sys.stdin: x,y=map(int,line.split()) if x==None: break gcd = Gcd(x,y) lcm = int(x*y/gcd) print("{} {}".format(gcd,lcm)) def Gcd(x,y): while x!=0: x,y=y%x,x return y GcdLCM()
s413716175
s276679462
p00005
python
Runtime Error
import string def CaesarCipher(): low=str.ascii_lowercase for cry in sys.stdin: for i in range(1,27): dec=cry.translate(str.maketrans(low,low[i:]+low[:i])) if 'this' in dec or 'that' in dec or 'the' in dec: print(dec) ...
import string import sys def CaesarCipher(): low=string.ascii_lowercase for cry in sys.stdin: for i in range(1,27): dec=cry.translate(str.maketrans(low,low[i:]+low[:i])) if 'this' in dec or 'that' in dec or 'the' in dec: print(dec[:-...
s559276375
s812060603
p00017
python
Runtime Error
import string def CaesarCipher(): low=string.ascii_lowercase for cry in sys.stdin: for i in range(1,27): dec=cry.translate(str.maketrans(low,low[i:]+low[:i])) if 'this' in dec or 'that' in dec or 'the' in dec: print(dec) ...
import string import sys def CaesarCipher(): low=string.ascii_lowercase for cry in sys.stdin: for i in range(1,27): dec=cry.translate(str.maketrans(low,low[i:]+low[:i])) if 'this' in dec or 'that' in dec or 'the' in dec: print(dec[:-...
s923341033
s812060603
p00017
python
Runtime Error
import string def CaesarCipher(): low=string.ascii_lowercase for cry in sys.stdin: for i in range(1,27): dec=cry.translate(str.maketrans(low,low[i:]+low[:i])) if 'this' in dec or 'that' in dec or 'the' in dec: print(dec) ...
import string import sys def CaesarCipher(): low=string.ascii_lowercase for cry in sys.stdin: for i in range(1,27): dec=cry.translate(str.maketrans(low,low[i:]+low[:i])) if 'this' in dec or 'that' in dec or 'the' in dec: print(dec[:-...
s519258042
s812060603
p00017
python
Runtime Error
import sys arr = [0 for i in range(0,101)] for i in sys.stdin: arr[int(i)] += 1 max = max(arr) for i in for(0,101): if arr[i]==max: print(i)
import sys def ModeValue(): mode=[0 for i in range(0,101)] for n in sys.stdin: mode[int(n)]+=1 maxN=max(mode) for i in range(0,101): if mode[i]==maxN: print(i) ModeValue()
s884876907
s716987253
p00028
python
Runtime Error
def Aizu_PR(): n = int(input()) for _ in range(n): print(input().replace("Hoshino","Hoshina") Aizu_PR()
def Aizu_PR(): for _ in range(int(input())): print(input().replace("Hoshino","Hoshina")) Aizu_PR()
s769493025
s558743197
p00101
python
Runtime Error
import sys i = int(raw_input()) print(i**3)
import sys i = int(input()) print(i**3)
s852803684
s912062846
p02388
python
Runtime Error
w = int(input()) h = int(input()) print((w+h)*2)
numbers = list(map(int,input().split())) print(str(numbers[0]*numbers[1])+" "+str((numbers[0]+numbers[1])*2))
s811093618
s973471053
p02389
python
Runtime Error
numbers = list(map(int,input().split())) print((numbers[0]*numbers[1])+" "+(numbers[0]+numbers[1])*2)
numbers = list(map(int,input().split())) print(str(numbers[0]*numbers[1])+" "+str((numbers[0]+numbers[1])*2))
s315055233
s973471053
p02389
python
Runtime Error
num = list(map(int,input().split())) a = num[0] b = num[1] output = str(a) if a<b: output=output+" < "; elif a>b: output=output+" > "; else: output=output+" = "; print(output+str(b))
a,b=map(int,input().split()) s="" if a>b: s=">" elif a<b: s="<" else: s="==" print("a",s,"b")
s836380019
s319103533
p02391
python
Runtime Error
a = [x for x in range(9)] for i in a: for j in a: print('{}x{}={}'.format(i + 1, j + 1, (i + 1) * (j + 1))
a = range(1, 10) [print('{}x{}={}'.format(i, j, i * j)) for i in a for j in a]
s001923321
s045733196
p00000
python
Runtime Error
[print('{}x{}={}').format(i, j, i * j) for j in range(1, 10) for i in range(1, 10)]
a = range(1, 10) [print('{}x{}={}'.format(i, j, i * j)) for i in a for j in a]
s931248767
s045733196
p00000
python
Runtime Error
rank = sorted([int(input()) for i in range(10)], reverse=True) print('\n'.join(rank[:3]) + '\n')
rank = sorted([int(input()) for i in range(10)], reverse=True) print('\n'.join(map(str, rank[:3])))
s086356924
s824986832
p00001
python
Runtime Error
import sys a = [print(len(sum(map(int, line.split())))) for line in sys.stdin]
import sys [print(len(str(sum(map(int, line.split()))))) for line in sys.stdin]
s751743436
s202837609
p00002
python
Runtime Error