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

Fixed submission:
a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))
a3 = list(map(int,input().split()))

N=int(input())
for i in range(N):
  b=int(input())
  if(a1[0]==b):
    a1[0]=0
  if(a1[1]==b):
    a1[1]=0
  if(a1[2]==b):
    a1[2]=0
  if(a2[0]==b):
    a2[0]=0
  if(a2[1]==b):
    a2[1]=0
  if(a2[2]==b):
    a2[2]=0
  if(a3[0]==b):
    a3[0]=0
  if(a3[1]==b):
    a3[1]=0
  if(a3[2]==b):
    a3[2]=0                                   
l1=[a1[0],a2[0],a3[0]]
l2=[a1[1],a2[1],a3[1]]
l3=[a1[2],a2[2],a3[2]]
l4=[a1[0],a1[1],a1[2]]
l5=[a2[0],a2[1],a2[2]]
l6=[a3[0],a3[1],a3[2]]
l7=[a1[0],a2[1],a3[2]]
l8=[a1[2],a2[1],a3[0]]
if(sum(l1)==0 or sum(l2)==0 or sum(l3)==0 or sum(l4)==0 or sum(l5)==0 or sum(l6)==0 or sum(l7)==0 or sum(l8)==0):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))
a3 = list(map(int,input().split()))

l1=[a1[0],a2[0],a3[0]]
l2=[a1[1],a2[1],a3[1]]
l3=[a1[2],a2[2],a3[2]]
l4=[a1[0],a1[1],a1[2]]
l5=[a2[0],a2[1],a2[2]]
l6=[a3[0],a3[1],a3[2]]
l7=[a1[0],a2[1],a3[2]]
l8=[a1[2],a2[1],a3[0]]

N=int(input())
for i in range(N):
  b=int(input())
  try:
    a1.remove(b)
  else:
    pass
  try:
    a2.remove(b)
  else:
    pass
  try:
    a3.remove(b)
  else:
    pass
if(sum(l1)==0 or sum(l2)==0 or sum(l3)==0 or sum(l4)==0 or sum(l5)==0 or sum(l6)==0 or sum(l7)==0 or sum(l1)==8):
  print("Yes")
else:
  print("No")
Problem p02761 (python)

Fixed submission:
n,m=map(int,input().split(" "))
g=[]
t=[]
sac=0
op=0
for i in range(n):
  g.append("0")
  t.append("")
for j in range(m):
  s,c=map(int,input().split(" "))
  if(g[s-1]!=str(c) and t[s-1]==""):
    g[s-1]=str(c)
    t[s-1]="T"
  if(g[s-1]!=str(c) and t[s-1]!=""):
    sac=1
  if(s==1 and c==0):
    sac=1
    op=1
if(t[0]=="" and len(g)!=1 and sac==0):
  g[0]="1"
if(op==1):
  sac=0
str_g = "".join(g)

if(sac==0 and g[0]!="0"):
  print(str_g)

elif(sac==0 and len(g)==1):
  print("0")
else:
  print("-1")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split(" "))
g=[]
t=[]
sac=0
for i in range(n):
  g.append("0")
  t.append("")
for j in range(m):
  s,c=map(int,input().split(" "))
  if(g[s-1]!=str(c) and t[s-1]==""):
    g[s-1]=str(c)
    t[s-1]="T"
  if(g[s-1]!=str(c) and t[s-1]!=""):
    sac=1
  if(s==1 and c==0):
    sac=1
    op=1
if(t[0]=="" and len(g)!=1 and sac==0):
  g[0]="1"
if(op==1):
  sac=0
str_g = "".join(g)

if(sac==0 and g[0]!="0"):
  print(str_g)

elif(sac==0 and len(g)==1):
  print("0")
else:
  print("-1")
Problem p02767 (python)

Fixed submission:
N =int(input())
X = list(map(int,input().split()))
X.sort()
tans=[]
try:
  for i in range(1,X[N-1]+1):
    P=i
    ans=0
    for j in range(N):
      ans+=(X[j]-P)**2
    tans.append(ans)
  print(min(tans))
except:
  print(0)

Buggy submission (verdict: Runtime Error):
N =int(input())
X = list(map(int,input().split()))
X.sort()
tans=[]
for i in range(1,X[N-1]):
  P=i
  ans=0
  for j in range(N):
    ans+=(X[j]-P)**2
  tans.append(ans)
print(min(tans))
Problem p02768 (python)

Fixed submission:
from functools import reduce
def cmb(r):
    numerator = reduce(lambda x, y: x * y % mod, [n - r + k + 1 for k in range(r)])
    denominator = reduce(lambda x, y: x * y % mod, [k + 1 for k in range(r)])
    return numerator * pow(denominator, mod - 2, mod) % mod
n,a,b = map(int,(input().split()))
ans=0
mod=10**9+7

ans=pow(2,n,10**9+7)-1
ans-=cmb(a)
ans-=cmb(b)
print(ans%mod)

Buggy submission (verdict: Runtime Error):
from functools import reduce
def cmb(n,r):
    numerator = reduce(lambda x, y: x * y % mod, [n - r + k + 1 for k in range(r)])
    denominator = reduce(lambda x, y: x * y % mod, [k + 1 for k in range(r)])
    return numerator * pow(denominator, mod - 2, mod) % mod

ans=0
n,a,b = map(int,(input().split()))

# ans=imp_pow(2,n)-1
ans=pow(2,c,10**9+7)-1
ans-=cmb(n,a)
ans-=cmb(n,b)
print(ans%10**9+7)

Buggy submission (verdict: Runtime Error):
from functools import reduce
def cmb(n,r):
    numerator = reduce(lambda x, y: x * y % mod, [n - r + k + 1 for k in range(r)])
    denominator = reduce(lambda x, y: x * y % mod, [k + 1 for k in range(r)])
    return numerator * pow(denominator, mod - 2, mod) % mod

ans=0
c,a,b = map(int,(input().split()))

# ans=imp_pow(2,n)-1
ans=pow(2,c,10**9+7)-1
ans-=cmb(c,a)
ans-=cmb(c,b)
print(ans%10**9+7)
Problem p02818 (python)

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

if a >= k:
  a -= k
  print(str(a)+" "+str(b))

elif a< k and a+b >=k:
  b -= (k-a)
  a = 0
  print(str(a)+" "+str(b))

else:
  a = 0
  b = 0
  print(str(a)+" "+str(b))

Buggy submission (verdict: Runtime Error):

if a >= k:
  a -= k
  print(str(a)+" "+str(b))

elif a< k and a+b >=k:
  b -= (k-a)
  a = 0
  print(str(a)+" "+str(b))

else:
  a = 0
  b = 0
  print(str(a)+" "+str(b))
Problem p02911 (python)

Fixed submission:
import sys

def happyo(n,each_point):
  for x in range(n):
    if (each_point[x] < 1):
      print("No")
    else:
      print("Yes")

inp1 = input()
n = int(inp1.split(" ")[0])
k = int(inp1.split(" ")[1])
q = int(inp1.split(" ")[2])

if(k>100000):
  for x in range(n):
    print("Yes")
  sys.exit()

each_point = []
for i in range(n):
  each_point.append(k-q)
 

for j in range(q):
  ans = int(input())
  each_point[ans-1] += 1
 
happyo(n,each_point)

Buggy submission (verdict: Runtime Error):
# inp1 = input()
# n = int(inp1.split(" ")[0])
# k = int(inp1.split(" ")[1])
# q = int(inp1.split(" ")[2])

n,k,p = map(int, input().split())
each_point = []
for i in range(n):
  each_point.append(k-q)
 
for j in range(q):
  each_point[int(input())-1] += 1
 
for x in range(n):
  if (each_point[x] < 1):
    print("No")
  else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
inp1 = input()
n = int(inp1.split(" ")[0])
k = int(inp1.split(" ")[1])
q = int(inp1.split(" ")[2])

each_point = []
for i in range(n):
  each_point.append(k)


for j in range(q):
  ans = int(input())
  for m in range(n):
    int_point[m] -= 1
  int_point[ans-1] += 1

for x in range(n):
  if (int_point[x] < 1):
    print("No")
  else:
    print("Yes")
Problem p02953 (python)

Fixed submission:
n = int(input())
h = input()
str_list = []
ans = "Yes"
str_list = h.split(" ")

for j in range (len(str_list)-1):

  if(int(str_list[j]) < int(str_list[j+1])):
    str_list[j+1] = str(int(str_list[j+1])-1)
  elif(int(str_list[j]) > int(str_list[j+1])):
    ans = "No"
    break

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = input()
str_list = []
ans = "Yes"
for i in range(len(h)):
  if(i % 2 == 0):
    str_list += h[i]

for j in range (len(str_list)-1):
  if(int(str_list[j]) > int(str_list[j]) + 1):
    str_list[j] = str(int(str_list[j])-1)
  if(int(str_list[j]) > int(str_list[j]) + 1):
    ans = "No"
    break

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = input()
str_list = []
ans = "YES"
for i in range(len(h)):
  if(i % 2 == 0):
    str_list += h[i]

for j in range (len(str_list)-1):
  if(int(str_list[j]) > int(str_list[j]) + 1):
    str_list[j] = str(int(str_list[j])-1)
  if(int(str_list[j]) > int(str_list[j]) + 1):
    ans = "NO"
    break

print(ans)
Problem p02995 (python)

Fixed submission:
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

a,b,c,d = map(int,input().split())
count = 0
i = b//c - a//c 
if(a%c == 0):
  i += 1
j = b//d - a//d
if(a%d == 0):
  j += 1
k = b//lcm(c,d) - a//lcm(c,d)
if(a%lcm(c,d) == 0):
  k += 1

print(b-a+1-(i+j-k))

Buggy submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)


a,b,c,d = map(int,input().split())
count = 0
i = b//c - a//c 
if(a%c == 0):
  i += 1
j = b//d - a//d
if(a%d == 0):
  j += 1
k = b//lcm(c,d) - a//lcm(c,d)

print(b-a+1-(i+j-k))
Problem p03353 (python)

Fixed submission:
# coding: utf-8

s = input()
K = int(input())

n = len(s)

# sにでてくる英小文字1文字ごとをUTF-8コードのリストで管理する
pos = [[] for __ in range(256)]
for i in range(n):
    pos[ord(s[i])].append(i)

strset = set()
for c in range(ord('a'), ord('z')+1):
    for i in pos[c]:
        for j in range(K):
            strset.add(s[i:i+j+1])

    # 最初の1文字が最も若い英小文字で始まるすべての部分文字列がK以上なら、それより後ろになる文字列は調べなくて良い
    if len(strset) > K:
        break


strlist = list(strset)
strlist.sort()
print(strlist[K-1])

Buggy submission (verdict: Runtime Error):
# coding : utf-8

s = input()
K = int(input())

strlist = sorted(range(len(s)), key=lambda k :list(s)[k], reverse=False)
s_len = len(s)
strset = set(s[strlist[0]])

calcEnd = False
for i in range(len(s)):
    #for j in range(i+1, len(s)+1):
    j_index = min(i+1, len(s) -1)
    for j in range(strlist[j_index], len(s)):
        #strset.add(s[i:j])
        strset.add(s[strlist[i]:j])

    if s[strlist[i+1]] != s[strlist[i]]:
        if len(strset) >= K:
            calcEnd = True
            break

    if calcEnd:
        break


strsetsort = sorted(strset, reverse=False)
ans = strsetsort[K-1]
print(ans)

Buggy submission (verdict: Runtime Error):
# coding : utf-8

s = input()
K = int(input())

strlist = sorted(range(len(s)), key=lambda k :list(s)[k], reverse=False)
s_len = len(s)
strset = set(s[strlist[0]])

calcEnd = False
for i in range(len(s)):
    #for j in range(i+1, len(s)+1):
    for j in range(strlist[i+1], len(s)+1):
        #strset.add(s[i:j])
        strset.add(s[strlist[i]:j])

    if s[strlist[i+1]] != s[strlist[i]]:
        if len(strset) >= K:
            calcEnd = True
            break

    if calcEnd:
        break


strsetsort = sorted(strset, reverse=False)
ans = strsetsort[K-1]
print(ans)
Problem p02606 (python)

Fixed submission:

l,r,d=map(int,input().split())
i=1
j=0
result=0
while result<=r:
  if result>=l:
    j +=1
  result=d*i
  i+=1
print(j)

Buggy submission (verdict: Runtime Error):
a=input()
b=map(int,input().split())
c=list(b)
i=0
j=1

for k in c:
  if j%2==1 and int(k)%2==1:
    i +=1
  j +=1
print(i)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,input()split())
c=a*b
print(c)
Problem p02783 (python)

Fixed submission:
h,a=map(int,input().split())
count=0
while h>0:
  h=h-a
  count=count+1
print(count)

Buggy submission (verdict: Runtime Error):
h,a=map(int,input().split())
count=0
while h>:
  h=h-a
  count=count+1
print(count)
Problem p03029 (python)

Fixed submission:
a,p=map(int,input().split())
result=(p+(a*3)) // 2
print(result)

Buggy submission (verdict: Runtime Error):
a,p=map(int,input().split())
s=a*3
reuslt=(p+s)//2

print(result)
Problem p02645 (python)

Fixed submission:
S = input()
print(S[:3])

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
 
base_list = [0] * N
 
for l in range(K):
 
    list_copy = A.copy()
    A = base_list.copy()
 
    for i, j in enumerate(list_copy, 1):
        if i - j >= 1:
            low = i - j
        else:
            low = 1
        if i + j <= N:
            high = i + j
        else:
            high = N
        for k in range(low - 1, high):
                A[k] += 1
            
        if A == list_copy:
          break
 
ans = map(str, A)
ans = " ".join(ans)
 
print(ans)
Problem p03545 (python)

Fixed submission:
a, b, c, d = input()
op_cnt = 3

for i in range(2 ** op_cnt):
    op = ["-"] * op_cnt
    for j in range(op_cnt):
        if (i >> j) & 1:
            op[j] = "+"
    if eval(a + op[0] + b + op[1] + c + op[2] + d) ==7:
        print(a + op[0] + b + op[1] + c + op[2] + d + "=7")
        break

Buggy submission (verdict: Runtime Error):
n = [int(i) for i in input()]
op_cnt = len(n) - 1

for i in range(2 ** op_cnt):
    op = ["-"] * op_cnt
    for j in range(op_cnt):
        if ((i >> j) & 1):
            op[op_cnt - 1 - j] = "+"

    formula = ""
    for p_n, p_o in zip(n, op + [""]):
        formula += (p_n + p_o)
    if eval(formula) == 7:
        print(formula + "=7")
        break

Buggy submission (verdict: Runtime Error):
n = [int(i) for i in input()]
op_cnt = len(n) - 1

for i in range(2 ** op_cnt):
    op = ["-"] * op_cnt
    for j in range(op_cnt):
        if ((i >> j) & 1):
            op[op_cnt - 1 - j] = "+"

    formula = ""
    for p_n, p_o in zip(n, op + [""]):
        formula += (p_n + p_o)
    if eval(formula) == 7:
        print(formula + "=7")
        break
Problem p03636 (python)

Fixed submission:
voca = input()

a = len(voca) - 2

output = voca[0] + str(a) + voca[-1]
 
print(output)

Buggy submission (verdict: Runtime Error):
voca = input()

output = vaca[0] + str(len(vaca) - 2) + vaca[-1]

print(output)
Problem p03693 (python)

Fixed submission:
r, g, b = map(int, input().split())
 
number = r * 100 + g * 10 + b
 
if number % 4 == 0:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
r, g, b = map(int, input().split)
 
number = r * 100 + g * 10 + b
 
if number % 4 == 0:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
r, g, b = map(int, input().split)
 
number = r * 100 + g * 10 + b
 
if number % 4 == 0:
  print("YES")
 
else:
  print("NO")

Buggy submission (verdict: Runtime Error):

r, g, b = map(int, input().split)

number = r * 100 + g * 10 + b

if number % 4 = 0:
  print("YES")
 
else:
  print("NO")

Buggy submission (verdict: Runtime Error):

number = int(input())
 
if number % 4 == 0:
  print("YES")
else:
  print("NO")

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

if number % 4 = 0:
  print("YES")

else:
  print("NO")
Problem p02705 (python)

Fixed submission:
import math

R = int(input())

print(R * 2 * math.pi)

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().strip().split(" "))

homework = list(map(int, input().strip().split(" ")))

day = n - sum(homework)

if day >= 0:
  
  print(day)
  
else:
  
  print(-1)

Buggy submission (verdict: Runtime Error):
 print(int(input(R))*6.3)

Buggy submission (verdict: Runtime Error):
6.3R

Buggy submission (verdict: Runtime Error):
x = 2 * R * 3

Buggy submission (verdict: Runtime Error):
x = 2 * R * 3.14

print(x)

Buggy submission (verdict: Runtime Error):
 print(int(input())*6.3)

Buggy submission (verdict: Runtime Error):
R
Problem p02706 (python)

Fixed submission:
n,m = map(int, input().strip().split(" "))
 
homework = list(map(int, input().strip().split(" ")))
 
day = n - sum(homework)
 
if day >= 0:
    print(day)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().strip().split(" "))

homework = list(n,m)

day = n - sum(homework)

if day >= 0:
  
  print(day)
  
else:
  
  print(-1)

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().strip().sprit(' '))

homework = list(map(int, input().strip().sprit(' ')))

day = n - sum(homework)

if day >= 0:
  print(day)
else:
  print(-1)
Problem p03693 (python)

Fixed submission:
r, g, b = map(int, input().split())
x = r * 100 + g * 10 + b

if x % 4 == 0:
  print("YES")
  
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
r, g, b = map(int, input().split())
x = r * 100 + g * 10 + b

if x % 4 = 0:
  print("YES")
  
else:
  print("NO")
Problem p02606 (python)

Fixed submission:
li = list(map(int,input().split()))
count = 0
for num in range(li[0],li[1]+1):
  if num % li[2] == 0:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
li = input().split()
count = 0
for num in range(li[0],li[1]+1):
  if num % li[2] == 0:
    count += 1
print(count)
Problem p02719 (python)

Fixed submission:
N,K=map(int,input().split())
print(min(N%K,K-(N%K)))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
if N==0:print(0)
elif N<K:print(min(N,K-N))
elif N>=K*2:print(N%K)
else:print(N%(N-K))
Problem p03076 (python)

Fixed submission:
A = [int(input()) for i in range(5)]
#１の位が１～９のうちで1に近いほど、最後に調理される
B = [a-a%10+10 if a % 10 != 0 else a for a in A]
diff = [(b-a) for a,b in zip(A,B)]
print(sum(B) - max(diff))

Buggy submission (verdict: Runtime Error):
A = [int(input()) for i in range(5)]
#１の位が１～９のうちで1に近いほど、最後に調理される
B = [a-a%10+10 if a % 10 != 0 else a for a in A]
diff = [(b-a) for a,b in zip(a,b)]
print(sum(B) - max(diff))
Problem p03085 (python)

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

Buggy submission (verdict: Runtime Error):
from itertools import accumulate


N, Q = list(map(int, input().split()))
S = input()
A = [list(map(int, input().split())) for i in range(Q)]

flg = []
for i in range(N-1):
    tmp_S = S[i:i+2]
    if tmp_S == 'AC':
        flg.append(1)
    else:
        flg.append(0)

flg2 = [0] + flg
flg2 = list(accumulate(flg2))

for a in A:
    print(flg2[a[1]-1] - flg2[a[0]-1])

Buggy submission (verdict: Runtime Error):
from itertools import accumulate
n, q = list(map(int, input().split()))
s = input()
a = [list(map(int, input().split())) for i in range(q)]

flg = []

for i in range(n-1):
    tmp = s[i:i+2]
    if tmp == 'AC':
        flg.append(1)
    else:
        flg.append(0)
    
flg2 = [0] + flg
flg2 = list(accumulate(flg2))

for l in a:
    print(flg2[l[1]-1] - flg2[l[0]-1])
Problem p02647 (python)

Fixed submission:
import math
from sys import stdin,stdout
#% 998244353
from heapq import heapify,heappop,heappush
import collections

n,k=list(map(int,stdin.readline().split()))
a=list(map(int,stdin.readline().split()))


for i in range(min(k,100)):
    #nw=[0]*n
    pr=[0]*n
    for x,d in enumerate(a):
        if d==0:
            pr[x]+=1
            if x!=n-1:
                pr[x+1]-=1
            continue
        l=math.floor(x-d)
        r=math.floor(x+d)
        l=max(0,l)
        r=min(n-1,r)
        pr[l]+=1
        if r!=n-1:
            pr[r+1]-=1
    
    for m in range(1,n):
        pr[m]+=pr[m-1]
    
    a[:]=pr


        

for i in a:
    print(i,end=" ")

Buggy submission (verdict: Runtime Error):
import math
from sys import stdin,stdout
#% 998244353
from heapq import heapify,heappop,heappush
import collections

n,k=list(map(int,stdin.readline().split()))
a=list(map(int,stdin.readline().split()))


for i in range(min(k,math.log(n))):
    #nw=[0]*n
    pr=[0]*n
    for x,d in enumerate(a):
        if d==0:
            pr[x]+=1
            if x!=n-1:
                pr[x+1]-=1
            continue
        l=math.floor(x-d)
        r=math.floor(x+d)
        l=max(0,l)
        r=min(n-1,r)
        pr[l]+=1
        if r!=n-1:
            pr[r+1]-=1
    
    for m in range(1,n):
        pr[m]+=pr[m-1]
    
    a[:]=pr


        

for i in a:
    print(i,end=" ")
Problem p02612 (python)

Fixed submission:
N = int(input())
if N < 1000:
    print(1000-N)
else:
    
    L = str(N)
    L1 = str(L[-3] + L[-2] + L[-1])
    N1 = int(L1)
    if N1 == 0:
        print(0)
    else:
        print(1000 - N1)

Buggy submission (verdict: Runtime Error):
N = int(input())
L = str(N)
L1 = str(L[-3] + L[-2] + L[-1])
N1 = int(L1)
if N1 == 0:
    print(0)
else:
    print(1000 - N1)
Problem p02700 (python)

Fixed submission:
#入力
A, B, C, D = map(int, input().split())


#高橋の攻撃何発分か
if C % B == 0:
    aokiDeath = C // B
else:
    aokiDeath = C // B + 1 

#青木の攻撃何回分か
if A % D == 0:
    takahashiDeath = A // D
else:
    takahashiDeath = A // D + 1

if aokiDeath <= takahashiDeath:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#入力
HPlist = list(map(int, input().split()))
HPlist[0] = A
HPlist[1] = B
HPlist[2] = C
HPlist[3] = D


#高橋の攻撃何発分か
if C % B == 0:
    aokiDeath = C // B
else:
    aokiDeath = C // B + 1 

#青木の攻撃何回分か
if A % D == 0:
    takahashiDeath = A // D
else:
    takahashiDeath = A // D + 1

if aokiDeath <= takahashiDeath:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#入力
A, B, C, D = map(int, input().split())

#各々HPを定義
int takahashi = A
int aoki = C
int aokiDeath
int takahashiDeath

#高橋の攻撃何発分か
if C % B == 0:
    aokiDeath = C // B
else:
    aokiDeath = C // B + 1 

#青木の攻撃何回分か
if A % D == 0:
    takahashiDeath = A // D
else:
    takahashiDeath = A // D + 1

if aokiDeath <= takahashiDeath:
    print("Yes")
else:
    print("No")
Problem p02705 (python)

Fixed submission:
R = int(input())

import math

circle = 2 * R * math.pi

print(circle)

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

homework = sum(a)

if homework > N:
    print("-1")

else:
    print(N - homework)
Problem p02706 (python)

Fixed submission:
N, M = map(int, input().split())
a = list(map(int, input().split()))

homework = sum(a)

if homework > N:
    print("-1")

else:
    print(N - homework)

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

homework = sum(a)

if homework > N:
    print("-1")

else:
    print(N - homework)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
a = [int(input()) for i in range(M)]

homework = sum(a)

if homework > N:
    print("-1")

else:
    print(N - homework)
Problem p02717 (python)

Fixed submission:
X, Y, Z = map(int, input().split())

x = str(X)
y = str(Y)
z = str(Z)
print(z + " " + x + " " + y)

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

totalVote = sum(A)
border = totalVote / (4 * M)
A.sort(reverse = True)

if A[M-1] >= border:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
X, Y, Z = map(int, input().split())

x = str(X)
y = str(Y)
z = str(Z)
print(Z + " " + X + " " + Y)

Buggy submission (verdict: Runtime Error):
X, Y, Z = map(int, input().split())

print(Z + " " + X + " " + Y)
Problem p02718 (python)

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

totalVote = sum(A)
border = totalVote / (4 * M)
A.sort(reverse = True)

if A[M-1] >= border:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [int(input()) for k in range(N)]

totalVote = sum(A)
border = totalVote / (4 * M)
A.sort(reverse = True)

if A[M-1] >= border:
    print("Yes")
else:
    print("No")
Problem p02630 (python)

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

count = [0] * (10 ** 5 + 1)
for i in a:
    count[i] += 1

a_sum = sum(a)
for i in range(q):
    b, c = map(int, input().split())
    a_sum += (c - b) * count[b]
    count[c] += count[b]
    count[b] = 0
    print(a_sum)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input()
q = int(input())
l = [list(map(str, input().split())) for _ in range(q)]

for i in range(q):
    if l[i][0] in a:
        a = a.replace(l[i][0], l[i][1])
        new_a = a.split()
        new_a = [int(j) for j in new_a]
    print(sum(new_a))
Problem p02641 (python)

Fixed submission:
x, n = map(int, input().split())
p = list(map(int, input().split()))
min = float('inf')

for i in range(0, 102)[::-1]:
    if abs(x - i) <= min:
        if i not in p:
            min = abs(x - i)
            ans = i

print(ans)

Buggy submission (verdict: Runtime Error):
x, n = map(int, input().split())
p = list(map(int, input().split()))
min = float('inf')

for i in range(1, 101)[::-1]:
    if abs(x - i) <= min:
        if i not in p:
            min = abs(x - i)
            ans = i

print(ans)

Buggy submission (verdict: Runtime Error):
x, n = map(int, input().split())
p = list(map(int, input().split()))
l = []
min = float('inf')

for i in range(1, 101)[::-1]:
    if abs(x - i) < min:
        if i not in p:
            min = abs(x - i)
            ans = i

print(ans)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = int(input())
print(a * b)
Problem p02717 (python)

Fixed submission:
x,y,z = map(int, input().split())
print(z,x,y)

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)

hantei = sum(a) / (4 * m)
if a[m-1] > hantei:
    print("Yes")
else:
    print("No")
Problem p02719 (python)

Fixed submission:
n,k = map(int, input().split())
print(min(n % k , k - (n % k)))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())

print(min(n % k), (k - (n % k)))