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

Fixed submission:
n = int(input())

n = n % 10

if n in (2,4,5,7,9):
    yomi = 'hon'
if n in (0,1,6,8):
    yomi = 'pon'
if n == 3:
    yomi = 'bon'

print(yomi)

Buggy submission (verdict: Runtime Error):
n = int(input())

if n in (2,4,5,7,9):
    yomi = 'hon'
if n in (0,1,6,8):
    yomi = 'pon'
if n == (3):
    yomi = 'bon'

print(yomi)

Buggy submission (verdict: Runtime Error):
n = int(input())

if n in (2,4,5,7,9):
    yomi = 'hon'
if n in (0,1,6,8):
    yomi = 'pon'
if n == (3):
    yomi = 'bon'

print(yomi)

Buggy submission (verdict: Runtime Error):
k = int(input())
s = input()

if len(s) >= k:
    s = s[0:k]

print(s)
Problem p02675 (python)

Fixed submission:
N = input()
num1 = N[-1]
if num1 == '3':
    print('bon')
elif num1 == '0' or num1 == '1' or num1 == '6' or num1 == '8':
    print('pon')
else:
    print('hon')

Buggy submission (verdict: Runtime Error):
N=int(input())
num = n[-1]
num1 = num[-1]
if num1 == '3':
    print('bon')
elif num1 == '0' or num1 == '1' or num1 == '6' or num1 == '8':
    print('pon')
else:
    print('hon')
Problem p02675 (python)

Fixed submission:
def atcoder():
    i = int(input())
    mod = i % 10
    if mod == 3:
        str="bon"
    elif mod == 0 or mod == 1 or mod == 6 or mod == 8:
        str="pon"
    else:
        str="hon"
    print(str)
atcoder()

Buggy submission (verdict: Runtime Error):
def atcoder():
    i = input()
    mod = i % 10
    if i == 3
        str="bon"
    else if i == 0 || i == 1 || i == 6 || i == 8
        str="pon"
    else 
        str="hon"
    print(str)
atcoder()
Problem p02761 (python)

Fixed submission:
n, m = map(int, input().split())
ans = [0] * n
e = []
for i in range(m):
    si, ci = map(int, input().split())
    e += [[si, ci]]
    for j in range(len(e)):
        if e[j][0] == si and e[j][1] != ci:
            print(-1)
            exit()
    if si == 1 and ci == 0 and n != 1:
        print(-1)
        exit()
    ans[si - 1] = ci
if len(ans) == 1 and ans[0] == 0:
    print(0)
    exit()
elif len(ans) != 1 and ans[0] == 0:
    ans[0] = 1
ans = map(str, ans)
print("".join(ans))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
ans = [0] * n
e = []
for i in range(m):
    si, ci = map(int, input().split())
    e += [[si, ci]]
    for j in range(len(e)):
        if e[j][0] == si and e[j][1] != ci:
            print(-1)
            exit()
    ans[si - 1] = ci
if len(ans) == 1 and ans[0] == 0:
    print(0)
    exit()
elif len(ans) != 1 and ans[0] == 0:
    ans[0] = 1
for i in range(len(e)):
    if (e[i][0] == 1 and e[i][1] == 0 ans not (len(ans) == 1)):
        print(-1)
        exit()
ans = map(str, ans)
print("".join(ans))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
ans = [0] * n
e = []
for i in range(m):
    si, ci = map(int, input().split())
    e += [[si, ci]]
    for j in range(len(e)):
        if e[j][0] == si and e[j][1] != ci:
            print(-1)
            exit()
    ans[si - 1] = ci
for i in range(n):
    if e[i][0] == 1 and e[i][1] == 0:
        print(-1)
        exit()
if len(ans) == 1 and ans[0] == 0:
    print(0)
    exit()
elif len(ans) != 1 and ans[0] == 0:
    ans[0] = 1
ans = map(str, ans)
print("".join(ans))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
ans = [0] * n
e = []
for i in range(m):
    si, ci = map(int, input().split())
    e += [[si, ci]]
    for j in range(len(e)):
        if e[j][0] == si and e[j][1] != ci:
            print(-1)
            exit()
    ans[si - 1] = ci
if len(ans) == 1 and ans[0] == 0:
    print(0)
    exit()
elif len(ans) != 1 and ans[0] == 0:
    ans[0] = 1
for i in range(n):
    if e[i][0] == 1 and e[i][1] == 0:
        print(-1)
        exit()
ans = map(str, ans)
print("".join(ans))
Problem p02952 (python)

Fixed submission:
n = list(map(int, input()))
if len(n) == 6:
        print(90909)
elif len(n) == 5:
        num = n[0] * 10000 + n[1] * 1000 + n[2] * 100 + n[3] * 10 + n[4]
        print((num - 10000) + 1 + 900 + 9)
elif len(n) == 4:
        print(909)
elif len(n) == 3:
        num = n[0] * 100 + n[1] * 10 + n[2] * 1
        print((num - 100) + 1 + 9)
elif len(n) == 2:
        print(9)
else:
        num=n[0]*1
        print(num)

Buggy submission (verdict: Runtime Error):
n = list(map(int, input()))
if len(n) == 6:
        print(90909)
elif len(n) == 5:
        num = n[0] * 10000 + n[1] * 1000 + n[2] * 100 + n[3] * 10 + n[4]
        ptint((num - 10000) + 1 + 900 + 9)
elif len(n) == 4:
        num = n[0] * 1000 + n[1] * 100 + n[2] * 10 + n[3] * 1
        print(909)
elif len(n) == 3:
        num = n[0] * 100 + n[1] * 10 + n[2] * 1
        print((num - 100) + 1 + 9)
elif len(n) == 2:
        num = n[0] * 10 + n[1] * 1
        print(9)
else:
        print(n)
Problem p02981 (python)

Fixed submission:
n,a,b=map(int,input().split())
print(min(n*a,b))

Buggy submission (verdict: Runtime Error):
n,a,b=int(input().split())
print(min(n*a,b))
Problem p02995 (python)

Fixed submission:
from fractions import gcd
a,b,c,d=map(int,input().split())
f=b//c - (a-1)//c
g=b//d - (a-1)//d
k=c*d//gcd(c,d)
h=f+g-(b//k-(a-1)//k)
print((b+1-a)-h)

Buggy submission (verdict: Runtime Error):
from math import gcd
a,b,c,d=map(int,input().split())
f=b//c - (a-1)//c
g=b//d - (a-1)//d
k=c*d//gcd(c,d)
h=f+g-(b//k-(a-1)//k)
print((b+1-a)-h)

Buggy submission (verdict: Runtime Error):
from math import gcd
a,b,c,d=map(int,input().split())
f=b//c - (a-1)//c
g=b//d - (a-1)//d
k=c*d//gcd(c,d)
h=f+g-(b//k-(a-1)//k)
print(b-a)
Problem p03006 (python)

Fixed submission:
from collections import defaultdict
n=int(input())
o=[]
for i in range(n):
    x,y=map(int,input().split())
    o.append([x,y])
o.sort()
p2=[]
q2=[]
c=[]
if n==1:
    print(1)
else:
    for i in range(n):
        for j in range(i+1,n):
            p2=o[j][0]-o[i][0]
            q2=o[j][1]-o[i][1]
            c.append(str(p2)+" "+str(q2))
    r=defaultdict(int)
    for f in c:
        r[f]+=1
    p=list(r.values())
    q=max(p)
    print(n-q)

Buggy submission (verdict: Runtime Error):
n=int(input())
o=[]
for i in range(n):
    x,y=map(int,input().split())
    o.append([x,y])
o.sort()
p2=[]
q2=[]
c=[]
if n==1:
    print(1)
else:
    for i in range(n):
        for j in range(i+1,n):
            p2=o[j][0]-o[i][0]
            q2=o[j][1]-o[i][1]
            c.append(str(p2)+" "+str(q2))
    r=defaultdict(int)
    for f in c:
        r[f]+=1
    p=list(r.values())
    q=max(p)
    print(n-q)

Buggy submission (verdict: Runtime Error):
n=int(input())
o=[]
for i in range(n):
    x,y=map(int,input().split())
    o.append([x,y])
p2=[]
q2=[]
for i in range(1,n):
    p2+=[int(o[i][0]-o[i-1][0])]
    q2+=[int(o[i][1]-o[i-1][1])]
p1=[int(s) for s in p2]
q1=[int(s) for s in q2]
p1=[abs(s) for s in p1]
q1=[abs(s) for s in q1]
p=min(map(int,p1))
q=min(map(int,q1))
ans=0
a=0
for i in range(n):
    for u in range(n):
        if i==u:
            break
        pd=o[i][0]-o[u][0]
        qd=o[i][1]-o[u][1]
        if pd==p and qd==q:
            a+=1
print(n-a)

Buggy submission (verdict: Runtime Error):
n=int(input())
o=[]
for i in range(n):
    x,y=map(int,input().split())
    o.append([x,y])
p1=[]
q1=[]
for i in range(1,n):
    p1+=[o[i][0]-o[i-1][0]]
    q1+=[o[i][1]-o[i-1][1]]
p=abs(min(map(int,p1)))
q=abs(min(map(int,q1)))
ans=0
a=0
for i in range(n):
    for u in range(n):
        if i==u:
            break
        pd=o[i][0]-o[u][0]
        qd=o[i][1]-o[u][1]
        if pd==p and qd==q:
            a+=1
print(n-a)
Problem p03030 (python)

Fixed submission:
n = int(input())
sr = []
ans = [0]*n
for _ in range(n):
    s,r = input().split()
    sr += [[str(s), int(r)]]
se = sorted(sr, key=lambda x: (x[0], -x[1]))
for i in range(n):
    ans[i] = sr.index(se[i])+1
for i in range(n):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
n = int(input())
f = []
s = []
p = []
for i in range(n):
    f += [list(map(str, input().split(" ")))]
    s += [f[i][0]]
    p += [int(f[i][1])]
print(p)
s.sort()
p.sort(reverse=True)
print(p)
ans = [0] * n
count = 0
for i in s:
    for j in p:
        if [i, str(j)] in f:
            ans[count] = f.index([i, str(j)]) + 1
            p[p.index(j)] = 0
            s[s.index(i)] = 0
            count += 1

for i in range(n):
    print(ans[i])
Problem p03071 (python)

Fixed submission:
q=list(input().split())
a=int(q[0])
b=int(q[1])
for i in range(2):
  if a>=b:
    if i==0:
      r=a
    else:
      v=a
    a=a-1
  else:
    if i==0:
      r=b
    else:
      v=b
    b=b-1
g=int(r+v)
print(g)

Buggy submission (verdict: Runtime Error):
a=list(input().split())
b=int(a[0])
c=int(a[1])
if b>c:
  print(b+(b-1))
elif c>b:
  print(c+(c-1))
elif b=c:
  print(2*b)
Problem p03085 (python)

Fixed submission:
a=input()
if a=="A":
  print("T")
elif a=="T":
  print("A")
elif a=="C":
  print("G")
else:
  print("C")

Buggy submission (verdict: Runtime Error):
a=input()
if a=="A":
  print(T)
elif a!="A":
  print(A)
elif a=="C":
  print(G)
else:
  print(C)

Buggy submission (verdict: Runtime Error):
a=input()
if a == A:
  print(T)
elif a == T:
  print(A)
elif a == C:
  print(G)
else:
  print(C)

Buggy submission (verdict: Runtime Error):
a=input()
if a==A:
  print(T)
elif a==T:
  print(A)
elif a==C:
  print(G)
else:
  print(C)

Buggy submission (verdict: Runtime Error):
a=input()
if a=A:
  print(T)
elif a=T:
  print(A)
elif a=C:
  print(G)
elif a=G:
  print(C)

Buggy submission (verdict: Runtime Error):
a=input()
if a=A:
  print(T)
elif a=T:
  print(A)
elif a=C:
  print(G)
else:
  print(C)
Problem p03101 (python)

Fixed submission:
a=list(input().split())
b=list(input().split())
c=int(a[0])
d=int(a[1])
e=int(b[0])
f=int(b[1])
g=c*d-d*e-c*f+e*f
print(g)

Buggy submission (verdict: Runtime Error):
a=list(input().split())
b=list(input(),split())
c=int(a[0])
d=int(a[1])
e=int(b[0])
f=int(b[1])
g=c*d-d*e-c*f+e*f
print(g)
Problem p03105 (python)

Fixed submission:
a=list(input().split())
b=int(a[0])
c=int(a[1])
d=int(a[2])
e=int(c/b)
if e>=d:
  print(d)
elif d>e:
  print(e)

Buggy submission (verdict: Runtime Error):
a=list(input().split())
b=a[0]
c=a[1]
d=a[2]
e=c/b
if e>d:
  print(d)
elif d>e:
  print(e)

Buggy submission (verdict: Runtime Error):
a=list(input())
b=a[0]
c=a[1]
d=a[2]
e=c/b
if e>d:
  print(d)
elif d>e:
  print(e)

Buggy submission (verdict: Runtime Error):
a=list(input())
b=a(0)
c=a(1)
d=a(2)
e=c/b
if e>d:
  print(d)
elif d>e:
  print(e)

Buggy submission (verdict: Runtime Error):
a=[input()]
b=a(0)
c=a(1)
d=a(2)
e=c/b
if e>>d:
  print(d)
elif d>>e:
  print(e)

Buggy submission (verdict: Runtime Error):
a=[input()]
b=a(0)
c=a(1)
d=a(2)
e=c/b
if e>d:
  print(d)
elif d>e:
  print(e)
Problem p03125 (python)

Fixed submission:
a=list(input().split())
b=int(a[0])
c=int(a[1])
if c%b==0:
  print(b+c)
else:
  print(c-b)

Buggy submission (verdict: Runtime Error):
a=list(input().split())
b=int(a[0])
c=int(a[1])
if a%b==0:
  print(b+c)
else:
  print(c-b)
Problem p03145 (python)

Fixed submission:
a=list(input().split())
b=int(a[0])
c=int(a[1])
d=int(c*b/2)
print(d)

Buggy submission (verdict: Runtime Error):
a,b,c=list(input().split())
A=int(a*b/2)
ptint(A)

Buggy submission (verdict: Runtime Error):
a,b,c=list(input().split())
A=int(a)*int(b)/2
ptint(A)

Buggy submission (verdict: Runtime Error):
a,b,c=list(input().split())
AB=int(a)
BC=int(b)
ptint(int(AB*BC/2))
Problem p03219 (python)

Fixed submission:
a=list(input().split())
X=int(a[0])
Y=int(a[1])
z=int(X+Y/2)
print(z)

Buggy submission (verdict: Runtime Error):
a=list(inout().split())
b=int(int(a[0])+int(a[1])/2)
print(b)

Buggy submission (verdict: Runtime Error):
a=list(inout().split())
b=int(a[0])+int(a[1])/2
print(b)
Problem p03220 (python)

Fixed submission:
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))

d = 1000000000000
ans_count = 1
for i in range(n):
    ans = t - h[i] * 0.006
    if d > abs(a - ans):
        d = abs(a-ans)
        ans_count = i+1
print(ans_count)

Buggy submission (verdict: Runtime Error):
N=int(input())
ta=list(input().split())
T=int(ta[0])
A=int(ta[1])
Hi=int(list(input().split()))
print(min(abs(A-t))for i in t=T-Hi[i]*0.006)
Problem p03239 (python)

Fixed submission:
N,T=map(int,list(input().split()))
c=1001
for i in range(N):
  ct,tc=map(int,list(input().split()))
  if T>=tc and c>=ct:
    c=ct
if c==1001:
  c="TLE"
print(c)

Buggy submission (verdict: Runtime Error):
N,T=map(int,list(input().split()))
c=1001
for i in range(N):
  ct,tc=map(int,list(input().split()))
  if T>=tc and c>=ct:
    c=ct
  if c==1001:
    c="TLE"
print(c)
Problem p03260 (python)

Fixed submission:
a=list(input().split())
b=int(a[0])
c=int(a[1])
d=int(b*c)
if d%2==1:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a=list(input().split())
b=int([0])
c=int([1])
if (b*c)%2==0:
  print("Yes")
else:
  print("No")
Problem p03308 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
print(max(a)-min(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
print(max(a)-min)
Problem p03607 (python)

Fixed submission:
n=int(input())
ans=set([])
for i in range(n):
    a=int(input())
    if a in ans:
        ans.remove(a)
    else:
        ans.add(a)
print(len(ans))

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=set([])
for i in range(n):
    a=int(input())
    if a in ans:
        ans.remove(a)
    else:
        ans.append(a)
print(len(ans))
Problem p03624 (python)

Fixed submission:
s=list(input())
a=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
d=list(set(s))
d.sort()
ans="None"
for i in range(min(len(a),len(d))):
    if d[i]!=a[i]:
        ans=a[i]
        break
    u=i
if len(d)<len(a) and ans=="None":
    ans=a[u+1]
print(ans)

Buggy submission (verdict: Runtime Error):
s=list(input())
a=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
d=list(set(s))
d.sort()
ans="None"
for i in range(max(len(a),len(d))):
    if d[i]!=a[i]:
        ans=a[i]
        break
print(ans)

Buggy submission (verdict: Runtime Error):
s=list(input())
a=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
d=list(set(s))
d.sort()
ans="None"
for i in range(len(a)):
    if d[i]!=a[i]:
        ans=a[i]
        break
print(ans)
Problem p03633 (python)

Fixed submission:
from fractions import gcd
from functools import reduce
n=int(input())
t=[int(input()) for i in range(n) ]
def lcm_sorce(x,y):
    return (x*y)//gcd(x,y)
def lcm_list(list_name):
    return reduce(lcm_sorce,list_name)
print(lcm_list(t))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
n=int(input())
t=[int(input()) for i in range(n) ]
def lcm_sorce(x,y):
    return (x*y)//math.gcd(x,y)
def lcm_list(list_name):
    return reduce(lcm_sorce,list_name)
print(lcm_list(t))

Buggy submission (verdict: Runtime Error):
n=int(input())
t=[int(input()) for i in range(n) ]
import math
from functools import reduce
def lcm_sorce(x,y):
    return (x*y)//math.gcd(x,y)
def lcm_list(list_name):
    return reduce(lcm_sorce,list_name)
print(lcm_list(t))
Problem p03635 (python)

Fixed submission:
n,m=map(int,input().split())
print((n-1)*(m-1))

Buggy submission (verdict: Runtime Error):
n.m=map(int,input().split())
print((n-1)*(m-1))
Problem p03773 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
c = a+b
if(c>=24):
  print(c-24):
else:
  print(c)

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

Fixed submission:
a,b = map(str,input().split())
if a==b:
  print("H")
else:
  print("D")

Buggy submission (verdict: Runtime Error):
a,b = map(str,input8).split()
if a==b:
  print("H")
else:
  print("D")
Problem p02885 (python)

Fixed submission:
a, b = input().split()
a = int(a)
b = int(b)
 
ans = max(a-b*2, 0)
print(ans)

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

if b * 2 >= a:
  	print(0)
else:
  	s = a - b * 2  
    print(s)
Problem p03304 (python)

Fixed submission:
n,m,d = map(int,input().split())
if(d==0):
    ans=(m-1)/n
elif(n/d<2):
    ans=2*(m-1)*(n-d)/n
else:
    ans=2*(m-1)*(n-d)/(n*n)
print(ans)

Buggy submission (verdict: Runtime Error):
n=input()
n=int(n)
m=input()
m=int(m)
d=input()
d=int(d)
if(d!=0):
    d=2
if(d==0):
    d=1
print(d*(m-1)*(n-1)/(n*n))
Problem p03447 (python)

Fixed submission:
X = int(input())
A = int(input())
B = int(input())
print((X-A)%B)

Buggy submission (verdict: Runtime Error):
A,B,C,X = [int(input()) for i in range(4)]

count = 0
for a in range(0,A+1):
    Xa  = X - 500*a
    if Xa < 0:
        break
    for b in range(0,B+1):
        Xab = Xa - 100*b
        if Xab < 0:
            break
        for c in range(0,C+1):
            if Xabc == Xab - 50*c == 0:
                count += 1
                break
                
print(count)
Problem p03448 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
for a in range(0,A+1):
    Xa  = X - 500*a
    if Xa < 0:
        break
    for b in range(0,B+1):
        Xab = Xa - 100*b
        if Xab < 0:
            break
        for c in range(0,C+1):
            Xabc = Xab - 50*c
            if Xabc == 0:
                count += 1
                break
                
print(count)

Buggy submission (verdict: Runtime Error):
A,B,C,X = [int(input()) for i in range(4)]

count = 0
for a in range(0,A+1):
    Xa  = X - 500*a
    if Xa < 0:
        break
    for b in range(0,B+1):
        Xab = Xa - 100*b
        if Xab < 0:
            break
        for c in range(0,C+1):
            if Xabc == Xab - 50*c == 0:
                count += 1
                break
                
print(count)

Buggy submission (verdict: Runtime Error):
A,B,C,X = [int(input()) for i in range(4)]

count = 0
for a in range(0,A+1):
    Xa  = X - 500*a
    if Xa < 0:
        break
    for b in range(0,B+1):
        Xab = Xa - 100*b
        if Xab < 0:
            break
        for c in range(0,C+1):
            if Xabc == Xab - 50*c == 0:
                count += 1
                break
                
print(count)
Problem p02681 (python)

Fixed submission:
S=input()
T=input()


if len(S)+1==len(T):
    for i in range(len(S)): #回数の時は絶対range()
        if S[i]==T[i]:
            a='ok'
            continue
        else:
            a='no'
            break
else:
    print('no')

if a=='ok':
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a=1
b=0
c=-1
A,B,C,K=input().split()
A=int(A)
B=int(B)
C=int(C)
K=int(K)
if K>0:
    if K>=0:
        test=a*A
        K=K-A
    if K>=0:
        test=test+b*B
        K=K-B
    if K>=0:
        test=test+c*K
else:
    test=0
print(test)
Problem p02694 (python)

Fixed submission:
import math

X=int(input())
count=0
# count=float(count)
atcor=100
atcor=int(atcor)


while True:
    
    if atcor>=X:
        print(count)
        break
    else:
        p=atcor/100
        atcor=atcor+p
        atcor=math.floor(atcor)
        count+=1

Buggy submission (verdict: Runtime Error):
import math
import numpy as np
X=int(input())
count=0
atcor=100


while True:
    if atcor==X:
        print(count)
        break
    else:
        p=atcor/100
        atcor=atcor+p
        atcor=math.floor(atcor)
        count+=1

Buggy submission (verdict: Runtime Error):
import math
X=int(input())
count=0
atcor=100
p=0.01

while True:
    if atcor==X:
        print(count)
        break
    else:
        atcor=(atcor*p)+atcor
        atcor=math.floor(atcor)
        count+=1
Problem p03280 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print((a-1)*(b-1))
Problem p03282 (python)

Fixed submission:
def ans():
  s = input()
  k = int(input())
  for i in range(k):
    if s[i] != '1':
      print(s[i])
      return
  print("1")
  return

ans()

Buggy submission (verdict: Runtime Error):
def ans():
  s = input()
  k = int(input())
  for i in range(k+1):
    if s[i] != '1':
      print(s[i])
      return
  print("1")
  return

ans()
Problem p03285 (python)

Fixed submission:
def ans():
  n = int(input())
  for a in range(n // 4 + 1):
    for b in range(n // 7+ 1):
      if 4 * a + 7 * b == n:
        print("Yes")
        return
  print("No")

ans()

Buggy submission (verdict: Runtime Error):
n = int(input())
if n > 4:
	if n % 4 == 0 or n % 7 == 0 or n % 28 == 0 or n % 11 == 0:
  		print("Yes")
    else:
      print("No")
else:
	print("No")
Problem p03415 (python)

Fixed submission:
a = list(map(str, input()))
b = list(map(str, input()))
c = list(map(str, input()))
print(a[0] + b[1] + c[2])

Buggy submission (verdict: Runtime Error):
a = map(int, input().split())
b = map(int, input().split())
c = map(int, input().split())
ans = a[0]+b[1]+c[2]
print(ans)

Buggy submission (verdict: Runtime Error):
a = map(int, input().split())
b = map(int, input().split())
c = map(int, input().split())
print(a[0]b[1]c[2])
Problem p03485 (python)

Fixed submission:
import math
a,b=map(int,input().split())
print(math.ceil((a+b)/2))

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
print(math.floar((a+b)/2))
Problem p03609 (python)

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

Buggy submission (verdict: Runtime Error):
x, t = list(map(int,input().split())
if x < t:
	print("0")
else:
	print(x-t)
Problem p03635 (python)

Fixed submission:
n,m = list(map(int, input().split()))
print((n-1) * (m-1))

Buggy submission (verdict: Runtime Error):
n,m = int(input())
print((n-1) * (m-1))
Problem p03719 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c = list(map(int, input()))
if a <= c and c <= b:
  print("Yes")
else:
  print("No")
Problem p03795 (python)

Fixed submission:
n = int(input())
print(800 * n - (n // 15) * 200)

Buggy submission (verdict: Runtime Error):
n = int(input())
print(800 * n - (n // 15) * 200

Buggy submission (verdict: Runtime Error):
n = int(input())
print(800 * n - (n // 15) * 200
Problem p03844 (python)

Fixed submission:
a,op,b = list(map(str, input().split()))
if op == "+":
  ans = int(a) + int(b)
else:
  ans = int(a) - int(b)
print(ans)

Buggy submission (verdict: Runtime Error):
a,op,b = list(map(str, input().split()))
if op == "+":
  ans = int(a) + int(b)
else:
  ans == int(a) - int(b)
print(ans)
Problem p02936 (python)

Fixed submission:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)

N, Q = map(int, input().split())

nodes = [[] for _ in range(N)]
values = [0 for _ in range(N)]

for _ in range(N-1):
  a, b = map(int, input().split())
  a, b = a-1, b-1
  nodes[a].append(b)
  nodes[b].append(a)

for _ in range(Q):
  p, x = map(int, input().split())
  p = p-1
  values[p] += x

def dfs(i, p):
  for c in nodes[i]:
    if c != p:
      values[c] += values[i]
      dfs(c, i)

dfs(0, None)
print(*values)

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

nodes = [[] for _ in range(N)]
values = [0 for _ in range(N)]

for _ in range(N-1):
  a, b = map(int, input().split())
  a, b = a-1, b-1
  nodes[a].append(b)
  nodes[b].append(a)

for _ in range(Q):
  p, x = map(int, input().split())
  p = p-1
  values[p] += x

def dfs(i, p):
  for c in nodes[i]:
    if c != p:
      values[c] += values[i]
      dfs(c, i)

dfs(0, None)
print(*values)

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

nodes = [[] for _ in range(N)]
values = [0 for _ in range(N)]

for _ in range(N-1):
  a, b = map(int, input().split())
  a, b = a-1, b-1
  nodes[a].append(b)
  nodes[b].append(a)

for _ in range(Q):
  p, x = map(int, input().split())
  p = p-1
  values[p] += x

marked = []
def dfs(i):
  marked.append(i)
  for c in nodes[i]:
    if c not in marked:
      values[c] += values[i]
      dfs(c)

dfs(0)
print(*values)