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

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
diff = []
for i, index in enumerate(a,1):
    diff.append(i-index)

diff.sort()
if n % 2 == 1:
    b = diff[n // 2]
    tmp = map(lambda x: x - b, diff)
    print(sum( map(abs,tmp )))
else:
    b1 = diff[n // 2 - 1]
    b2 = diff[n // 2]
    tmp1 = map(lambda x: x - b1, diff)
    tmp2 = map(lambda x: x - b2, diff)
    ans1 = sum( map(abs,tmp1 ))
    ans2 = sum( map(abs,tmp2 ))
    print(min(ans1,ans2))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans1 = 0
ans2 = 0
 
diff = []
for i, index in enumerate(a,1):
    diff.append(abs(i - index))
 
diff.sort()
if n % 2 == 1:
    b = diff[len(diff) // 2]
    for i in diff:
        ans1 += abs(i - b)
 
    print(ans1)
else:
    b1 = diff[len(diff) // 2 - 1]
    b2 = diff[len(diff) // 2]
    for i in diff:
        ans1 += abs(i -b1)
        ans2 += abs(i -b2)
    print(min(ans1.ans2))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
diff = []
for i, index in enumerate(a,1):
    diff.append(i-index)

diff.sort()
if n % 2 == 1:
    ans = 0
    b = diff[n // 2]
    for i in diff:
        ans += abs(i - b)
    print(ans)
else:
    ans1,ans2 = 0
    b1 = diff[n // 2 - 1]
    b2 = diff[n // 2]
    for i in diff:
        ans1 += abs(i -b1)
        ans2 += abs(i -b2)
    print(min(b1.b2))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans1 = 0
ans2 = 0

diff = []
for i, index in enumerate(a,1):
    diff.append(i-index)

diff.sort()
if n % 2 == 1:
    b = diff[n // 2]
    for i in diff:
        ans1 += abs(i - b)
    print(ans1)
else:
    b1 = diff[n // 2 - 1]
    b2 = diff[n // 2]
    for i in diff:
        ans1 += abs(i -b1)
        ans2 += abs(i -b2)
    print(min(b1.b2))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans1 = 0
ans2 = 0

diff = []
for i, index in enumerate(a,1):
    diff.append(abs(i - index))

diff.sort()
if n % 2 == 1:
    b = diff[len(diff) // 2]
    for i in diff:
        ans1 += abs(i - b)

    print(ans1)
else:
    b1 = diff[len(diff) // 2 - 1]
    b2 = diff[len(diff) // 2]
    for i in diff:
        ans1 += abs(i -b1)
        ans2 += abs(i -b2)
    print(min(b1.b2))
Problem p02687 (python)

Fixed submission:
import sys

import math
input = sys.stdin.readline

hoge = str(input().strip())
if hoge == "ABC":
   print("ARC".strip())
if hoge == "ARC":
       print("ABC".strip())

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

strA = str(input())

if strA == 'ABC':
  print('ARC')
elif strA == 'ARC':
  print('ABC')
else
  print('')
Problem p02717 (python)

Fixed submission:
import sys
input = sys.stdin.readline

#intの場合
X,Y,Z = map(int,input().split())

Xa = Y
Ya = X
Xa = Z
Za = Y

print ( Z, X ,Y)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

#intの場合
N ,M = map(int,input().split())

intlist = list(map(int, input().split()))
newlist = sorted(intlist, reverse=True)[:M]

if newlist[M-1] > ( sum(intlist) / (4 * M) ):
  print ("Yes")
else:
  print ("No")
Problem p02783 (python)

Fixed submission:
kazu = list(map(int, input().split()))

print(-(-(kazu[0]) // kazu[1]))

Buggy submission (verdict: Runtime Error):
hp = int(input())
attack = int(input())

print(-(-(hp) //attack))
Problem p02784 (python)

Fixed submission:
kazu1 = list(map(int, input().split()))
kazu2 = list(map(int, input().split()))

if kazu1[0] <= sum(kazu2):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
hp = int(input())
hissatsu = int(input())
hissatsuatk = list(map(int, input().split()))

if hp <= sum(hissatsuatk):
    print('YES')
else:
    print('NO')
Problem p02743 (python)

Fixed submission:
a,b,c = map(int,input().split())
if (c-a-b <= 0):
    print("No")
else:
    ans = (c-a-b) * (c-a-b) > 4 * a  *b 
    if (ans):
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if (c-a-b <= 0)
    print("No")
else:
    ans = (c-a-b) * (c-a-b) > 4 * a  *b 
    if (ans):
        print("Yes")
    else:
        print("No")
Problem p03061 (python)

Fixed submission:
import math 
N = int(input())
A= list(map(int,input().split()))
memo_gcd_foward = [A[0]]
memo_gcd_backward = [A[N-1]]

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)

for i in range(N-1):
    memo_gcd_foward.append(gcd(memo_gcd_foward[-1],A[i+1]))

for i in range(N-1):
    memo_gcd_backward.append(gcd(memo_gcd_backward[-1],A[-i-2]))


cand = []
cand.append(memo_gcd_foward[-1])
cand.append(memo_gcd_foward[-2])
cand.append(memo_gcd_backward[-2])

for i in range(N-2):
    cand.append(gcd(memo_gcd_foward[i],memo_gcd_backward[-i-3]))
print(max(cand))

Buggy submission (verdict: Runtime Error):
import math 
N = int(input())
A= list(map(int,input().split()))
memo_gcd_foward = [A[0]]
memo_gcd_backward = [A[N-1]]

for i in range(N-1):
    memo_gcd_foward.append(math.gcd(memo_gcd_foward[-1],A[i+1]))

for i in range(N-1):
    memo_gcd_backward.append(math.gcd(memo_gcd_backward[-1],A[-i-2]))


cand = []
cand.append(memo_gcd_foward[-1])
cand.append(memo_gcd_foward[-2])
cand.append(memo_gcd_backward[-2])

for i in range(N-2):
    cand.append(math.gcd(memo_gcd_foward[i],memo_gcd_backward[-i-3]))
print(max(cand))
Problem p03471 (python)

Fixed submission:
INPUT= input()
n, y = INPUT.strip().split(" ")
n = int(n)
y = int(y)
flag = 0
for i in range(n+2):
    for j in range(i+1,n+2):
        if flag == 1:
            break
        if y ==10000 *i + 5000* (j-i-1) + 1000 * (n-j+1):
            print("{} {} {}".format(i, j-i-1, n-j+1))
            flag = 1
            break
if flag == 0:
    print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):
INPUT= input()
n, y = INPUT.strip().split(" ")
n = int(n)
y = int(y)
for i in range(n+2):
    for j in range(i+1,n+2):
        if flag == 1:
            break
        if y ==10000 *i + 5000* (j-i-1) + 1000 * (n-j+1):
            print("{} {} {}".format(i, j-i-1, n-j+1))
            flag = 1
            break
if flag == 0:
    print("-1 -1 -1")
Problem p03482 (python)

Fixed submission:
import numpy as np 
s = input()
fis = s[0]
n = len(s)
k = n
temp = s[0]
for i in range(n):
    if temp!=s[i]:
        temp = s[i]
        k = np.min((k, np.max( (i, n-i) ) ))
print("{}".format(int(k)))

Buggy submission (verdict: Runtime Error):
import numpy as np 
s = input()
fis = s[0]
n = len(s)
k = float('inf')
temp = s[0]
for i in range(n):
    if temp!=s[i]:
        temp = s[i]
        k = np.min((k, np.max( (i, n-i) ) ))
print("{}".format(int(k)))

Buggy submission (verdict: Runtime Error):
import numpy as np 
fis = s[0]
n = len(s)
k = float('inf')
temp = s[0]
for i in range(n):
    if temp!=s[i]:
        temp = s[i]
        k = np.min((k, np.max( (i, n-i) ) ))
print("{}".format(int(k)))
Problem p03607 (python)

Fixed submission:
import numpy as np
hoge = input()
N = int(hoge)
paper ={}
for i in range(N):
    hoge = input()
    hoge = hoge.strip()
    if hoge in paper:
        paper.pop(hoge)
    else:
        paper[hoge] = 1
    
print(len(paper))

Buggy submission (verdict: Runtime Error):
import numpy as np
hoge = input()
N = int(hoge)
paper = set([])
for i in range(N):
    hoge = input()
    hoge = hoge.strip()
    if paper.issuperset(hoge):
        paper = paper - set([hoge])
    else:
        paper = paper + set([hoge])
    
print(len(paper))
Problem p03665 (python)

Fixed submission:
import numpy as np
import scipy.misc as scm
hoge = input()
hoge = list(map(int,hoge.split(" ")))
N = hoge[0]
P = hoge[1]
A = input()
A = list(map(int,A.split(" ")))
A = np.array(A)

odd = len(A[A %2 == 1])
even = N -odd
perm = 0
if P == 0:
    for i in range(0,odd+1,2):
        perm +=scm.comb(odd,i,1)
else:
    for i in range(1,odd+1,2):
            perm +=scm.comb(odd,i,1)
ans = 2**even * perm
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
hoge = input()
N,A,B,C,D = list(map(int,hoge.split(" ")))
k = np.abs(B-A)//D
l = np.abs(B-A)%D
times = k + 2 * np.ceil (l/ (D-C))
if times > N-2:
    print("NO")
else:
    print("YES")

Buggy submission (verdict: Runtime Error):
hoge = input()
N,A,B,C,D = list(map(int,hoge.split(" ")))
k = np.abs(B-A)//D
l = np.abs(B-A)%D
times = k + 2 * np.ceil (l/ (D-C))
if times > N-2:
    print("NO")
else:
    print("YES")
Problem p03673 (python)

Fixed submission:
import numpy as np
n = int(input())
A = input()
a = list(map(int,A.split(" ")))
a = np.array(a)
even= a[1::2]
odd= a[0::2]
if n%2 == 0:
    b = np.append(even[::-1],odd)
else:
    b = np.append(odd[::-1],even)
 
import sys
for d in b[:-1]:
    sys.stdout.write(str(d)+ " ")
sys.stdout.write(str(b[-1])+"\n")

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
A = input()
a = list(map(int,A.split(" ")))
a = np.array(a)

if n%2 == 0:
    b = np.append(even[::-1],odd)
else:
    b = np.append(odd[::-1],even)

import sys
for d in b[:-1]:
    sys.stdout.write(str(d)+ " ")
sys.stdout.write(str(b[-1])+"\n")

Buggy submission (verdict: Runtime Error):
import numpy as np
n = input()
A = input()
a = list(map(int,A.split(" ")))
a = np.array(a)
odd = a[1::2]
even = a[0::2]
if n//2 == 0:
    b = np.append(even[::-1],odd)
else:
    b = np.append(odd[::-1],even)
import sys
for d in b[:-1]:
    sys.stdout.write(str(d)+ " ")
sys.stdout.write(str(b[-1])+"\n")
Problem p03680 (python)

Fixed submission:
import numpy as np
N = int(input())
a = np.zeros(N+1)
for i in range(N):
    a[i+1] = int(input())
i = 1
n = 0
for j in range(N):
    n = n+1
    i = a[i]
    if i == 2:
        print(n)
        break
if i!=2:
    print(-1)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
a = np.zeros(N)
for i in range(N):
    a[i+1] = int(input())
i = 1
n = 0
for j in range(N):
    n = n+1
    i = a[i]
    if i == 2:
        print(n)
        break
if i!=2:
    print(-1)
Problem p03687 (python)

Fixed submission:
a = input()
min = 10000
for target in set(a):
    s = a
    j = 0
    while(1):
        
        if len(set(s)) == 1:
            break
        new_s = ""
        for i in range(len(s)-1):
            if s[i] == target or s[i+1] == target:
                new_s +=target
            else:
                new_s += s[i]
        j+=1;
        if j > min:
            break
        s = new_s
    if min > j:
        min = j

print(min)

Buggy submission (verdict: Runtime Error):

a = input()

for target in set(s):
    s = a
    j = 0
    min = 10000
    while(1):
        
        if len(set(s)) == 1:
            break
        new_s = ""
        for i in range(len(s)-1):
            if s[i] == target or s[i+1] == target:
                new_s +=target
            else:
                new_s += s[i]
        j+=1;
        s = new_s
    if min > j:
        min = j
print(min)

Buggy submission (verdict: Runtime Error):
from collections import Counter
s = raw_input()
counter = Counter(s)
target = counter.most_common()[0][0]
j = 0
while(1):
    if len(set(s)) == 1:
        break
    new_s = ""
    for i in range(len(s)-1):
        if s[i] == target or s[i+1] == target:
            new_s +=target
        else:
            new_s += s[i]
    j+=1;
    s = new_s
print(j)
Problem p03773 (python)

Fixed submission:
import sys
a = sys.stdin.readline()
a,b = a.strip().split(" ")
print((int(a)+int(b))%24)

Buggy submission (verdict: Runtime Error):
print(A+B/24)
Problem p04016 (python)

Fixed submission:
import itertools
import math 
 
n,s = [int(input()) for _ in range(2)]
 
def n_base_sum(n,b):
    if(math.floor(n/b)):
        return n_base_sum(math.floor(n/b),b)+n%b
    else:
        return n%b
 
def search_p(n,s):
    for p in range(math.floor(math.sqrt(n))+1,0,-1):
        b = (n-s)//p + 1
        if b >1 :
            q = n % b
            if p+q ==s and q < b and n == p*b+q and p<b:
                return b
        
    return -1
 
ans =-1
flag = False
answers = []
if s == n:
    ans = n+1
    flag =True
    answers.append(ans)
for b in  range(2,math.ceil(math.sqrt(n))+1):
    if s== n_base_sum(n,b):
        ans = b
        flag = True
        answers.append(ans)
        break
ans = search_p(n,s)
if ans != -1:
    flag =True
    answers.append(ans)
 
if not flag:
    print(-1)
else:
    print(int(min(answers)))

Buggy submission (verdict: Runtime Error):
import itertools
import math 

n,s = [int(input()) for _ in range(2)]

def n_base_sum(n,b):
    if(int(n/b)):
        return n_base_sum(int(n/b),b)+n%b
    else:
        return n%b

def search_p(n,s):
    for p in range(math.ceil(math.sqrt(n))+1,0,-1):
        b = n //p
        q = n % b
        if p+q ==s:
            return b
    return -1

ans =-1
flag = False
answers = []
if s == n:
    ans = n+1
    flag =True
    answers.append(ans)
for b in  range(2,math.ceil(math.sqrt(n))+1):
    if s== n_base_sum(n,b):
        ans = b
        flag = True
        answers.append(ans)
        break
ans = search_p(n,s)
if ans != -1:
    flag =True
    answers.append(ans)


if not flag:
    print(-1)
else:
    print(int(min(answers)))

Buggy submission (verdict: Runtime Error):
import itertools
import math 

n,s = [int(input()) for _ in range(2)]

def n_base_sum(n,b):
    if(int(n/b)):
        return n_base_sum(int(n/b),b)+n%b
    else:
        return n%b

def search_p(n,s):
    for p in range(math.ceil(math.sqrt(n))+1,0,-1):
        b = (n-s)//p + 1
        q = n % b
        if p+q ==s:
            return b
    return -1

ans =-1
flag = False
answers = []
if s == n:
    ans = n+1
    flag =True
    answers.append(ans)
for b in  range(2,math.ceil(math.sqrt(n))+1):
    if s== n_base_sum(n,b):
        ans = b
        flag = True
        answers.append(ans)
        break
ans = search_p(n,s)
if ans != -1:
    flag =True
    answers.append(ans)


if not flag:
    print(-1)
else:
    print(int(min(answers)))

Buggy submission (verdict: Runtime Error):
import itertools
import math 

n,s = [int(input()) for _ in range(2)]

def calc_s(b,n):
    i = 0
    s = 0
    while(1):
        s+= n %b
        n = math.floor(n/b)
        i+=1
        if n ==0:
            break
    return s

def search_p(n,s):
    for p in range(1,math.ceil(math.sqrt(n))+1):
        b = n//p
        q = n - b*p
        if p+q ==s:
            return b
    return -1

if s == n:
    ans = n+1
elif s < math.sqrt(n):
    flag = False
    for b in  range(2,math.ceil(math.sqrt(n))+1):
        if s== calc_s(b,n):
            ans = b
            flag = True
            break
    if flag == False:
        ans = search_p(n,s)
print(ans)
Problem p02706 (python)

Fixed submission:
def solve():
    N, M = map(int, input().split())
    hws = list(map(int, input().split()))
    for i in hws:
        N -= i
        if (N<0):
            print(-1)
            return

    print(N)

solve()

Buggy submission (verdict: Runtime Error):
r = int(input())
pi = 3.14159265358979
print(2*r*pi)

Buggy submission (verdict: Runtime Error):
r = int(input())
import math
print(2*r*math.pi)
Problem p02741 (python)

Fixed submission:
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
index = int(input()) -1
print(a[index])

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
 
if (c-a-b)<=0:
  import sys
  print("No")
  sys.exit()
if 4*a*b < (c-a-b)*(c-a-b):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
index = input()
print(a[index-1])

Buggy submission (verdict: Runtime Error):
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
index = int(input().split())
print(a[index-1])
Problem p02760 (python)

Fixed submission:
n11, n12, n13 = map(int,input().split())
n21, n22, n23 = map(int,input().split())
n31, n32, n33 = map(int,input().split())
lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = {}
r = input()
for i in range(int(r)):
  nums[int(input())] = 0
flag = False
for l in lines:
  if l[0] in nums:
    if l[1] in nums:
      if l[2] in nums:
        flag = True
if flag:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n11, n12, n13 = (input().split())
n21, n22, n23 = (input().split())
n31, n32, n33 = (input().split())

lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = []
for(i in range(int(input()))):
  nums.append(input())
flag = false

Buggy submission (verdict: Runtime Error):
n11, n12, n13 = int(input().split())
n21, n22, n23 = int(input().split())
n31, n32, n33 = int(input().split())
lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = []
for(i in range(int(input()))):
  nums.append(input())
flag = false
for(l in lines):
  if l[0] in nums:
    if l[1] in nums:
      if l[2] in nums:
        flag = True
if flag:
  print("No")
else:
  print("Yes")
Problem p02795 (python)

Fixed submission:
h = int(input())
w = int(input())
n = int(input())
count = 0
if h < w:
  a = w
  b = h
else:
  a = h
  b = w
 
x = int(n/a)
if n%a != 0:
  x += 1
print(x)

Buggy submission (verdict: Runtime Error):
h = input()
w = input()
n = input()
count = 0
if h < w:
  a = w
  b = h
else:
  a = h
  b = w
 
x = int(n/a)
if n%a != 0:
  x += 1
print(x)

Buggy submission (verdict: Runtime Error):
h = input()
w = input()
n = input()
count = 0
if h < w:
  a = w
  b = h
else:
  a = h
  b = w
 
x = int(n/a)
if n%a != 0:
  x += 1
return x
Problem p02717 (python)

Fixed submission:
X,Y,Z=[int(x) for x in input().split()]
(X,Y)=(Y,X)
(X,Z)=(Z,X)
print(X,Y,Z)

Buggy submission (verdict: Runtime Error):
n,k,c=[int(x) for x in input().split()]
s=list(input())

L=[]
R=[]

i=0
while i < n:  
    if s[i]=="o":
        L.append(i)
        i+=c
    i+=1

i=0
while i < n:
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=c
    i+=1

days=[]
for i in range(k):
    if L[i]==R[i]:
        days.append(L[i])


for i in range(len(days)):
    print(days[i]+1)

Buggy submission (verdict: Runtime Error):
n,k,c=[int(x) for x in input().split()]
s=list(input())

L=[]
R=[]

i=0
while i < n:  
    if s[i]=="o":
        L.append(i)
        i+=2
    i+=1

i=0
while i < n:
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=2
    i+=1

days=[]
for i in range(k):
    if L[i]==R[i]:
        days.append(L[i])


for i in range(len(days)):
    print(days[i]+1)
Problem p02721 (python)

Fixed submission:
n,k,c=[int(x) for x in input().split()]
s=list(input())

L=[]
R=[]

i=0
while i < n:  
    if s[i]=="o":
        L.append(i)
        i+=c
    i+=1

i=0
while i < n:
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=c
    i+=1
    
days=[]
for i in range(k):
    if L[i]==R[k-i-1]:
        days.append(L[i])


for i in range(len(days)):
    print(days[i]+1)

Buggy submission (verdict: Runtime Error):
n,k,c=[int(x) for x in input().split()]
s=list(input())

L=[]
R=[]

i=0
while i < n:  
    if s[i]=="o":
        L.append(i)
        i+=2
    i+=1

i=0
while i < n:
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=2
    i+=1

days=[]
for i in range(k):
    if L[i]==R[i]:
        days.append(L[i])


for i in range(len(days)):
    print(days[i]+1)

Buggy submission (verdict: Runtime Error):
L=[]
R=[]

i=0
while i < n:  
    if s[i]=="o":
        L.append(i)
        i+=2
    i+=1

i=0
while i < n:
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=2
    i+=1

days=[]
for i in range(k):
    if L[i]==R[i]:
        days.append(L[i])


for i in range(len(days)):
    print(days[i]+1)

Buggy submission (verdict: Runtime Error):
n,k,c=[int(x) for x in input().split()]
s=list(input())

L=[]
R=[]
i=0
while i < n:
    
    if s[i]=="o":
        L.append(i)
        i+=2
    i+=1

i=0
while i < n:
    
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=2
    i+=1
    


days=[]

for i in range(k):
    
    if L[i]==R[i]:
        days.append(L[i])

for i in range(len(days)):
    print(days[i])
Problem p02705 (python)

Fixed submission:
import math
print(2*float(input())*math.pi)

Buggy submission (verdict: Runtime Error):
import math
print(2*math.pi*int(input))
Problem p02718 (python)

Fixed submission:
import math
def I(): return(list(map(int,input().split())))
n,m=I()
a=I()
t=math.ceil((1/(4*m))*sum(a))
c=0
for i in a:
	if i>=t:c+=1
print(["No","Yes"][c>=m])

Buggy submission (verdict: Runtime Error):
import math
def I(): return(list(map(int,input().split())))
n,m=I()
a=I()
t=math.ceil((1/4m*sum(a)))
c=0
for i in a:
	if i>=t:c+=1
print(["NO"]["YES"][c==m])
Problem p02705 (python)

Fixed submission:
r = int(input())
print(2*r*3.14)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
ans = []
for i in range(1,n+1):
    ans.append(a.count(i))
for j in ans:
    print(j)
Problem p03086 (python)

Fixed submission:
s = input() + 'n'
ans = 0
fans = 0
for i in range(len(s)):
    if s[i] =='A' or s[i] =='C' or s[i] =='G' or s[i] =='T':
        ans += 1
    elif fans < ans:
        fans = ans
        ans = 0
print(fans)

Buggy submission (verdict: Runtime Error):
s = input() + 'n'
ans = 0
fans = 0
for i in range(len(s)):
    if s[i] 'ACGT':
        ans += 1
    elif fans < ans:
        fans = ans
        ans = 0
print(fans)
Problem p02765 (python)

Fixed submission:
def resolve():
    N, R = map(int, input().split())  

    if N >= 10:
        print(R)
    else:
        R = R + 100 * (10 - N)
        print(R)
 
if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    N = int(input())
    x_list = list(map(int, input().split()))

    x_min = min(x_list)
    x_max = max(x_list)
    hp_min = None

    for i in range(x_min, x_max+1):
        tmp_hp = 0
        for j in x_list:
            tmp_hp += (j - i)**2
        if (hp_min is None) or (tmp_hp < hp_min):
            hp_min = tmp_hp

    print(hp_min)

if __name__ == "__main__":
    resolve()

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

    if N >= 10:
        print(R)
    else:
        R = R - 100 * (10 - K)
        print(R)
 
if __name__ == "__main__":
    resolve()
Problem p02784 (python)

Fixed submission:
import sys

def propare():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))
    N = int(next(tokens))
    A_list = []
    for i in range(N):
        A_list.append(int(next(tokens)))

    solve(H, N, A_list)

def solve(H: int, N: int, A_list: list):
    sum_a = 0
    for a in A_list:
        sum_a = sum_a + a

    if H <= sum_a:
        print('Yes')
    else:
        print('No')

    return


 
if __name__ == "__main__":
    propare()

Buggy submission (verdict: Runtime Error):
211 5
31 41 59 26 53
Problem p02818 (python)

Fixed submission:
def resolve():
    A, B, K = map(int,input().split())

    '''
    for i in range(K):
        if 1 <= A:
            A-=1
        elif 1 <= B:
            B-=1
    '''

    if A < K:
        K -= A
        A = 0
        if B <= K:
            B = 0
        else:
            B -= K
    elif K <= A:
        A -= K

    print("{} {}".format(A,B))

if __name__ == "__main__":
    resolve()

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

    '''
    for i in range(K):
        if 1 <= A:
            A-=1
        elif 1 <= B:
            B-=1
    '''

    if A < K:
        if B =< K:
            A = 0
            B = 0
        else:
            A = 0
            B -= K
    elif K < A:
        A -= K

    print("{} {}".format(A,B))

if __name__ == "__main__":
    resolve()