Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02945 (python)

Fixed submission:
A,B = map(int,input().split())
test1 = A+B
test2 = A-B
test3 = A*B
if test1 >= test2 and test1 >= test3:
  print(test1)
elif test2 >= test1 and test2 >= test3:
  print(test2)
elif test3 >= test1 and test3 >= test2:
  print(test3)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
test1 = A+B
test2 = A-B
test3 = A*B
if test1 >= test2 and test1 >= test3:
  print(test1)
  break
if test2 >= test1 and test2 >= test3:
  print(test2)
  break
if test3 >= test1 and test3 >= test2:
  print(test3)
  break
Problem p02946 (python)

Fixed submission:
k,x = map(int,input().split())
for i in range(x-(k-1),k+x):
  print(i,end=' ')

Buggy submission (verdict: Runtime Error):
k =int(input())
x = int(input())
for i in range(x-(k-1),k+x):
  print(i,end=" ")
Problem p02981 (python)

Fixed submission:
N, A, B = map(int, input().split())

if N * A < B:
	print(N*A)
else:
	print(B)

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())

if n * a < b:
	print(n*a)
else:
	print(b)
Problem p02971 (python)

Fixed submission:
n = int(input())
a = [int(input()) for x in range(n)]
b = sorted(a,reverse=True)
for i in range(n):
    if b[0] == a[i]:
        print(b[1])
    else:
        print(b[0])

Buggy submission (verdict: Runtime Error):
n = int(stdin.readline().rstrip())
a = [int(stdin.readline().rstrip()) for x in range(n)]
for i in range(len(a)):
    b = []
    b.append(a[:i])
    b.append(a[i+1:])
    b = [flatten for inner in b for flatten in inner]
    print(max(b))

Buggy submission (verdict: Runtime Error):
n = int(stdin.readline().rstrip())
a = [int(stdin.readline().rstrip()) for x in range(n)]
for i in range(len(a)):
    b = []
    b.append(a[:i])
    b.append(a[i+1:])
    b = [flatten for inner in b for flatten in inner]
    print(max(b))
Problem p02995 (python)

Fixed submission:
import math
import fractions
a,b,c,d = map(int, input().split())
e = a-1
less_than_e = e - (e//c) - (e//d) + (e//(c*d//fractions.gcd(c,d)))
less_than_b = b - (b//c) - (b//d) + (b//(c*d//fractions.gcd(c,d)))
if less_than_e < 0:
    less_than_e = 0
print(less_than_b - less_than_e)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())
li = list(range(a,b+1))
start1 = 0
start2 = 0
start3 = 0
for i in li:
    if i%c == 0:
        start1 = li.index(i)
        break
for j in li:
    if j%d == 0:
        start2 = li.index(j)
        break
for k in li:
    if k%(c*d)==0:
        start3 = li.index(k)
        break

print(b+1-a+len(li[start3::c*d])-len(li[start2::d])-len(li[start1::c]))
Problem p03030 (python)

Fixed submission:
n = int(input())
a = [input().split() +[i+1] for i in range(n)]
a = sorted(a ,key=lambda x:(x[0], -int(x[1])))
for i in range(len(a)):
    print(a[i][2])

Buggy submission (verdict: Runtime Error):
#炎の3段lambda
n = int(input())
li = [list(map(str, input().split())) for i in range(n)]
[li[i].append(str(i+1)) for i in range(n)]
li = sorted(li, key=lambda x:x[0])
rest = []
ans = []
for j in range(n-1):
    if li[j][0] == li[j+1][0]:
        rest.append(li[j])

    else:
        rest.append(li[j])
        ans.append(sorted(rest, key=lambda x:x[1], reverse = True))
        rest = []
rest.append(li[j+1])
ans.append(sorted(rest, key=lambda x:x[1], reverse = True))
ans = [flatten for inner in ans for flatten in inner]
for k in range(n):
    print(int(ans[k][2]))
Problem p03044 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**7)

n = int(input())
# 隣接リスト
link = [[] for i in range(n)]
for i in range(n-1):
    u, v, w = map(int, input().split())
    u -= 1
    v -= 1
    link[u].append((v,w))
    link[v].append((u,w))

ans = [-1]*n

def dfs(v, now):
    ans[v] = now

    for next_v ,w in link[v]:
        if ans[next_v] != -1:
            continue
        if w % 2:
            dfs(next_v, 1-now)
        else:
            dfs(next_v, now)

dfs(0,0)
for i in ans:
    print(i)

Buggy submission (verdict: Runtime Error):
n = int(input())
# 隣接リスト
link = [[] for i in range(n)]
for i in range(n-1):
    u, v, w = map(int, input().split())
    u -= 1
    v -= 1
    w %= 2
    link[u].append((v,w))
    link[v].append((u,w))

ans = [0]*n
visited = [False for i in range(n)]

def dfs(now, prev):

    for next,w in link[now]:
        if next != prev:
            if visited[next]:
                continue
            else:
                visited[next] = True
                ans[next] = ans[now] + w
                dfs(next, now)
dfs(0,-1)
for i in ans:
    print(i)
Problem p03061 (python)

Fixed submission:
import fractions
def gcd(x,y):
    if x < y:
        x, y = y, x
    if y == 0:
        return x

    return fractions.gcd(x%y, y)

n = int(input())
a = list(map(int, input().split()))
L = [0]
R = [0]
now1 = 0
now2 = 0
ans = 0

for i in range(n-1):
    now1 = gcd(now1,a[i])
    L.append(now1)

    now2 = gcd(now2,a[-i-1])
    R.append(now2)

for i in range(n):
    ans = max(ans, gcd(L[i], R[n-i-1]))

print(ans)

Buggy submission (verdict: Runtime Error):
def gcd(x,y):
    if y == 0:
        return x
    return gcd(x%y, y)

n = int(input())
a = list(map(int, input().split()))
L = [0]
R = [0]
now1 = 0
now2 = 0
ans = 0

for i in range(n-1):
    now1 = gcd(now1,a[i])
    L.append(now1)

    now2 = gcd(now2,a[-i-1])
    R.append(now2)

for i in range(n):
    ans = max(ans, gcd(L[i], R[n-i-1]))

print(ans)
Problem p03086 (python)

Fixed submission:
s = input()
li = ["A", "T", "G", "C"]
count = 0
ans = []
for i in range(len(s)):
    if s[i] in li:
        count += 1
    else:
        ans.append(count)
        count = 0
ans.append(count)
print(max(ans))

Buggy submission (verdict: Runtime Error):
s = input()
li = ["A", "T", "G", "C"]
count = 0
ans = []
for i in range(len(s)):
    if s[i] in li:
        count += 1
    else:
        ans.append(count)
        count = 0
print(max(ans))
Problem p03125 (python)

Fixed submission:
a,b = map(int,input().split())
if b%a :
    print(b-a)
else:
    print(a+b)

Buggy submission (verdict: Runtime Error):
a,b = map(int(input().split()))
if b%a :
    print(b-a)
else:
    print(a+b)
Problem p03260 (python)

Fixed submission:
a,b = map(int, input().split())
if a*b % 2:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
if a*b % :
    print("Yes")
else:
    print("No")
Problem p03328 (python)

Fixed submission:
a,b = map(int, input().split())
print(int(((b-a)*(b-a+1))/2) - b)

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
diff = b - a
def tower(n):
    if n < 1:
        return 0
    return n + tower(n - 1)
print(int(tower(diff) - b))

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
diff = b - a
def tower(n):
    if n < 1:
        return 0
    return n + tower(n - 1)
print(tower(diff) - b)

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
diff = b - a - 1
def tower(n):
    if n < 1:
        return 0
    return n + tower(n - 1)
print(tower(diff) - a)
Problem p03338 (python)

Fixed submission:
n = int(input())
s = list(input())
li = []
for i in range(1,n-1):
    li.append(len(set(s[:i+1]) & set(s[i+1:])))
print(0 if len(li) == 0 else max(li))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input())
li = []
for i in range(1,n-1):
    li.append(len(set(s[:i+1]) & set(s[i+1:])))
print(max(li))
Problem p03352 (python)

Fixed submission:
x = int(input())
if x == 1:
    print(1)
    exit()
li = list(range(2,x+1))
ans = [1]
n = 2
while li[0]**n < x:
    for i in range(x-1):
        if li[i]**n > x:
            ans.append(li[i-1]**n)
            break
    n += 1
print(max(ans))

Buggy submission (verdict: Runtime Error):
x = int(input())
li = list(range(2,x+1))
ans = [1]
n = 2
while li[0]**n < x:
    for i in range(x-1):
        if li[i]**n > x:
            ans.append(li[i-1]**n)
            break
    n += 1
print(max(ans))
Problem p03361 (python)

Fixed submission:
h,w = map(int, input().split())
s = [list(input()) for i in range(h)]
dx = [0,1,0,-1]
dy = [1,0,-1,0]

for x in range(h):
    for y in range(w):
        if s[x][y] == "#":
            flag = False

            for i in range(4):
                nx = x + dx[i]
                ny = y + dy[i]

                if 0 <= nx < h and 0 <= ny < w and s[nx][ny] == "#":
                    flag = True

            if not flag:
                print("No")
                exit()

print("Yes")

Buggy submission (verdict: Runtime Error):
h,w = map(int, input().split())
s = [list(input()) for i in range(w)]
dx = [0,1,0,-1]
dy = [1,0,-1,0]

for x in range(h):
    for y in range(w):
        if s[x][y] == "#":
            flag = False

            for i in range(4):
                nx = x + dx[i]
                ny = y + dy[i]
                if 0 <= nx < h and 0 <= ny < w and s[nx][ny] == "#":
                    flag = True

            if not flag:
                print("No")
                exit()

print("Yes")
Problem p03386 (python)

Fixed submission:
a,b,k = map(int,input().split())
if (b-a+1) <= 2*k:
    for k in range(a,b+1):
        print(k)
else:
    for i in range(a,a+k):
        print(i)
    for j in range(b-k+1,b+1):
        print(j)

Buggy submission (verdict: Runtime Error):
a,b,k = map(int, input().split())
li = list(range(a,b+1))
li_low = li[:k]
li_high = li[-k:]
li_ans = sorted(list(set(li_low + li_high)))
for i in range(len(li_ans)):
    print(li_ans[i])

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
li = list(range(a,b+1))
list_ = li[:k] + li[len(li)-k:]
list_ = sorted(list(set(list_)))
for i in range(len(list_)):
    print(list_[i])
Problem p03407 (python)

Fixed submission:
a,b,c = map(int, input().split())
if a+b >= c:
    print("Yes")
if a+b < c:
    print("No")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
if a+b>=c:
    print("Yes")
if a+b < c
    print("NO")
Problem p03433 (python)

Fixed submission:
n = int(input())
a = int(input())
if n<a:
    print("Yes")
    exit()
if n % 500 <= a:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
if n<a:
    print("Yes")
    exit()
if (n-a)%500:
    print("No")
else:
    print("Yes")
Problem p03455 (python)

Fixed submission:
from sys import stdin

a, b = [int(x) for x in stdin.readline().rstrip().split()]
ab = a * b

if ab % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
from sys import stdin

a, b = stdin.readline().rstrip().split()
ab = a * b

if ab % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
a, b = int(input())
ab = a * b

if ab % 2 == 0:
    print("Even")
else:
    print("Odd")
Problem p03472 (python)

Fixed submission:
import heapq

n,h = map(int, input().split())
cut = 0
throw = []
heapq.heapify(throw)

for i in range(n):
	a,b = map(int, input().split())	
	cut = max(cut, a)
	heapq.heappush(throw, -(b))

ans = 0
for i in range(n):
	num = heapq.heappop(throw)*(-1)
	if num > cut:
		 h -= num
		 ans += 1
		 if h <= 0:
			 print(ans)
			 exit()
	else:
		ans += (-(-h // cut))
		print(ans)
		exit()	
		
ans += (-(-h // cut))
print(ans)

Buggy submission (verdict: Runtime Error):
n,h = map(int, input().split())
li = []
cut = 0
for i in range(n):
	a, b = map(int, input().split())
	cut = max(a, cut)
	li.append(b)
li = sorted(li, reverse = True)
ans = 0

for b in li:
	if b > cut:
		h -= b
		ans += 1
		if h < 0:
			print(ans)
			exit()
	else:
		break
ans += (-(-h//cut))
print(ans)		n,h = map(int, input().split())
li = []
cut = 0
for i in range(n):
	a, b = map(int, input().split())
	cut = max(a, cut)
	li.append(b)
li = sorted(li, reverse = True)
ans = 0

for b in li:
	if b > cut:
		h -= b
		ans += 1
		if h < 0:
			print(ans)
			exit()
	else:
		ans += (-(-h // cut))
		print(ans)
		exit()	
		
ans += (-(-h//cut))
print(ans)
Problem p03544 (python)

Fixed submission:
n = int(input())
li = [2,1]
for i in range(n+1):
    if i == 0:
        continue
    elif i == 1:
        continue
    else:
        li.append(li[i-2] + li[i-1])
print(li[n])

Buggy submission (verdict: Runtime Error):
def ryuka(n):
    if n == 0:
        return 2
    elif n == 1:
        return 1

    return ryuka(n-1) + ryuka(n-2)
print(ryuka(n))
Problem p03573 (python)

Fixed submission:
li = list(map(int, input().split()))
if li.count(li[0]) == 1:
    print(li[0])
if li.count(li[1]) == 1:
    print(li[1])
if li.count(li[2]) == 1:
    print(li[2])

Buggy submission (verdict: Runtime Error):
li = set(list(map(int, input().split())))
print(li[0])
Problem p03574 (python)

Fixed submission:
h,w = map(int, input().split())
s = [list(input().replace(".","0")) for i in range(h)]
x = [1,1,0,-1,-1,-1,0,1]
y = [0,1,1,1,0,-1,-1,-1]

for i in range(h):
    for j in range(w):
        if s[i][j] == "0":
            for k in range(8):
                if 0 <= j+y[k] < w and 0 <= i+x[k] < h and s[i+x[k]][j+y[k]] == "#":
                    s[i][j] = str(int(s[i][j])+1)
                    
for i in range(h):
    print("".join(s[i]))

Buggy submission (verdict: Runtime Error):
for i in range(h):
    for j in range(w):
        if s[i][j] == "0":
            for k in range(8):
                if 0 <= j+y[k] < w and 0 <= i+x[k] < h and s[i+x[k]][j+y[k]] == "#":
                    s[i][j] = str(int(s[i][j])+1)
                    
for i in range(h):
    print("".join(s[i]))
Problem p03609 (python)

Fixed submission:
x,t = map(int, input().split())
if x >= t:
    print(x-t)
if x < t:
    print(0)

Buggy submission (verdict: Runtime Error):
x,t = map(int, input())
if x >= t:
    print(x-t)
if x < t:
    print(0)
Problem p03657 (python)

Fixed submission:
a,b = map(int, input().split())
if a % 3 ==0 or b % 3 == 0 or (a+b) % 3 == 0 :
    print("Possible")
else:
    print("Impossible")

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
if (a+b) % :
    print("Impossible")
else:
    print("Possible")
Problem p03679 (python)

Fixed submission:
x,a,b = map(int, input().split())

if a >= b:
    print("delicious")
if a < b and abs(a-b) <= x:
    print("safe")
if a < b and abs(a-b) > x:
    print("dangerous")

Buggy submission (verdict: Runtime Error):
x,a,b = map(int, input().split())

if a > b:
    print("delicious")
    exit()
if a < b and abs(a-b) <= x:
    print("safe")
if aa < b and abs(a-b) > x:
    print("dangerous")
Problem p03680 (python)

Fixed submission:
n=int(input())
a=[int(input()) for i in range(n)]

c,s=1,a[0]

while s!=2 and c<n:
    c,s=c+1,a[s-1]

print(c if c<n else -1)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]
on = 1
count = 0
on_li = [1]
while True:
    on = a[on-1]
    if on in on_li:
        print(-1)
        exit()
    on_li.append(on)
    print(on_li)
    count += 1
    if on == 2:
        print(count)
        exit()
Problem p03695 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
li = [0]*15
tourist = 0

for i in a:
    if i // 400 >= 8:
        tourist += 1

    if li[i//400] == 0:
        li[i//400] = 1

maxrate = sum(li[:8]) + tourist

minrate = 0

if sum(li[:8]) == 0:
    minrate = 1
else:
    minrate = sum(li[:8])

print(minrate, maxrate)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
li = [0]*9
tourist = 0

for i in a:
    if i // 400 == 8:
        tourist += 1

    if li[i//400] == 0:
        li[i//400] = 1

minrate = sum(li[:8])
maxrate = 0
if minrate + tourist > 8:
    maxrate = 8
else:
    maxrate = minrate + tourist

print(minrate, maxrate)
Problem p03759 (python)

Fixed submission:
a,b,c = map(int, input().split())
if b-a == c-b:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
if b-a = c-b:
    print("YES")
else:
    print("NO")
Problem p04029 (python)

Fixed submission:
n = int(input())
print(int(n*(n+1)/2))

Buggy submission (verdict: Runtime Error):
n = int(input())
print(n(n+1)/2)
Problem p04030 (python)

Fixed submission:
s = input()

a = ''
for x in s:
    if x == '0':
        a += '0'
    elif x == '1':
        a += '1'
    else:
        if a != '':
            #a = list(a)
            a = a[:-1]

print(a)

Buggy submission (verdict: Runtime Error):
 = list(input())
str = ""
for i in range(len(s)):
    if s[i] == "0":
        str += "0"
    if s[i] == "1":
        str += "1"
        print(str)
    if s[i] == "B":
        if str == "":
            continue
        else:
            str = str[:-1]
print(str)

Buggy submission (verdict: Runtime Error):
 = list(input())
str = ""
for i in range(len(s)):
    if s[i] == "0":
        str += "0"
    if s[i] == "1":
        str += "1"
        print(str)
    if s[i] == "B":
        if str == "":
            continue
        else:
            str = str[:-1]
print(str)
Problem p04043 (python)

Fixed submission:
if input().split().count('5') == 2:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
li = input().split().remove('5')
if '7' in li:
    print('YES')
else:
    print('NO')
Problem p02911 (python)

Fixed submission:
n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
lena = len(a)
p = [k-lena for i in range(n)]
for i in a:
  p[i-1] += 1
for i in p:
  if i > 0:
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
import numpy as np

n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
p = np.array([k for i in range(n)])
for i in a:
  p = p - 1 
  p[i-1] += 1
for i in p:
  if i > 0:
    print('Yes')
  else:
    print('No')
Problem p03543 (python)

Fixed submission:
a,b,c,d=input()
print('Yes' if a==b==c or b==c==d else 'No')

Buggy submission (verdict: Runtime Error):
i=input()
if((i[0]==i[1]&&i[1]==i[2])||(i[1]==i[2]&&i[2]==i[3])):
	print('Yes')
else:
  	print('No')
Problem p02972 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=[0 for i in range(n)]
c=0
d=[]
for i in range(n-1,-1,-1):
  j=2
  c=b[i]
  while((i+1)*j<=n):
    c=c^b[(i+1)*j-1]
    j+=1
  if (c!=a[i]):
    b[i]=1
  c=0
  j=2
print('{0}'.format(sum(b)))
for i in range(n):
  if(b[i]==1):
    d.append(i+1)
e=list(map(str,d))
f=' '.join(e)
print('{0}'.format(f))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=[0 for i in range(n)]
c=0
d=[]
for i in range(n-1,-1,-1):
  j=2
  c=b[i]
  while((i+1)*j<=n):
    c=c^b[(i+1)*j-1]
    j+=1
  if (c!=a[i]):
    b[i]=1
  c=0
  j=2
print('{0}'.format(sum(b)))
e=list(map(str,b))
for i in range(n):
  if(b[i]==1):
    d.append(i+1)
f=' '.join(d)
print('{0}'.format(f))
Problem p02975 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a.sort()
b=int(n/3)
if(a[0]==a[n-1] and a[0]==0):
    print('Yes')
elif(n%3!=0):
    print('No')
elif(a[0]==a[b-1] and a[b-1]!=a[b] and a[b]==a[n-1]):
    if(a[0]^a[n-1]^a[n-1]==0):
        print('Yes')
    else:
        print('No')
elif(a[0]==a[2*b-1] and a[2*b-1]!=a[2*b] and a[2*b]==a[n-1]):
    if(a[0]^a[0]^a[n-1]==0):
        print('Yes')
    else:
        print('No')
else:
    if(a[0] == a[b-1] and a[b-1] != a[b]):
        if(a[b]==a[2*b-1] and a[2*b-1]!=a[2*b]):
            if(a[2*b]==a[n-1]):
                if(a[0]^a[b]^a[n-1]==0):
                    print('Yes')
                else:
                    print('No')
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a.sort()
b=int(n/3)
if(a[0]==a[n-1] and a[0]==0):
    print('Yes')
elif(n%3!=0):
    print('No')
elif(a[0]==a[b-1] and a[b-1]!=a[b] and a[b]==a[n-1]):
    if(a[0]^a[n-1]^a[n-1]==0):
        print('Yes')
    else:
        print('No')
elif(a[0]==a[2*b-1] and a[2*b-1]!=a[2*b] and a[2*b]==a[n-1]):
    if(a[0]^a[0]^a[n-1]==0):
        print('Yes'):
    else:
        print('No')
else:
    if(a[0] == a[b-1] and a[b-1] != a[b]):
        if(a[b]==a[2*b-1] and a[2*b-1]!=a[2*b]):
            if(a[2*b]==a[n-1]):
                if(a[0]^a[b]^a[n-1]==0):
                    print('Yes')
                else:
                    print('No')
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')
Problem p02981 (python)

Fixed submission:
n,a,b=map(int,input().split())
print('{0}'.format(min(b,n*a)))

Buggy submission (verdict: Runtime Error):
n,d=map(int,input().split())
x=[]
for i in range(n):
    a=list(map(int,input().split()))
    x.append(a)
import math
c=0
d=0
e=0
for j in range (n-1):
    for k in range(j+1,n):
        for m in range(d):
            d+=float((x[j][m]-x[k][m])*(x[j][m]-x[k][m]))
        c=float(math.sqrt(d))
        if(c.is_integer()=1):
            e+=1
        d=0
print('{0}'.format(e))
Problem p02993 (python)

Fixed submission:
s=str(input())
c=0
for i in range(3):
  if(s[i]==s[i+1]):
    c=1
    break
if(c==0):
  print('Good')
else:
  print('Bad')

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[]
b=[]
gap=0
e=0
f=0
m=0
for i in range(n):
    c,d=map(int,input().split())
    a.append(c)
    b.append(d)
while (gap<=n/9):
    gap=gap*3+1
while (gap>0):
    for i in range(gap,n):
        key=b[i]
        l=a[i]
        if(key<b[i-gap]):
            j=i
            while True:
                b[j]=b[j-gap]
                a[j]=a[j-gap]
                j-=gap
                if(j<gap or key>=b[j-gap]):
                    break
            b[j]=key
            a[j]=l
        gap=int((gap-1)/3)
for i in range(n):
    e+=a[i]
    if(e>b[i]):
        m=1
if(m==1):
    print('No')
else:
    print('Yes')
Problem p03473 (python)

Fixed submission:
M=int(input())
print(24+(24-M))

Buggy submission (verdict: Runtime Error):
M=input(int())
print(24+(24-M))

Buggy submission (verdict: Runtime Error):
n=input()
print(48-n)