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
from math import sqrt while True: e = int(raw_input()) if e == 0: break x, y, z, ans = 0, 0, 0, e for z in range(e+1): if z**3 > e: break y = int(sqrt(e - z**3)) x = e - y**2 - z**3 ans = min(ans, x+y+z) print ans
#!/usr/bin/env python3 from math import sqrt while True: e = int(input()) if e == 0: break z, ans = 0, e while z ** 3 <= e: y = int(sqrt(e - z**3)) x = e - y**2 - z**3 ans = min(ans, x + y + z) z += 1 print(ans)
s505021805
s276262113
p01137
python
Runtime Error
from math import sqrt while True: e = int(raw_input()) if e == 0: break z, ans = 0, e for z in range(e+1): if z**3 > e: break y = int(sqrt(e - z**3)) x = e - y**2 - z**3 ans = min(ans, x+y+z) print ans
#!/usr/bin/env python3 from math import sqrt while True: e = int(input()) if e == 0: break z, ans = 0, e while z ** 3 <= e: y = int(sqrt(e - z**3)) x = e - y**2 - z**3 ans = min(ans, x + y + z) z += 1 print(ans)
s190567900
s276262113
p01137
python
Runtime Error
from math import sqrt while True: e = int(raw_input()) if e == 0: break ans = e for z in range(e): if z**3 > e: break y = int(sqrt(e - z**3)) x = e - y**2 - z**3 ans = min(ans, x+y+z) print ans
#!/usr/bin/env python3 from math import sqrt while True: e = int(input()) if e == 0: break z, ans = 0, e while z ** 3 <= e: y = int(sqrt(e - z**3)) x = e - y**2 - z**3 ans = min(ans, x + y + z) z += 1 print(ans)
s208237090
s276262113
p01137
python
Runtime Error
n = int(raw_input()) dp = [1, 1] for i in range(50): dp += dp[-1] + dp[-2] print dp[n]
n = int(raw_input()) dp = [1, 1] for i in range(50): dp += [dp[-1] + dp[-2]] print dp[n]
s047689823
s199268778
p02233
python
Runtime Error
def bubbleSort(A, N): c = 0 flag = 1 # ????????£??\????´?????????¨?????? while flag: flag = 0 for j in range(N-1, 0, -1): if A[j] < A[j-1]: A[j], A[j-1] = A[j-1], A[j] c += 1 flag = 1 print " ".join(map(str, A)) print c ...
def bubble_sort(A, N): flag = True i, c = 0, 0 while flag: flag = False for j in range(1, N-i): if A[j] < A[j-1]: A[j], A[j-1] = A[j-1], A[j] flag = True c += 1 i += 1 print " ".join(map(str, A)) print ...
s974917569
s320738782
p02259
python
Runtime Error
def bubble_sort(A, N): flag = True c = 0 i = 0 while flag: for j in range(N-1, i, -1): flag = False if A[j] < A[j-1]: A[j], A[j-1] = A[j-1], A[j] c += 1 flag = True i += 1 print " ".join(map(str, A)) print ...
def bubble_sort(A, N): flag = True i, c = 0, 0 while flag: flag = False for j in range(1, N-i): if A[j] < A[j-1]: A[j], A[j-1] = A[j-1], A[j] flag = True c += 1 i += 1 print " ".join(map(str, A)) print ...
s333388234
s320738782
p02259
python
Time Limit Exceeded
s = raw_input() St1, St2 = [], [] sumv = 0 for i in range(len(s)): if s[i] == '\\': St1.append(i) elif s[i] == '/' and len(St1) > 0: j = St1.pop() a = i-j sumv += a while len(St2) > 0 and St2[-1][0] > j: a += St2.pop()[1] St2.append([j, a]) St2.ins...
s = raw_input() St1, St2 = [], [] sumv = 0 for i in range(len(s)): if s[i] == '\\': St1.append(i) elif s[i] == '/' and len(St1) > 0: j = St1.pop() a = i-j sumv += a while len(St2) > 0 and St2[-1][0] > j: a += St2.pop()[1] St2.append([j, a]) St2.ins...
s880116584
s817978727
p02266
python
Runtime Error
n = int(raw_input()) S = map(int, raw_input(),split()) q = int(raw_input()) T = map(int, raw_input().split()) ans = 0 for i in T: if i in S: ans += 1 print ans
n = int(raw_input()) S = map(int, raw_input().split()) q = int(raw_input()) T = map(int, raw_input().split()) ans = 0 for i in T: if i in S: ans += 1 print ans
s736084167
s311222343
p02267
python
Runtime Error
n = int(raw_input()) L = [] for i in xrange(n): a, b = map(raw_input().split()) if a == "insert": L.append(b) if a == "find": if b in L: print "yes" else: print "no"
n = int(raw_input()) dic = {} for i in xrange(n): a, b = raw_input().split() if a == "insert": dic[b] = True elif a == "find": if b in dic: print "yes" else: print "no"
s031329897
s553090279
p02269
python
Runtime Error
n = int(raw_input()) L = [] for i in xrange(n): a, b = raw_input().split() if a == "insert": L.append(b) if a == "find": if b in L: print "yes" else: print "no"
n = int(raw_input()) dic = {} for i in xrange(n): a, b = raw_input().split() if a == "insert": dic[b] = True elif a == "find": if b in dic: print "yes" else: print "no"
s858137134
s553090279
p02269
python
Time Limit Exceeded
def solve(i, m): if m == 0: return True if i == n or m < 0: return False res = solve(i + 1, m) or solve(i + 1, m - A[i]) return res n = int(raw_input()) A = map(int, raw_input().split()) q = int(raw_input()) M = map(int, raw_input().split()) for i in M: print "yes" if solve(0, i)...
def solve(i, m): if m == 0: return True if i < n and min(A[i:]) <= m <= sum(A[i:]): r1 = solve(i + 1, m-A[i]) if r1: return r1 r2 = solve(i + 1, m) if r2: return r2 n = int(raw_input()) A = map(int, raw_input().split()) q = int(raw_input()) M = map(int, raw_input().split()) ...
s130074431
s590698095
p02271
python
Time Limit Exceeded
def solve(i, m): if m == 0: return True if i == n or m < 0: return False res = solve(i + 1, m) or solve(i + 1, m - A[i]) return res n = int(raw_input()) A = map(int, raw_input().split()) q = int(raw_input()) M = map(int, raw_input().split()) for i in M: print "yes" if solve(0, i...
def solve(i, m): if m == 0: return True if i < n and min(A[i:]) <= m <= sum(A[i:]): r1 = solve(i + 1, m-A[i]) if r1: return r1 r2 = solve(i + 1, m) if r2: return r2 n = int(raw_input()) A = map(int, raw_input().split()) q = int(raw_input()) M = map(int, raw_input().split()) ...
s996158335
s590698095
p02271
python
Time Limit Exceeded
def solve(i, m): if m == 0: return True if i == n or m < 0: return False r1 = solve(i + 1, m) r2 = solve(i + 1, m - A[i]) return r1 or r2 n = int(raw_input()) A = map(int, raw_input().split()) q = int(raw_input()) M = map(int, raw_input().split()) for i in M: print "yes" if solve(0...
def solve(i, m): if m == 0: return True if i < n and min(A[i:]) <= m <= sum(A[i:]): r1 = solve(i + 1, m-A[i]) if r1: return r1 r2 = solve(i + 1, m) if r2: return r2 n = int(raw_input()) A = map(int, raw_input().split()) q = int(raw_input()) M = map(int, raw_input().split()) ...
s617373419
s590698095
p02271
python
Time Limit Exceeded
def counting_sort(A, B, k): C = [0 for _ in xrange(k+1)] for a in A: C[a] += 1 for i in xrange(k): C[i] = C[i] + C[i-1] for i in xrange(n-1, -1, -1): B[C[A[i]]-1] = A[i] C[A[i]] -= 1 n = int(raw_input()) A = map(int, raw_input().split()) B = [0 for _ in xrange(n)] co...
def counting_sort(A, B, k): C = [0 for _ in xrange(k+1)] for a in A: C[a] += 1 for i in xrange(1, k+1): C[i] = C[i] + C[i-1] for i in xrange(n-1, -1, -1): B[C[A[i]]-1] = A[i] C[A[i]] -= 1 n = int(raw_input()) A = map(int, raw_input().split()) B = [0 for _ in xrange(n)...
s033489758
s610183751
p02275
python
Runtime Error
def main(): INF = int(1e12) G = [[0 for i in range(101)] for j in range(101)]; v, e = map(int, raw_input().split()) for i in range(v): for j in range(v): if i == j: G[i][j] = 0 else: G[i][j] = INF for i in range(e): s, t, ...
def main(): INF = int(1e12) G = [[0 for i in range(101)] for j in range(101)]; v, e = map(int, raw_input().split()) for i in range(v): for j in range(v): if i == j: G[i][j] = 0 else: G[i][j] = INF for i in range(e): s, t, d =...
s220587712
s840418128
p02363
python
Runtime Error
def main(): INF = int(1e12) G = [[0 for i in range(101)] for j in range(101)]; v, e = map(int, raw_input().split()) for i in range(v): for j in range(v): if i == j: G[i][j] = 0 else: G[i][j] = INF for i in range(e): s, ...
def main(): INF = int(1e12) G = [[0 for i in range(101)] for j in range(101)]; v, e = map(int, raw_input().split()) for i in range(v): for j in range(v): if i == j: G[i][j] = 0 else: G[i][j] = INF for i in range(e): s, t, d =...
s251032147
s840418128
p02363
python
Runtime Error
a = map(int,raw_input().split()) print a**3
a = input() print a**3
s200742268
s460428791
p02388
python
Runtime Error
a, b, c = map(int,raw_input().split()) if a > b > c: print a b c elif a > c > b: print a c b elif b > a > c: print b a c elif b > c > a: print b c a elif c > a > b: print c a b else: print c b a
a = map(int,raw_input().split()) a.sort() for i in xrange(3): print a[i],
s055298747
s722135749
p02393
python
Runtime Error
a, b, c = map(int,raw_input().split()) if a < b: a = tmp a = b b =tmp elif b < c: b = tmp b = c c =tmp elif a < c: a = tmp a = c c = tmp print a b c
a = map(int,raw_input().split()) a.sort() for i in xrange(3): print a[i],
s702504195
s722135749
p02393
python
Runtime Error
import math r = float(raw_input()) print ("%f %f"%(r**2*PI,r*2*PI))
import math r = float(raw_input()) print '%f %f' % (r*r*math.pi,r*2*math.pi)
s918096130
s728125716
p02479
python
Runtime Error
import sys x = input() y = input() print x*y , (x+y)*2
a, b = map(int,raw_input().split()) print a*b, 2*(a+b)
s303139961
s624910020
p02481
python
Runtime Error
import sys x = input() y = input() print x*y ,(x+y)*2
a, b = map(int,raw_input().split()) print a*b, 2*(a+b)
s787895428
s624910020
p02481
python
Runtime Error
x = raw_input() y = raw_input() print int(x) * int(y) print (int(x) + int(y))*2
a, b = map(int,raw_input().split()) print a*b, 2*(a+b)
s242548195
s624910020
p02481
python
Runtime Error
a, b = map(int,raw_inpu().split()) if a < b: print 'a < b' elif a > b: print 'a > b' else: print 'a == b'
a, b = map(int,raw_input().split()) if a < b: print 'a < b' elif a > b: print 'a > b' else: print 'a == b'
s824294560
s946299638
p02482
python
Runtime Error
while True: n,x = map(int,raw_input().split()) if n==x==0: break count=0 for i in xrange(1,n): for j in xrange(i,n) for k in xrange(j,n): if i+j+k==x: count+=1 print count
while True: n,x = map(int,raw_input().split()) if n==x==0: break ans=0 for i in xrange(1,n+1): for j in xrange(i+1,n+1): for k in xrange(j+1,n+1): if i+j+k==x: ans+=1 print ans
s926186600
s718411118
p02486
python
Runtime Error
while 1: a, b = map(int, raw_input().split()) if not a and not b: break if a < b: print "%d %d" %(a, b) else: print "%d &d" %(b, a)
while True: a,b = map(int,raw_input().split()) if a == b == 0: break if a < b: print '%d %d' % (a,b) else: print '%d %d' % (b,a)
s169323001
s853072704
p02490
python
Runtime Error
while 1: a, b = map(int, raw_input().split()) if not a and not b: break if a < b: print "%d %d" % (a, b) else: print "%d &d" % (b, a)
while True: a,b = map(int,raw_input().split()) if a == b == 0: break if a < b: print '%d %d' % (a,b) else: print '%d %d' % (b,a)
s823308629
s853072704
p02490
python
Runtime Error
a,b = map(int, raw_input.split()) print'%d %d %f,a/b, a%b, float(a/b)'
a,b = map(int,raw_input().split()) print '%d %d %f' % (a/b,a%b,float(a)/b)
s110338530
s910339782
p02491
python
Runtime Error
n = input() #読み込むよ! a = map(int,raw_input().split()) a.reverse() #reveres関数を使うよ! print ' '.join(map(str,a)) #joinで結合だったよね!
n = int(raw_input()) a = map(int,raw_input().split()) a.reverse() print ' '.join(map(str,a))
s928114712
s409330454
p02493
python
Runtime Error
card = {} n = int(raw_input()) for i in xrange(n): cards[raw_input] = True mark = 'SHCD' for j in mark: for n in range(1,14): if card not in cards: print j + ' ' + n
cards = {} n = int(raw_input()) for i in xrange(n): cards[raw_input()] = True for j in 'SHCD': for n in xrange(1,14): card = j + ' ' + str(n) if card not in cards: print card
s433793588
s391360321
p02496
python
Runtime Error
# Author: kira924age while True: m, f, r = map(raw_input().split()) if m == f == r == -1: break; if m+f < 30 or m == -1 or f == -1: print 'F' elif 80 <= m+f: print 'A' elif 65 <= m+f < 80: print 'B' elif 50 <= m+f < 65 or (30 <= m+f < 50 and 50 <= r): ...
while True: m,f,r = map(int,raw_input().split()) if m==f==r==-1: break if m == -1 or f == -1 or m+f < 30: print 'F' elif m+f >= 80: print 'A' elif 80 > m+f >= 65: print 'B' elif 65 > m+f >= 50: print 'C' elif 50 > m+f >= 30: if r < 50: print 'D' else: print 'C'
s401994125
s038646339
p02497
python
Runtime Error
s = 'abcdefghijklmnopqrstuvwxyz' l = [0]*26 while True: try: str=raw_input() except EOFError: break for i in str: an=ord(i.lower())-97 if an > 25 or an < 0: continue l[an]+=1 for i in xrange(26): print s[i] + ' : '+ str(l[i])
a='abcdefghijklmnopqrstuvwxyz' l=[0]*26 while True: try: text=raw_input() except EOFError: break for i in text: ascNum=ord(i.lower())-97 if ascNum < 0 or 25 < ascNum: continue l[ascNum]+=1 for i in xrange(26): print a[i] + ' : '+str(l[i])
s942940396
s081932988
p02499
python
Runtime Error
a = 'abcdefghijklmnopqrstuvwxyz' l = [0]*26 while True: try: s=raw_input() except EOFError: break for i in s: an=ord(i.lower())-97 if an > 25 or an < 0: continue l[an]+=1 for i in xrange(26): print a[i] + ' : '+ s(l[i])
a='abcdefghijklmnopqrstuvwxyz' l=[0]*26 while True: try: text=raw_input() except EOFError: break for i in text: ascNum=ord(i.lower())-97 if ascNum < 0 or 25 < ascNum: continue l[ascNum]+=1 for i in xrange(26): print a[i] + ' : '+str(l[i])
s101576259
s081932988
p02499
python
Runtime Error
a = 'abcdefghijklmnopqrstuvwxyz' l = [0]*26 while True: try: s=raw_input() except EOFError: break for i in s: an=ord(i.lower())-97 if an > 25 or an < 0: continue l[an]+=1 for i in xrange(26): print a[i] + ' : '+ s(l[i])
a='abcdefghijklmnopqrstuvwxyz' l=[0]*26 while True: try: text=raw_input() except EOFError: break for i in text: ascNum=ord(i.lower())-97 if ascNum < 0 or 25 < ascNum: continue l[ascNum]+=1 for i in xrange(26): print a[i] + ' : '+str(l[i])
s321646778
s081932988
p02499
python
Runtime Error
a = 'abcdefghijklmnopqrstuvwxyz' l = [0]*26 while True: try: s=raw_input() except EOFError: break for i in s: ascNum=ord(i.lower())-97 if ascNum > 25 or ascNum < 0: continue l[ascNum]+=1 for i in xrange(26): print a[i] + ' : '+ s(l[i])
a='abcdefghijklmnopqrstuvwxyz' l=[0]*26 while True: try: text=raw_input() except EOFError: break for i in text: ascNum=ord(i.lower())-97 if ascNum < 0 or 25 < ascNum: continue l[ascNum]+=1 for i in xrange(26): print a[i] + ' : '+str(l[i])
s344614687
s081932988
p02499
python
Runtime Error
a='abcdefghijklmnopqrstuvwxyz' l=[0]*26 while True: try: text=raw_input() except EOFError: break for i in text: ascNum=ord(i.lower())-97 l[ascNum]+=1 for i in xrange(26): print a[i] + ' : '+str(l[i])
a='abcdefghijklmnopqrstuvwxyz' l=[0]*26 while True: try: text=raw_input() except EOFError: break for i in text: ascNum=ord(i.lower())-97 if ascNum < 0 or 25 < ascNum: continue l[ascNum]+=1 for i in xrange(26): print a[i] + ' : '+str(l[i])
s019193089
s081932988
p02499
python
Runtime Error
s = raw_input() l = [] while 1: x = raw_input() if x == 'END_OF_TEXT': break l += x.lower().split() print l.count(w)
s = raw_input() l =[] while True: x = raw_input() if x == 'END_OF_TEXT': break l += x.lower().split() print l.count(s)
s460765867
s728579474
p02506
python
Runtime Error
s = raw_input() l =[] while True: x = raw_input() if x == 'END_OF_TEXT': break l.append(x.lower.split()) print l.count(s)
s = raw_input() l =[] while True: x = raw_input() if x == 'END_OF_TEXT': break l += x.lower().split() print l.count(s)
s111488620
s728579474
p02506
python
Runtime Error
while True: s = raw_inut() if s == '-': break n = int(raw_input()) for i in xrange(n): m = int(raw_input()) s = s[m:] + s[:m] print s
while True: s = raw_input() if s == '-': break n = int(raw_input()) for i in xrange(n): m = int(raw_input()) s = s[m:] + s[:m] print s
s452251092
s566380676
p02510
python
Runtime Error
import math a,b,C = map(float,raw_input().split()) C = C/180 + math.pi S = a*b*math.sin(C)/2.0; L = a + b + sqrt(pow(b*math.sin(C),2.0) + pow(a-b*math.cos(C),2)) h = b*math.sin(C) print "%f\n%f\n%f\n" % (S,L,h)
import math a,b,C = map(float,raw_input().split()) C = C / 180.0 * math.pi S = a * b * math.sin(C) / 2.0 L = math.sqrt(pow(b * math.sin(C), 2) + pow(a - b * math.cos(C), 2)) + a + b h = b * math.sin(C) print "%f\n%f\n%f\n" % (S,L,h)
s030491742
s495815343
p02524
python
Runtime Error
import math while Ture: n = int(raw_input()) if n==0: break sum = 0 for i in xrange(n): s = map(int,raw_input()) sum += s ave = sum/n sum = 0 for i in xnrange(n): sum += pow(s[i] - ave,2.0) print math.sqrt(sum/n)
import math while True: n = int(raw_input()) if n==0: break s = map(int,raw_input().split()) ave = sum = 0.0 for i in xrange(n): ave += s[i] ave /= n for i in xrange(n): sum += math.pow(s[i] - ave, 2.0) print math.sqrt(sum/n)
s478763756
s667380600
p02525
python
Runtime Error
import math while True: n = int(raw_input()) if n==0: break sum = 0 for i in xrange(n): s = map(int,raw_input()) sum += s ave = sum/n sum = 0 for i in xnrange(n): sum += pow(s[i] - ave,2.0) print math.sqrt(sum/n)
import math while True: n = int(raw_input()) if n==0: break s = map(int,raw_input().split()) ave = sum = 0.0 for i in xrange(n): ave += s[i] ave /= n for i in xrange(n): sum += math.pow(s[i] - ave, 2.0) print math.sqrt(sum/n)
s356614795
s667380600
p02525
python
Runtime Error
import math while True: n = int(raw_input()) if n==0: break sum = 0 for i in xrange(n): s = map(int,raw_input().split()) sum += s[i] ave = sum/n sum = 0 for i in xnrange(n): sum += pow(s[i] - ave,2.0) print math.sqrt(sum/n)
import math while True: n = int(raw_input()) if n==0: break s = map(int,raw_input().split()) ave = sum = 0.0 for i in xrange(n): ave += s[i] ave /= n for i in xrange(n): sum += math.pow(s[i] - ave, 2.0) print math.sqrt(sum/n)
s448941496
s667380600
p02525
python
Runtime Error
n = int(raw_input()) S = map(int,raw_input().split()) q = int(raw_input()) T = map(int,raw_input().split()) ans = 0 for i in T: if i in S: ans += 1 print ans
n = int(raw_input()) S = set(raw_input().split()) q = int(raw_input()) T = set(raw_input().split()) print len(S&T)
s070201383
s415653289
p02526
python
Time Limit Exceeded
n = int(raw_input()) S = set(int,raw_input().split()) q = int(raw_input()) T = set(int,raw_input().split()) print len(S&T)
n = int(raw_input()) S = set(raw_input().split()) q = int(raw_input()) T = set(raw_input().split()) print len(S&T)
s874796292
s415653289
p02526
python
Runtime Error
def partition(A, p, r): i = p - 1 for j in range(p, r + 1): if A[j][1] <= A[r][1]: i += 1 A[i], A[j] = A[j], A[i] return i def quick_sort(A, p, r): if p < r: q = partition(A, p, r) quick_sort(A, p, q - 1) quick_sort(A, q + 1, r) n = int(raw_in...
n = int(raw_input()) x = map(int,raw_input().split()) x.sort() for i in xrange(n): print x[i],
s590719831
s034960702
p02527
python
Runtime Error
def partition(A, p, r): i = p - 1 for j in range(p, r + 1): if A[j] <= A[r]: i += 1 A[i], A[j] = A[j], A[i] return i def quick_sort(A, p, r): if p < r: q = partition(A, p, r) quick_sort(A, p, q - 1) quick_sort(A, q + 1, r) n = int(raw_input())...
n = int(raw_input()) x = map(int,raw_input().split()) x.sort() for i in xrange(n): print x[i],
s781206437
s034960702
p02527
python
Runtime Error
def partition(A, p, r): i = p - 1 for j in range(p, r + 1): if A[j] <= A[r]: i += 1 A[i], A[j] = A[j], A[i] return i def quick_sort(A, p, r): if p < r: q = partition(A, p, r) quick_sort(A, p, q - 1) quick_sort(A, q + 1, r) n = int(raw_input())...
n = int(raw_input()) x = map(int,raw_input().split()) x.sort() for i in xrange(n): print x[i],
s684059783
s034960702
p02527
python
Runtime Error
import sys sys.setrecursionlimit(10000) def partition(A, p, r): i = p - 1 for j in range(p, r + 1): if A[j] <= A[r]: i += 1 A[i], A[j] = A[j], A[i] return i def quick_sort(A, p, r): if p < r: q = partition(A, p, r) quick_sort(A, p, q - 1) quic...
n = int(raw_input()) x = map(int,raw_input().split()) x.sort() for i in xrange(n): print x[i],
s455627614
s034960702
p02527
python
Time Limit Exceeded
def quick_sort2(a, i, j): if j <= i: pass else: p = a[j]; s = i for k in range(i, j): if a[k] <= p: a[s], a[k] = a[k], a[s] s += 1 a[j], a[s] = a[s], a[j] quick_sort2(a, i, s-1) quick_sort2(a, s+1, j) n = int(raw_inpu...
n = int(raw_input()) x = map(int,raw_input().split()) x.sort() for i in xrange(n): print x[i],
s306645816
s034960702
p02527
python
Runtime Error
import sys sys.setrecursionlimit(10000000) def quick_sort2(a, i, j): if j <= i: pass else: p = a[j]; s = i for k in range(i, j): if a[k] <= p: a[s], a[k] = a[k], a[s] s += 1 a[j], a[s] = a[s], a[j] quick_sort2(a, i, s-1) ...
n = int(raw_input()) x = map(int,raw_input().split()) x.sort() for i in xrange(n): print x[i],
s357462318
s034960702
p02527
python
Time Limit Exceeded
import sys sys.setrecursionlimit(1000000) def partition(A, p, r): i = p - 1 for j in range(p, r + 1): if A[j] <= A[r]: i += 1 A[i], A[j] = A[j], A[i] return i def quick_sort(A, p, r): if p < r: q = partition(A, p, r) quick_sort(A, p, q - 1) qu...
n = int(raw_input()) x = map(int,raw_input().split()) x.sort() for i in xrange(n): print x[i],
s231276806
s034960702
p02527
python
Time Limit Exceeded
def select_pivot(a, i, j): n = j - i + 1 if n < 3: return i else: b = [a[i], a[(i+j)/2], a[j]] b.sort() t = b[1] if a[i] == t: return i elif a[j] == t: return j else: return (i+j) / 2 def quick_sort2(a, i, j): ...
n = int(raw_input()) x = map(int,raw_input().split()) x.sort() for i in xrange(n): print x[i],
s221615795
s034960702
p02527
python
Runtime Error
import sys sys.setrecursionlimit(1000000) def select_pivot(a, i, j): n = j - i + 1 if n < 3: return i else: b = [a[i], a[(i+j)/2], a[j]] b.sort() t = b[1] if a[i] == t: return i elif a[j] == t: return j else: retu...
n = int(raw_input()) x = map(int,raw_input().split()) x.sort() for i in xrange(n): print x[i],
s308305760
s034960702
p02527
python
Time Limit Exceeded
def quick_sort2(a, i, j): if j <= i: pass else: p = a[j]; s = i for k in range(i, j): if a[k] <= p: a[s], a[k] = a[k], a[s] s += 1 a[j], a[s] = a[s], a[j] quick_sort(a, i, s-1) quick_sort(a, s+1, j) n = int(raw_input(...
n = int(raw_input()) x = map(int,raw_input().split()) x.sort() for i in xrange(n): print x[i],
s646222247
s898491713
p02528
python
Runtime Error
def quick_sort2(a, i, j): if j <= i: pass else: p = a[j]; s = i for k in range(i, j): if a[k] <= p: a[s], a[k] = a[k], a[s] s += 1 a[j], a[s] = a[s], a[j] quick_sort(a, i, s-1) quick_sort(a, s+1, j) n = int(raw_input(...
n = int(raw_input()) x = map(int,raw_input().split()) x.sort() for i in xrange(n): print x[i],
s611001262
s898491713
p02528
python
Runtime Error
import sys sys.setrecursionlimit(10000) def quick_sort2(a, i, j): if j <= i: pass else: p = a[j]; s = i for k in range(i, j): if a[k] <= p: a[s], a[k] = a[k], a[s] s += 1 a[j], a[s] = a[s], a[j] quick_sort(a, i, s-1) ...
n = int(raw_input()) x = map(int,raw_input().split()) x.sort() for i in xrange(n): print x[i],
s088373892
s898491713
p02528
python
Runtime Error
import sys sys.setrecursionlimit(1000000) def quick_sort2(a, i, j): if j <= i: pass else: p = a[j]; s = i for k in range(i, j): if a[k] <= p: a[s], a[k] = a[k], a[s] s += 1 a[j], a[s] = a[s], a[j] quick_sort(a, i, s-1) ...
n = int(raw_input()) x = map(int,raw_input().split()) x.sort() for i in xrange(n): print x[i],
s282375145
s898491713
p02528
python
Runtime Error
def select_pivot(a, i, j): n = j - i + 1 if n < 3: return i else: b = [a[i], a[(i+j)/2], a[j]] t = b.sort()[1] if a[i] == t: return i elif a[j] == t: return j else: return (i+j) / 2 def quick_sort2(a, i, j): if j <= i:...
n = int(raw_input()) x = map(int,raw_input().split()) x.sort() for i in xrange(n): print x[i],
s748008238
s898491713
p02528
python
Runtime Error
n = int(raw_input()) S = map(int,raw_input().split()) q = int(raw_input()) T = map(int,raw_input().split()) ans = 0 for i in q: if i in n: ans += 1 print ans
n = int(raw_input()) S = map(int,raw_input().split()) q = int(raw_input()) T = map(int,raw_input().split()) ans = 0 for i in T: if i in S: ans += 1 print ans
s046288178
s219107845
p02529
python
Runtime Error
n = int(raw_input()) S = map(int,raw_input().split()) q = int(raw_input()) T = map(int,raw_input().split()) ans = 0 for i in q: if int(i) in n: ans += 1 print ans
n = int(raw_input()) S = map(int,raw_input().split()) q = int(raw_input()) T = map(int,raw_input().split()) ans = 0 for i in T: if i in S: ans += 1 print ans
s056086876
s219107845
p02529
python
Runtime Error
n = int(raw_input()) S = map(int,raw_input().split()) q = int(raw_input()) T = map(int,raw_input().split()) ans = 0 for i in T: if i in n: ans += 1 print ans
n = int(raw_input()) S = map(int,raw_input().split()) q = int(raw_input()) T = map(int,raw_input().split()) ans = 0 for i in T: if i in S: ans += 1 print ans
s275072559
s219107845
p02529
python
Runtime Error
n = int(raw_input()) taro=hana=0 for i in xrange(n): x,y=map(str,raw_input().split()) if x == y: taro += 1 hana += 1 elif x < y: hana += 3 else taro += 3 print "%d %d\n" % (taro,hana)
n = int(raw_input()) taro=hana=0 for i in xrange(n): x,y=map(str,raw_input().split()) if x == y: taro += 1 hana += 1 elif x < y: hana += 3 else: taro += 3 print "%d %d" % (taro,hana)
s937919126
s126184165
p02530
python
Runtime Error
stack = [[] for i in xrange(int(raw_input())] while True: s = map(str,raw_input().split()) if s[0] == 'quit': break elif s[0] == 'push': stack[int(s[1])-1].append(s[2]) elif s[0] == 'pop': print stack[int(s[i])-1].pop() elif s[0] == 'move': stack[int(s[2])-1].append(stack[int(s[1])-1].pop())
n = int(raw_input()) stack = [[] for i in xrange(n)] while True: s = map(str,raw_input().split()) if s[0] == 'quit': break elif s[0] == 'push': stack[int(s[1])-1].append(s[2]) elif s[0] == 'pop': print stack[int(s[1])-1].pop() elif s[0] == 'move': stack[int(s[2])-1].append(stack[int(s[1])-1].pop())
s935454120
s535938364
p02532
python
Runtime Error
stack = [[] for i in xrange(int(raw_input())] while True: s = raw_input().split() if s[0] == 'quit': break elif s[0] == 'push': stack[int(s[1])-1].append(s[2]) elif s[0] == 'pop': print stack[int(s[i])-1].pop() elif s[0] == 'move': stack[int(s[2])-1].append(stack[int(s[1])-1].pop())
n = int(raw_input()) stack = [[] for i in xrange(n)] while True: s = map(str,raw_input().split()) if s[0] == 'quit': break elif s[0] == 'push': stack[int(s[1])-1].append(s[2]) elif s[0] == 'pop': print stack[int(s[1])-1].pop() elif s[0] == 'move': stack[int(s[2])-1].append(stack[int(s[1])-1].pop())
s962650908
s535938364
p02532
python
Runtime Error
stack = [[] for i in xrange(int(raw_input()))] while True: s = map(str,raw_input().split()) if s[0] == 'quit': break elif s[0] == 'push': stack[int(s[1])-1].append(s[2]) elif s[0] == 'pop': print stack[int(s[i])-1].pop() elif s[0] == 'move': stack[int(s[2])-1].append(stack[int(s[1])-1].pop())
n = int(raw_input()) stack = [[] for i in xrange(n)] while True: s = map(str,raw_input().split()) if s[0] == 'quit': break elif s[0] == 'push': stack[int(s[1])-1].append(s[2]) elif s[0] == 'pop': print stack[int(s[1])-1].pop() elif s[0] == 'move': stack[int(s[2])-1].append(stack[int(s[1])-1].pop())
s495184557
s535938364
p02532
python
Runtime Error
stack = [[] for i in xrange(int(raw_input()))] while True: s = raw_input().split() if s[0] == 'quit': break elif s[0] == 'push': stack[int(s[1])-1].append(s[2]) elif s[0] == 'pop': print stack[int(s[i])-1].pop() elif s[0] == 'move': stack[int(s[2])-1].append(stack[int(s[1])-1].pop())
n = int(raw_input()) stack = [[] for i in xrange(n)] while True: s = map(str,raw_input().split()) if s[0] == 'quit': break elif s[0] == 'push': stack[int(s[1])-1].append(s[2]) elif s[0] == 'pop': print stack[int(s[1])-1].pop() elif s[0] == 'move': stack[int(s[2])-1].append(stack[int(s[1])-1].pop())
s528522683
s535938364
p02532
python
Runtime Error
stack = [[] for i in xrange(int(raw_input()))] while True: s = map(str,raw_input().split()) if s[0] == 'quit': break elif s[0] == 'push': stack[int(s[1])-1].append(s[2]) elif s[0] == 'pop': print stack[int(s[i])-1].pop() elif s[0] == 'move': stack[int(s[2])-1].append(stack[int(s[1])-1].pop())
n = int(raw_input()) stack = [[] for i in xrange(n)] while True: s = map(str,raw_input().split()) if s[0] == 'quit': break elif s[0] == 'push': stack[int(s[1])-1].append(s[2]) elif s[0] == 'pop': print stack[int(s[1])-1].pop() elif s[0] == 'move': stack[int(s[2])-1].append(stack[int(s[1])-1].pop())
s043927900
s535938364
p02532
python
Runtime Error
n=int(input()) for i in range(n): a=int(input()) b=int(input()) print(a+b)
n = int(input()) for i in range(n): a = int(input()) b = int(input()) if (a + b) < (10 ** 80): print(a + b) else: print("overflow")
s546287684
s735553026
p00015
python
Runtime Error
input a; print a * a * a;
print(int(input())**3)
s109926532
s719667591
p02388
python
Runtime Error
input a print a * a * a
print(int(input())**3)
s589514956
s719667591
p02388
python
Runtime Error
input a print "%d", (a * a * a)
print(int(input())**3)
s841153682
s719667591
p02388
python
Runtime Error
input a print "%d" % (a * a * a)
print(int(input())**3)
s956586034
s719667591
p02388
python
Runtime Error
a = raw_input() print "%d"% (a * a * a)
print(int(input())**3)
s936322226
s719667591
p02388
python
Runtime Error
a = raw_input() print (a * a * a)
print(int(input())**3)
s274994447
s719667591
p02388
python
Runtime Error
a = int(raw_input()) print(a * a * a)
print(int(input())**3)
s201988297
s719667591
p02388
python
Runtime Error
print(input()**3)
print(int(input())**3)
s160526874
s719667591
p02388
python
Runtime Error
r = int(input()) pi = 3.141592653589793238 print(pi * r * r, 2 * pi * r)
r = float(input()) pi = 3.1415926535897932384626 print(pi * r * r, 2 * pi * r)
s202791088
s810260698
p02400
python
Runtime Error
# coding: utf-8 import math cnt = 0 m = 0 G = [] 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 return A def shellSor...
# coding: utf-8 import math import sys def insertionSort(a, n, g): ct = 0 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 ct += 1 a[j+g] = v return ct n = int(input()) a = list(map(int, sys...
s618205324
s728849356
p02262
python
Time Limit Exceeded
# coding: utf-8 import math import sys def insertionSort(a, n, g): ct = 0 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 ct += 1 a[j+g] = v return ct n = int(input()) a = list(map(int, sys...
# coding: utf-8 import math import sys def insertionSort(a, n, g): ct = 0 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 ct += 1 a[j+g] = v return ct n = int(input()) a = list(map(int, sys...
s716129733
s728849356
p02262
python
Runtime Error
# coding: utf-8 import sys from collections import deque #n, q = map(int, input().split()) n = int(input()) tasks = { "insert": "appendleft", "delete": "remove", "deleteFirst": "pop", "deleteLast": "popleft" } a = deque() for i in range(n): input_line = input() if input_line in tasks: ...
# coding: utf-8 import sys from collections import deque n = int(input()) task_name = ( "insert", "delete", "deleteFirst", "deleteLast", ) a = deque() for task in map(lambda x: [x] if x in task_name else x.split(), sys.stdin.readlines()): #deleteFirst,deleteLast if len(task) == 1: i...
s660773867
s771322763
p02265
python
Runtime Error
# coding: utf-8 import sys from collections import deque #n, q = map(int, input().split()) n = int(input()) tasks = { "insert": "appendleft", "delete": "remove", "deleteFirst": "popleft", "deleteLast": "pop" } a = deque() for i in range(n): input_line = input() if input_line in tasks: ...
# coding: utf-8 import sys from collections import deque n = int(input()) task_name = ( "insert", "delete", "deleteFirst", "deleteLast", ) a = deque() for task in map(lambda x: [x] if x in task_name else x.split(), sys.stdin.readlines()): #deleteFirst,deleteLast if len(task) == 1: i...
s854032058
s771322763
p02265
python
Runtime Error
# coding: utf-8 import sys from collections import deque #n, q = map(int, input().split()) n = int(input()) tasks = { "insert": "appendleft", "delete": "remove", "deleteFirst": "popleft", "deleteLast": "pop" } a = deque() for i in range(n): input_line = input() if input_line in tasks: ...
# coding: utf-8 import sys from collections import deque n = int(input()) task_name = ( "insert", "delete", "deleteFirst", "deleteLast", ) a = deque() for task in map(lambda x: [x] if x in task_name else x.split(), sys.stdin.readlines()): #deleteFirst,deleteLast if len(task) == 1: i...
s365053272
s771322763
p02265
python
Time Limit Exceeded
# coding: utf-8 import sys from collections import deque n = int(input()) task_name = ( "insert", "delete", "deleteFirst", "deleteLast" ) tasks = deque(map(lambda x: x if x in task_name else x.split(), sys.stdin.readlines())) a = deque() for task in tasks: #deleteFirst,deleteLast if len(ta...
# coding: utf-8 import sys from collections import deque n = int(input()) task_name = ( "insert", "delete", "deleteFirst", "deleteLast", ) a = deque() for task in map(lambda x: [x] if x in task_name else x.split(), sys.stdin.readlines()): #deleteFirst,deleteLast if len(task) == 1: i...
s117947924
s771322763
p02265
python
Runtime Error
import numpy as np n1 = int(input()) A = np.array(list(map(int, input().split()))) n2 = int(input()) q = list(map(int, input().split())) B = [] n = n1 for r in q: ans = "no" for i in range(2 ** n): B = np.array(list(map(int, format(i, "b").zfill(n)))[::-1]) C = A * B if sum(C) == r: ...
n1 = int(input()) A = list(map(int, input().split())) n2 = int(input()) q = list(map(int, input().split())) B = [] C = [] n = n1 ans = list("no" for i in range(n2)) for i in range(2 ** n): C0 = [] B = list(map(int, format(i, "b").zfill(n)))[::-1] C0 = [ x*y for x, y in zip(A, B)] C.append(sum(C0)) fo...
s144945841
s990420485
p02271
python
Runtime Error
n1 = int(input()) A = list(map(int, input().split())) n2 = int(input()) q = list(map(int, input().split())) B = [] n = n1 for r in q: ans = "no" for i in range(2 ** n): B = list(map(int, format(i, "b").zfill(n)))[::-1] C = [ x*y for x, y in zip(A, B)] if sum(C) == r: ans =...
n1 = int(input()) A = list(map(int, input().split())) n2 = int(input()) q = list(map(int, input().split())) B = [] C = [] n = n1 ans = list("no" for i in range(n2)) for i in range(2 ** n): C0 = [] B = list(map(int, format(i, "b").zfill(n)))[::-1] C0 = [ x*y for x, y in zip(A, B)] C.append(sum(C0)) fo...
s091069561
s990420485
p02271
python
Time Limit Exceeded
n1 = int(input()) A = list(map(int, input().split())) n2 = int(input()) q = list(map(int, input().split())) B = [] n = n1 ans = list("no" for i in range(n2)) for i in range(2 ** n): C0 = [] B = list(map(int, format(i, "b").zfill(n)))[::-1] C0 = [ x*y for x, y in zip(A, B)] C = sum(C0) for j, r in...
n1 = int(input()) A = list(map(int, input().split())) n2 = int(input()) q = list(map(int, input().split())) B = [] C = [] n = n1 ans = list("no" for i in range(n2)) for i in range(2 ** n): C0 = [] B = list(map(int, format(i, "b").zfill(n)))[::-1] C0 = [ x*y for x, y in zip(A, B)] C.append(sum(C0)) fo...
s285178413
s990420485
p02271
python
Time Limit Exceeded
n1 = int(input()) A = list(map(int, input().split())) n2 = int(input()) q = list(map(int, input().split())) B = [] n = n1 ans = list("no" for i in range(n2)) for i in range(2 ** n): C0 = [] B = list(map(int, format(i, "b").zfill(n)))[::-1] C0 = [ x*y for x, y in zip(A, B)] C.append(sum(C0)) for j, r...
n1 = int(input()) A = list(map(int, input().split())) n2 = int(input()) q = list(map(int, input().split())) B = [] C = [] n = n1 ans = list("no" for i in range(n2)) for i in range(2 ** n): C0 = [] B = list(map(int, format(i, "b").zfill(n)))[::-1] C0 = [ x*y for x, y in zip(A, B)] C.append(sum(C0)) fo...
s163357543
s990420485
p02271
python
Runtime Error
height =[] inp = "" while True: inp = input() if inp == "":break else: height.append(int(inp)) height.sort(reverse=True) for j in range(0,3): print(str(height[j]))
height =[] inp = "" for i in range(0,10): inp = input() height.append(int(inp)) height.sort(reverse=True) for i in range(0,3): print(str(height[i]))
s349403611
s940575905
p00001
python
Runtime Error
x = map(int, raw_input().split()) print(x[0]*x[1]+' '+(x[0]+x[1])*2)
a,b = map(int, input().split()) print(str(a*b)+" "+str(2*(a+b)))
s119258580
s754628715
p02389
python
Runtime Error
x = map(int, raw_input().split()) print(x[0]*x[1]+' '+(x[0]+x[1])*2)
a,b = map(int, input().split()) print(str(a*b)+" "+str(2*(a+b)))
s466309093
s754628715
p02389
python
Runtime Error
a,b = map(int, raw_input().split()) print x[0]*x[1],(x[0]+x[1])*2
a,b = map(int, input().split()) print(str(a*b)+" "+str(2*(a+b)))
s561012304
s754628715
p02389
python
Runtime Error
a,b = map(int, raw_input().split()) print(a*b,(a+b)*2)
a,b = map(int, input().split()) print(str(a*b)+" "+str(2*(a+b)))
s040713881
s754628715
p02389
python
Runtime Error
i = 0 while True: i += 1 n = input() if (n == 0): break print("Case " + str(i) + ": " + str(n))
i = 0 while True: i += 1 n = input() if (n == "0"): break print("Case " + str(i) + ": " + n)
s349413445
s957156575
p02396
python
Runtime Error
for _ in range(int(input())): ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split()) print(['NO','YES'][(by-ay)/(bx-ax)==(dy-cy)/(dx-cx)])
for _ in range(int(input())): ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split()) print(['NO','YES'][abs((ay-by)*(dx-cx)-(ax-bx)*(dy-cy))<1e-10])
s517799363
s153885370
p00021
python
Runtime Error
n=1000000 p=[1]*(n+1) p[0],p[1]=0,0 for i in range(2,int(n**0.5)+1): if p[i]: for j in range(i*i,n+1,i): p[j]=0 p=[i for i in range(n+1) if p[i]==1] while 1: try:n=int(input()) except:break i=p.index(n) print(p[i-1],p[i+1])
n=1000000 p=[1]*(n+1) p[0],p[1]=0,0 for i in range(2,int(n**0.5)+1): if p[i]: for j in range(i*i,n+1,i): p[j]=0 p=[i for i in range(n+1) if p[i]==1] while 1: try:n=int(input()) except:break for i in range(len(p)): if p[i]==n: print(p[i-1],p[i+1]) ...
s066972854
s956563885
p00044
python
Runtime Error
while 1: n,i=int(input()),0 if n==0:break n=str(math.factorial(n))[::-1] while n[i]=='0':i+=1 print(i)
import math while 1: n,i=int(input()),0 if n==0:break n=str(math.factorial(n))[::-1] while n[i]=='0':i+=1 print(i)
s549392819
s284127314
p00052
python
Runtime Error
while 1: a=[i+1 for i in range(10)] try:b=list(map(int,input().split())) except:break for i in b:a.remove(b) print('YES' if sum([1 for i in a if i<=20-sum(b[:2])])/7>=0.5 else 'NO')
while 1: a=[i+1 for i in range(10)] try:b=list(map(int,input().split())) except:break for i in b:a.remove(i) c=sum(b[:2]) print(['NO','YES'][sum([1 for i in a if c+i<=20])/7>=0.5])
s940432662
s051212928
p00060
python
Runtime Error
from math import sin,cos,pi x=[0]*100;y=[0]*100 h=1000 while 1: n=int(input()) if n==0:break a=0 for i in range(n):x[i],y[i]=map(float,input().split(',')) for i in range(n): for j in range(h): cx=x[i]+cos(2*pi*j/h) cy=y[i]+sin(2*pi*j/h) c=0 for...
import itertools x=[0.]*100;y=[0.]*100 while 1: n=int(input()) if n==0:break a=0 for i in range(n):x[i],y[i]=map(float,input().split(',')) for i,j in itertools.product(range(100),range(100)): c=0 for k in range(n): if pow(x[k]-(i/10),2)+pow(y[k]-(j/10),2)<=1.0...
s708870395
s661875314
p00090
python
Time Limit Exceeded
b=[0]*2001 for i in range(1001): for j in range(1001): b[i+j]+=1 while 1: try:n=int(input()) except:break c=0;a=[1000,n][n<1000] for i in range(2*a+1): for j in range(2*a+1): if i+j==n:c+=b[i]*b[j] print(c)
s=[0]*4001 for i in range(2001): a=a+2*(i-999)*(i-1000) if i>1000 else 0 s[i]=(i+3)*(i+2)*-~i//6-a s[4000-i]=s[i] while 1: try:print(s[int(input())]) except:break
s122486037
s839203638
p00096
python
Time Limit Exceeded