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

Fixed submission:
k = int(input())
count1 = 0
count2 = 0
for i in range(k):
    if i % 2 == 0:
        count1 += 1
    else:
        count2 += 1
print(count1 * count2)

Buggy submission (verdict: Runtime Error):
k = int(input())
count1 = 0
count2 = 0
for i in range(k):
    if i % 2 == 0:
        count1 += 1
    else:
        count2 += 1
print(count1 * count2
Problem p03353 (python)

Fixed submission:
s = input()
k = int(input())
sub = []
for i in range(len(s)):
    for j in range(i, i+5):
        sub.append(s[i:j+1])
sub = list(set(sub))
sub.sort()
print(sub[k-1])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
sub = []
num = len(s)
for i in range(num):
    for j in range(i, num):
        sub.append(s[i:j+1])
sub = list(set(sub))
sub.sort()
print(sub

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
sub = []
for i in range(len(s)):
    for j in range(i, len(s)-1):
        sub.append(s[i:j+1])
sub = list(set(sub))
sub.sort()
print(sub[k-1])
Problem p02621 (python)

Fixed submission:
a=int(input())
s=a+a**2+a**3
res=int(s)
print(res)

Buggy submission (verdict: Runtime Error):
def calc(n):
  s=n+n**2+n**3
  res=int(s)
  return res
for i in range(int(input())):
  n=int(input())
  print(calc(n))

Buggy submission (verdict: Runtime Error):
for i in range(int(input())):
  n=int(input())
  s=n+n**2+n**3
  print(s)
Problem p02885 (python)

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

x = A - (2 * B)

if x >= 0:
	print(x)
elif x < 0:
	print(0)

Buggy submission (verdict: Runtime Error):
N = int(input())
L = input().split()
L = [int(i) for i in L ]
total = 0

L_sort = sorted(L)


def test(total):
	for i in range(N-2):
		for j in range(i+1,N - 1):
							temp_L = L_sort[j + 1:]
							
							#total += len(temp_L[temp_L < L_sort[i]+ L_sort[j]])
							temp_L = [k for k in temp_L if k < L_sort[i]+ L_sort[j]]
							total += len(temp_L)

	return total
						
				  	
print(test(total))
Problem p02887 (python)

Fixed submission:
N = int(input())
S = input()

total = []
Y = 0

for i in range(N):
	if i == N-1:
		Y = Y + 1
		break
	if S[i] == S[i+1]:
		continue
	else:
		Y = Y + 1
		
print(Y)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()

total = []

def yugo(st,x):
	if len(st) <= x + 1:
		return st[x],-1
	if st[x] == st[x + 1]:
		return yugo(st,x+1)
	else:
		return st[x] , x+1

x= 0
Y = []
for i in range(10000):
	y,x = yugo(S,x)
	if x == -1 :
		Y = Y + [y]
		break
	Y = Y + [y]
	
print(len(Y))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()

total = []

def yugo(st,x):
	if len(st) <= x + 1:
		return st[x]
		
	if st[x] == st[x + 1]:
		return yugo(st,x+1)
	else:
		return st[x] +  yugo(st,x+1)
	

print(int(len(yugo(S,0))))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()

total = []

def yugo(st,x):
	if len(st) == x + 1:
		return st[x]
	if st[x] == st[x + 1]:
		return yugo(st,x+1)
	else:
		return st[x] +  yugo(st,x+1)
	

print(int(len(yugo(S,0))))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())

total = []

def yugo(st,x):
	if len(st) == x + 1:
		return st[x]
	if st[x] == st[x + 1]:
		return yugo(st,x+1)
	else:
		return st[x] +  yugo(st,x+1)
	

print(int(len(yugo(S,0))))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())

total = []

def yugo(st,x):
	if len(st) == x + 1:
		return st[x]
	if st[x] == st[x + 1]:
		return yugo(st,x+1)
	else:
		return st[x] +  yugo(st,x+1)
	

print(len(yugo(S,0)))
Problem p03471 (python)

Fixed submission:
def abc_exp(a,b,c):
	print(str(a) + ' ' + str(b) + ' ' + str(c) )
	
def exchange(a,b,remain):
	#if remain >= int(a * 2): 
	#	b = b + int(a / 4) * 8
	#	a = a % 4
	while True:
		if remain >= 4 and a - 4 >= 0:
			b = b + 8
			a = a - 4
			remain = remain - 4
		else: 
			break
	return a,b
	

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

a = int(Y/10000)
b = int((Y - a * 10000)/5000)
c = int((Y - a * 10000 - b * 5000)/1000)

max_bills = int(Y/1000)

if (max_bills < N) or (N < a + b + c):
	print('-1 -1 -1')
	
elif (N == max_bills):
	print('0 0 ' + str(max_bills))
	
elif (N == a + b + c):
	abc_exp(a,b,c)

else:
	remain = N - a - b - c
	if remain % 4 == 0:
		a,b = exchange(a,b,remain)
		remain = N - a - b - c
		if not b - remain/4 < 0:
			b = b - int(remain / 4)
			c = c + int(remain / 4) * 5
			abc_exp(a,b,c)
	
	else:
		a = a - (remain % 4)
		b = b + 2 * (remain % 4)
		a , b = exchange(a,b,remain)
		remain = N - a - b - c
		if b - remain/4 >= 0:
			b = b - int(remain / 4)
			c = c + int(remain / 4) * 5
			abc_exp(a,b,c)
		
		else:
			print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
def abc_exp(a,b,c):
	print(str(a) + ' ' + str(b) + ' ' + str(c) )
	
def exchange(a,b,remain):
	if remain > int(a * 2): 
		b = b + int( a / 4) * 8
		a = a % 4
	return a,b
	
while True:
	N,Y = map(int,input().split())
	
	a = int(Y/10000)
	b = int((Y - a * 10000)/5000)
	c = int((Y - a * 10000 - b * 5000)/1000)
	
	max_bills = int(Y/1000)
	
	if (max_bills < N) or (N < a + b + c):
		print('-1 -1 -1')
		
	elif (N == max_bills):
		print('0 0 ' + str(max_bills))
		
	elif (N == a + b + c):
		abc_exp(a,b,c)
	
	else:
		remain = N - a - b - c
		if remain % 4 == 0:
			a,b = exchange(a,b,remain)
			remain = N - a - b - c
			if b - remain/4 > 0:
				b = b - int(remain / 4)
				a = a + int(remain / 4) * 5
				abc_exp(a,b,c)
		
		else:
			a = a - (remain % 4)
			b = b + 2 * (remain % 4)
			a , b = exchange(a,b,remain)
			remain = N - a - b - c
			if b - remain/4 > 0:
				b = b - int(remain / 4)
				c = c + int(remain / 4) * 5
				abc_exp(a,b,c)
Problem p02621 (python)

Fixed submission:
a=int(input())
if(a>=1 and a<=10):
    val=a+(a*a)+(a*a*a)
    print(val)

Buggy submission (verdict: Runtime Error):
a=int(input())
value=a+(a*a)+(a*a*a*)
print(value)
Problem p02621 (python)

Fixed submission:
a = int(input())
print('{0}'.format(a+a*a+a*a*a))

Buggy submission (verdict: Runtime Error):
import argparse

parser = argparse.ArgumentParser()

parser.add_argument('input', metavar='a', type=int)

args = parser.parse_args()

a = args.input

print('{0}'.format(a+a*a+a*a*a))

Buggy submission (verdict: Runtime Error):
import argparse


def main():
    parser = argparse.ArgumentParser()

    parser.add_argument('input', metavar='a', type=int)

    args = parser.parse_args()

    a = args.input

    print('{0}'.format(a+a*a+a*a*a))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import argparse


def main():
    parser = argparse.ArgumentParser()

    parser.add_argument('input', metavar='a', type=int)

    args = parser.parse_args()

    a = args.input

    print('{0}'.format(a+a*a+a*a*a))


if __name__ == '__main__':
    main()
Problem p02660 (python)

Fixed submission:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
n = int(input())
x = factorization(n)
x.sort(key=lambda x: x[-1])
a = [0]
b = 3
for i in range(3,30):
    a.append(b)
    b += i
ans = 0
c = 1
for i in range(len(x)):
    for j in range(len(a)):
        if x[i][1] >= a[c]:
            c += 1
        else:
            break
    ans += c
if n == 1:
    print(0)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
n = int(input())
x = factorization(n)
x.sort(key=lambda x: x[-1])
a = [0]
b = 3
for i in range(3,9):
    a.append(b)
    b += i
ans = 0
c = 1
for i in range(len(x)):
    for j in range(len(a)):
        if x[i][1] >= a[c]:
            c += 1
        else:
            break
    ans += c
if n == 1:
    print(0)
else:
    print(ans)
Problem p02761 (python)

Fixed submission:
n,m = map(int,input().split())
l = []
for i in range(m):
    l.append(list(map(int,input().split())))
ans = -1
if n == 1:
    for i in range(10):
        i = str(i)
        flag = True
        for j in range(m):
            if i[l[j][0]-1] != str(l[j][1]) :
                flag = False
        if flag:
            ans = int(i)
            break
else:
    for i in range(10**(n-1),10**n):
        i = str(i)
        flag = True
        for j in range(m):
            if i[l[j][0]-1] != str(l[j][1]) :
                flag = False
        if flag:
            ans = int(i)
            break
print(ans)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
l = []
for i in range(m):
    l.append(list(map(int,input().split())))
ans = -1
if n == 1:
    for i in range(10):
        i = str(i)
        flag = True
        for j in range(m):
            if i[l[j][0]-1] != str(l[j][1]) :
                flag = False
        if flag:
            ans = int(i)
            break
else:
    for i in range(10**(n-1),10**n):
    i = str(i)
    flag = True
    for j in range(m):
        if i[l[j][0]-1] != str(l[j][1]) :
            flag = False
    if flag:
        ans = int(i)
        break
print(ans)
Problem p02801 (python)

Fixed submission:
import string
s = input()
x = string.ascii_letters
for i in range(len(x)):
    if x[i] == s:
        print(x[i+1])
        break

Buggy submission (verdict: Runtime Error):
import string
s = input()
x = string.ascii_letters
for i in range(len(x)):
    if x[i] == s:
        print(x[i;1])
        break
Problem p02848 (python)

Fixed submission:
N = int(input())
S = list(input())

a = [chr(i) for i in range(65, 65+26)]
b = [chr(i) for i in range(65+N, 65+26)]
for i in range(N):
    b.append(a[i])

a_dict = {}
for i in range(len(a)) :
    a_dict[a[i]] = b[i]
for i in range(len(S)) :
    S[i] = a_dict[S[i]]

print(''.join(S))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [*input()]

a = [chr(i) for i in range(65, 65+26)]
b = [chr(i) for i in range(65+N, 65+26)]
for i in range(N):
    b.append(a[i])

a_dict = {}
for i in range(len(a)) :
    a_dict[a[i]] = b[i]
for i in range(len(S)) :
    S[i] = a_dict[S[i]]

print(''.join(S))
Problem p02882 (python)

Fixed submission:
import math
a,b,x = map(int,input().split())
s = a*a*b
if x*2 < s :
    ans = 90 - math.degrees(math.atan(2*x/(a*b*b)))
elif x == s :
    ans = 0
else :
    ans = 90 - math.degrees(math.atan(a**3/(s-x)/2))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b,x = map(int,input().split())
s = a*a*b
if x*2 < s :
    ans = 90 - math.degrees(math.atan(2*x/(a*b*b)))
elif x**2 == s :
    ans = math.degrees(math.atan(b/a))
else :
    ans = 90 - math.degrees(math.atan(a**3/(s-x)/2))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b,x = map(int,input().split())
s = a*a*b
if x*2 < s :
    ans = 90 - math.degrees(math.atan(2*x/(a*b*b)))
elif x**2 == s :
    ans = 90
else :
    ans = 90 - math.degrees(math.atan(a**3/(s-x)/2))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b,x = map(int,input().split())
s = a*a*b
if x*2 <= s :
    ans = 90 - math.degrees(math.atan(2*x/(a*b*b)))
else :
    ans = 90 - math.degrees(math.atan(a**3/(s-x)/2))
print(ans)
Problem p02898 (python)

Fixed submission:
n,k = map(int,input().split())
a = list(map(int,input().split()))
ans = 0
for m in a :
    if m >= k :
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
k = 0
g = 0
for i in range(1,n+1) :
    if i % 2 == 0:
        g += 1
    else :
        k += 1
print(k/(g+k))
Problem p02924 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
print(int(n*(n-1)/2)
Problem p02995 (python)

Fixed submission:
import fractions
a,b,c,d = map(int,input().split())
x = b//c + b//d - b//(c*d//fractions.gcd(c,d))
y = (a-1)//c + (a-1)//d - (a-1)//(c*d//fractions.gcd(c,d))
print(b-(a-1)-x+y)

Buggy submission (verdict: Runtime Error):
import ractions
a,b,c,d = map(int,input().split())
x = b//c + b//d - b//(c*d//ractions.gcd(c,d))
y = (a-1)//c + (a-1)//d - (a-1)//(c*d//ractions.gcd(c,d))
print(b-(a-1)-x+y)

Buggy submission (verdict: Runtime Error):
import math
a,b,c,d = map(int,input().split())
x = b//c + b//d - b//(c*d//math.gcd(c,d))
y = (a-1)//c + (a-1)//d - (a-1)//(c*d//math.gcd(c,d))
print(b-(a-1)-x+y)
Problem p03000 (python)

Fixed submission:
n,x = map(int,input().split())
l = list(map(int,input().split()))
a =[0]
ans = n+1
for i in range(n):
    s = a[i] + l[i]
    if s > x:
        ans = i+1
        break
    else:
        a.append(s)
print(ans)

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = list(map(int,input().split()))
a =[0]
ans = n+1
for i in range(n):
    s = a[i] + l[i]
    if s > x:
        ans = i+1
    else:
        a.append(s)
print(ans)
Problem p03062 (python)

Fixed submission:
n  = int(input())
a = list(map(int,input().split()))
ans = 0
mn = 0
for i in range(n):
    if a[i] < 0:
        mn += 1
        a[i] = abs(a[i])
    ans += a[i]
if 0 in a or mn%2 == 0:
    print(ans)
else:
    print(ans - 2*min(a))

Buggy submission (verdict: Runtime Error):
n  = int(input())
a = list(map(int,input().split()))
ans = 0
mn = 0
for i in range(n):
    if a[i] < 0:
        mn += 1
        a[i] = abs(a[i])
    ans += a[i]
if 0 in a or mn%2 = 0:
    print(ans)
else:
    print(ans - 2*min(a))
Problem p02621 (python)

Fixed submission:
a=int(input())
 
b=a+(a**2)+(a**3)
print(b)

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

print(int(a+a**2+a**3))
Problem p02639 (python)

Fixed submission:
a,b,c,d,e=(int(x) for x in input().split())
if a==0:
  print(1)
elif b==0:
  print(2)
elif c==0:
  print(3)
elif d==0:
  print(4)
elif e==0:
  print(5)

Buggy submission (verdict: Runtime Error):
a, b, c, d, e=(int(x) in input().split())
list=[a, b, c, d, e]
for num in list:
  if num=1:
    print((list.index(num))+1)

Buggy submission (verdict: Runtime Error):
def sunuke(a, b, c, d, e):
  a, b, c, d, e=(int(x) for x input().split())
  list=[a, b, c, d, e]
  for num in list:
    if num==1:
      print(list.index(num)+1)

Buggy submission (verdict: Runtime Error):
def sunukeaho(a, b, c, d, e):
	input("番号を入力しろ")
    if a==o:
    	print(1)
	elif b==o:
    	print(1)
	elif c==o:
    	print(1)
	elif d==o:
    	print(1)
    elif e==o:
    	print(1)
Problem p02640 (python)

Fixed submission:
a,b=(int(x) for x in input().split())
lista=[]
listb=[]
for numa in range(a+1):
  lista.append(numa*2)
for numb in range(a+1):
  listb.append(numb*4)
listb.reverse()
count=0
combined1 = [x+y for (x, y) in zip(lista, listb)]
for num in combined1:
  if num==b:
    count+=1
if count>0:
  print("Yes")
else: 
  print("No")

Buggy submission (verdict: Runtime Error):
a,b=(int(x) for x in input().split())
lista=[]
listb=[]
for numa in range(a+1):
  lista.append(numa*2)
for numb in range(a+1):
  listb.append(numb*4)
listb.reverse()
count=0
combined1 = [x+y for (x, y) in (lista, listb)]
for num in combined1:
  if num==b:
    count+=1
if count>0:
  print("Yes")
else: 
  print("No")

Buggy submission (verdict: Runtime Error):
a,b=(int(x) for x in input().split())
lista=[]
listb=[]
for numa in range(a+1):
  lista.append(numa*2)
for numb in range(a+1):
  listb.append(numb*4)
listb.reverse()
count=0
combined1 = [x*y for (x, y) in (lista, listb)]
for num in combined1:
  if num==b:
    count+=1
if count>0:
  print("Yes")
else: 
  print("No")

Buggy submission (verdict: Runtime Error):
a,b=(int(x) for x in input().split())
lista=[]
listb=[]
for numa in range(a+1):
  lista.append(numa*2)
for numb in range(a+1)
  listb.append(numb*4)
listb.reverse()
count=0
combined1 = [x*y for (x, y) in (lista, listb)]
for num in combined1:
  if num==b:
    count+=1
if count>0:
  print("Yes")
else: 
  print("No")

Buggy submission (verdict: Runtime Error):
a,b=(int(x) for x in input().split())
lista=[]
listb=[]
for numa in range(a+1):
  lista.append(numa*2)
for numb in range(a+1):
  listb.append(numb*4)
listb.reverse
count=0
combined1 = [x*y for (x, y) in (lista, listb)]
for num in combined1:
  if num==b:
    count+=1
if count>0:
  print("Yes")
else: 
  print("No")

Buggy submission (verdict: Runtime Error):
a,b=(int(x) for x in input().split())
lista=[]
for numa in range(a+1):
  lista.append(numa*2)
for numb in range(a+1).reverse():
  listb.append(numb*4)
count=0
combined1 = [x*y for (x, y) in (lista, listb)]
for num in combined1:
  if num==b:
    count+=1
if count>0:
  print("Yes")
else: 
  print("No")

Buggy submission (verdict: Runtime Error):
a,b=(int(x) for x in input().split())
lista=[range(1,a)]
listb=lista.reverse()
count=0
combined1 = [(2*x) * (4*y) for (x, y) in (lista, listb)]
for num in combined1:
  if num==b:
    count+=1
if count>0:
  print("Yes")
else: 
  print("No")
Problem p02694 (python)

Fixed submission:
x = int(input())

a = 100
i = 0

while a < x:
  i += 1
  a += a // 100
  
  
print(i)

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

a = 100
i = 0

while a < x:
  i += 1
  a += a // 100
  
  
print(math.floor(i))

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

a = 100
i = 0

while a < x:
  i += 1
  a = int(a * 1.01)
  
  
print(math.floor(a))

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

a = 100
i = 0

while a < x:
  i += 1
  a = int(a * 1.01)
  
  
print(math.floor(i))

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

a = 100
i = 0

while a < x:
  i += 1
  a += 1.01
  
  
print(math.floor(i))

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

a = 100
i = 0

while a < x:
  i+ = 1
  a *= 1.01
  
  
print(math.floor(i))

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

a = 100
i = 0

while a < x:
  i+ = 1
  a+ = i
  
  
print(x/i)

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

a = 100
i = 0

while a < x:
  i+ = 1
  a+ = i
  
  
print(i)

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

a = 100
i = 0

while a < X:
  
  i+ = a
  a+ = 1
print(a)

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

a = 100
i = 0

while a < 18:
  print("a="+str(a))
  i+ = a
  a+ = 1

print(x/a)
Problem p02909 (python)

Fixed submission:
S = input()

if S == 'Sunny':
  print('Cloudy')
  
if S == 'Cloudy':
  print('Rainy')
  
if S == 'Rainy':
  print('Sunny')

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

if S == 'Sunny':
  print(Cloudy)
  
if S == 'Cloudy':
  print(Rainy)
  
if S == 'Rainy':
  print(Sunny)

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

if S == 'Sunny':
  print(Cloudy)
  
if S == 'Cloudy':
  print(Rainy)
  
if S == 'Rainy':
  print(Sunny)
Problem p02830 (python)

Fixed submission:
def main():
  a = int(input())
  b = input()
  l = b.split()
  d = a * 2
  str1 = []
  s = "".join(i+j for i, j in zip(l[0],l[1]))
  print(s)
 
if __name__ == '__main__':
  main()

Buggy submission (verdict: Runtime Error):

def main():
  a = int(input())
  b = input()
  l = b.split()
  ll = []
  for i in range(0,a * 2):
    str = (b[0] + b[1])[i::4]
    str1 += str
  print(str1)

if __name__ == '__main__':
  main()
Problem p02621 (python)

Fixed submission:
s = int(input())
print(s+s**2+s**3)

Buggy submission (verdict: Runtime Error):
s= input()
print (s+s**2+s**3)
Problem p02700 (python)

Fixed submission:
t_hp,t_at,a_hp,a_at=map(int,input().split())
while(t_hp > 0 and a_hp > 0):
  a_hp -= t_at
  if a_hp <= 0:
    print("Yes")
    break
  t_hp -= a_at
  if t_hp <= 0:
         print("No")
         break

Buggy submission (verdict: Runtime Error):
t_hp,t_at,a_hp,a_at=input().split()
while(int(t_hp) > 0 and int(a_hp) > 0):
  int(a_hp) -= int(t_at)
  if int(a_hp) <= 0:
    print("Yes")
    break
  int(t_hp) -= int(a_at)
  if int(t_hp <= 0:
         print("No")
         break
Problem p02802 (python)

Fixed submission:
N,M = input().split()
l = [0]*int(N) #flg
m = [0]*int(N) #counter
c =0

for i in range(int(M)):
    p,s = input().split()
    if s =="AC":
        if l[int(p)-1]==1:
            pass
        else:
            l[int(p)-1] = 1
            c += m[int(p)-1]
    elif s == "WA":
        m[int(p)-1] += 1



print(l.count(1),c)

Buggy submission (verdict: Runtime Error):
N,M = input().split()
l = [0]*int(N) #flg
m = [0]*int(N) #counter
c =0

for i in range(int(M)+1):
    p,s = input().split()
    if s =="AC":
        if l[int(p)-1]==1:
            pass
        else:
            l[int(p)-1] = 1
            c += m[int(p)-1]
    elif s == "WA":
        m[int(p)-1] += 1



print(l.count(1),c)
Problem p02677 (python)

Fixed submission:
import math
a,b,h,m=map(int,input().split())
rad=abs(math.radians(30*(h+m/60)-6*m))
# if(rad>180):
#     rad=2*math.pi()-rad
ans=a**2+b**2-2*a*b*math.cos(rad)
print(math.sqrt(ans))

Buggy submission (verdict: Runtime Error):
import math
a=int(input())
b=int(input())
h=int(input())
m=int(input())
rad=abs(math.radians(30*h-6*m))
if(rad>180):
    rad=2*math.pi()-rad
ans=a**2+b**2-2*a*b*math.cos(rad)
print(math.sqrt(ans))
Problem p02621 (python)

Fixed submission:
a = int(input())
print(a +a**2+a**3)

Buggy submission (verdict: Runtime Error):
a = int(input())
res = sum(a +(a**2)+(a**3))
print(res)

Buggy submission (verdict: Runtime Error):
a = int(input())
print(sum(a +(a**2)+(a**3)))
Problem p02628 (python)

Fixed submission:
N , K = map(int, input().split())
l = list(map(int, input().split()))
ll = sorted(l)
res = 0
if N == K :
    res = sum(ll)
elif K==1 : 
    res = ll[0]
else:
    for i in range (K):
        res += ll[i]
print(res)

Buggy submission (verdict: Runtime Error):
N , K = map(N , K = map(int, input().split())
l = list(map(int, input().split()))
l = sorted(l)
res = 0
for i in range (K):
    res += l[i]
print(res)
Problem p02639 (python)

Fixed submission:
x = list(map(int, input().split()))
print((x.index(0))+1)

Buggy submission (verdict: Runtime Error):
    x = list(map(int,input().split()))
    print(x.index(0)+1)
Problem p02639 (python)

Fixed submission:
print(list(map(int,input().split())).index(0)+1)

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


def getNearestValue(list, num):
    """
    概要: リストからある値に最も近い値を返却する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return list[idx]


X, Y = map(int, input().split())
list = list(map(int, input().split()))
list = sorted(list)


listHandred = []
for i in range(0,102):
    listHandred.append(i)
    
ansList = listHandred

for i in list:
    if i in ansList:
        ansList.remove(i)

print(getNearestValue(ansList,X))
Problem p02700 (python)

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

Thit = A
Tatk = B
Ahit = C
Aatk = D
win = False

while True:
    Ahit = Ahit - Tatk
    if Ahit <= 0:
        win = True
        break
    Thit = Thit - Aatk
    if Thit <= 0:
        win = False
        break

if win:
    print("Yes")
else:
    print("No")

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



Thit = A
Tatk = B
Ahit = C
Aatk = D
win = False

while :
    Ahit = Ahit - Tatk
    if Ahit <= 0:
        win = True
        break
    Thit = Thit - Aatk
    if Thit <= 0:
        break

if win:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):

A, B, C, D = map(int, input().split())

Thit = A
Tatk = B
Ahit = C
Aatk = D
Win = False

while Thit < 0 or Ahit < 0:
    Ahit = Ahit - Tatk
    if Ahit < 0:
        win = True
        break
    Thit = Thit - Aatk
    if Thit < 0:
        break

if win:
    print("Yes")
else:
    print("No")
Problem p02705 (python)

Fixed submission:
import math
#数値ひとつ
I = int(input())
#数値欲しいとき
#H, W = map(int, input().split())
#文字欲しいとき
#N = input()
#それをListにしたいとき
#listA = list(N)
a = 0
a = 2*I*3.14
print(a)

Buggy submission (verdict: Runtime Error):
import math
#数値ひとつ
I = int(input())
#数値欲しいとき
#H, W = map(int, input().split())
#文字欲しいとき
#N = input()
#それをListにしたいとき
#listA = list(N)
a = 0
a = 2×I×3.14
print(a)