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

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
b = [0 for i in range(9)]
red = 0
for i in a:
	if i < 400:
		b[0] += 1
	elif i < 800:
		b[1] += 1
	elif i < 1200:
		b[2] += 1
	elif i < 1600:
		b[3] += 1
	elif i < 2000:
		b[4] += 1
	elif i < 2400:
		b[5] += 1
	elif i < 2800:
		b[6] += 1
	elif i < 3200:
		b[7] += 1
	else:
		red += 1
c = 0
for i in b:
	if i > 0:
		c += 1
if c == 0:
	mn = 1
else:
	mn = c
mx = c + red
print (mn, mx)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
a.sort()
b = [0]*8
over = 0

for i in a:
    if i < 400:
        b[0] += 1
    elif i < 800:
        b[1] += 1
    elif i < 1200:
        b[2] += 1
    elif i < 1600:
        b[3] += 1
    elif i < 2000:
        b[4] += 1
    elif i < 2400:
        b[5] += 1
    elif i < 2800:
        b[6] += 1
    elif i < 3200:
        b[7] += 1
    else:
        over += 1

#bの中で、０ではない要素数をカウントする
low = 0
for i in b:
    if i >= 0:
        low += 1

if low == 0:
    mini = 1
else:
    mn = low
mx = c + over
print(mini,mx)
Problem p03712 (python)

Fixed submission:

n,m=map(int,input().split())
s=[input() for i in range(n)]

print("#"*(m+2))
for i in range(n):
  print("#"+s[i]+"#")
print("#"*(m+2))

Buggy submission (verdict: Runtime Error):

h,w = map(int,input().split())
s = [input() for i in range(h)]

print("#" * (w + 2)
for i in range(h):
    print("#" + s[i] + "#")
print("#" * (w + 2))

Buggy submission (verdict: Runtime Error):

h,w = map(int,input().split())
s = [input() for i in range(h)]

print("#" * w + 2)
for i in range(h):
    print("#" + s[i] + "#")
print("#" * w + 2)
Problem p03719 (python)

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

Buggy submission (verdict: Runtime Error):

n,m = map(int,input().split())
s = [[0]*n for _ in range(n)]

for _ in range(m):
    a,b = map(int,input().split())
#    print(a,b)
    s[a-1][b-1] += 1
    s[b-1][a-1] += 1
#    print(s)

for i in range(n):
    print(sum(s[i]))

"""
以下の指定では、一度の値変更で、全ての要素の該当部分の数値が一斉に変わる。
http://delta114514.hatenablog.jp/entry/2018/01/02/233002
n,m = map(int,input().split())
s = [[0]*n]*n
"""
Problem p03721 (python)

Fixed submission:
N, K = map(int, input().split())
cnt = [0]*100001
S = set()
for i in range(N):
  a, b = map(int, input().split())
  cnt[a-1] += b
  S.add(a)

acc = 0
for s in sorted(S):
  acc += cnt[s-1]
  if acc >= K:
    print(s)
    break

Buggy submission (verdict: Runtime Error):

n,k = map(int,input().split())
count = [0]* (10**5+1)
s = set()

for i in range(n):
    a,b = map(int,input().split())
    count[a-1] += b
    s.add(a)
print(s)

x = 0
for s in sorted(S):
    x += count[s-1]
    if x >= k:
        print(s)
        break
Problem p03760 (python)

Fixed submission:

o = list(input())
e = list(input())
ans = []

count = 0

if len(o) > len(e):
    for i in range(len(e)):
        ans.append(o[i])
        ans.append(e[i])
    ans.append(o[-1])
elif len(o) < len(e):
    for i in range(len(o)):
        ans.append(o[i])
        ans.append(e[i])
    ans.append(e[-1])
else:
    for i in range(len(o)):
        ans.append(o[i])
        ans.append(e[i])

print("".join(ans))

Buggy submission (verdict: Runtime Error):

o = list(input())
e = list(input())
ans = []

count = 0

for i in range(len(o)):
        ans.append(o[i])
        ans.append(e[i])
if len(o) != len(e):
    ans.append(e[-1])

print("".join(ans))
Problem p03763 (python)

Fixed submission:

from collections import Counter

N = int(input())
S = [input() for _ in range(N)]
cl = [Counter(s) for s in S]

ans = ""
for i in range(26):
  s = chr(ord("a")+i)
  val = min([c[s] for c in cl])
  ans += s*val
print(ans)

Buggy submission (verdict: Runtime Error):

n = int(input())
s = [input() for _ in range(n)]
t = []
for i in range()



from collections import Counter

N = int(input())
S = [input() for _ in range(N)]
cl = [Counter(s) for s in S]

ans = ""
for i in range(26):
  s = chr(ord("a")+i)
  val = min([c[s] for c in cl])
  ans += s*val
print(ans)
Problem p03796 (python)

Fixed submission:

n = int(input())
ans = 1

for i in range(1,n+1):
    ans *= i
    ans = ans % (10**9 + 7)

print(ans)

Buggy submission (verdict: Runtime Error):

n = int(input())
power = 1

for i in range(1,n+1):
    power *= i
    ans = ans % (10**9 + 7)

print(ans)
Problem p03852 (python)

Fixed submission:

l = ["a","e","i","o","u"]
c = input()

if c in l:
    print("vowel")
else:
    print("consonant")

Buggy submission (verdict: Runtime Error):

l = ["a","b","c","d","e"]
c = input()

if c in l:
    print("vowel")
else:
    prin("consonant")
Problem p03856 (python)

Fixed submission:

S = input()
S = S[::-1]

l = ['maerd','remaerd','esare','resare']
i = 0
while i < len(S):
    for w in l:
        if w == S[i:i+len(w)]:
            i += len(w)
            break
    else:
        print('NO')
        exit()
print('YES')

Buggy submission (verdict: Runtime Error):

s = input()
l = ["eraser","erase","dreamer","dream"]

while len(s) > 0:
    for i in range(len(l)):
        if l[i] in s:
            s = s.replase(l[i],"")
        else:
            break
            
if len(s) == 0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):

s = input()
l = ["dream","dreamer","erase","eraser"]

while len(s) > 0:
    for i in range(len(l)):
        if l[i] in s:
            s = s.replase(l[i],"")
        else:
            break
            
if len(s) == 0:
    print("YES")
else:
    print("NO")
Problem p03993 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
  j=a[i]-1
  if a[j]==i+1:
    ans+=1
print(ans//2)

Buggy submission (verdict: Runtime Error):

n = int(input())
a = list(map(int,input()))
ans = 0

for i in range(n):
    j = a[i] -1
    if a[j] == i + 1:
        ans += 1
        print(ans // 2)
Problem p04039 (python)

Fixed submission:
n,m = input().split()
k=int(n)
li = list(input().split())

for i in range(k,100000):
    for e in li:
        if e in str(i):
            break
    else:
        print(i)
        break

Buggy submission (verdict: Runtime Error):

n,m = input().split()
k = int(n)
l = list(input().split())

for i in range(k,100000):
    for x in l:
        for x str(i):
            break
    else:
        print(i)
        break

Buggy submission (verdict: Runtime Error):

n,m = input().split()
k = int(n)
l = list(input().split())

for i in range(k,100000):
    for x in l:
        for y str(i):
            break
    else:
        print(i)
        break
Problem p02705 (python)

Fixed submission:
import math

R = input()

print(2 * float(R) * math.pi)

Buggy submission (verdict: Runtime Error):
import math

print(2 * math.pi * input())

Buggy submission (verdict: Runtime Error):
import math

print(2 * pi * input())

Buggy submission (verdict: Runtime Error):
import math

R = input()

try:
    R = int(R)
except:
    pass

if R =< 100 and R >= 1:
    print(R*2*pi)

Buggy submission (verdict: Runtime Error):
import math

R = input()

try:
    R = int(R)
except:
    pass

if R =< 100 and R >= 1:
    return R*2*pi

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

if R >= 1 and R =< 100;
	return 2*R*pi
else:
  pass
Problem p02706 (python)

Fixed submission:
N, M = map(int, input().split())
A = input().split()
A_int = [int(n) for n in A]

rest = N - sum(A_int)
if rest >= 0:
  print(rest)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
A = []

N = input()
M = input()
for i in range(M):
  A = A.append(input())
rest = N - sum(A)

if rest >= 0:
  print(rest)
else:
  print(-1)
Problem p02681 (python)

Fixed submission:
a = input()
b = input()
if len(a)+1 == len(b):
  if b[0:len(b)-1] == a:
    print("Yes")
  else:
    print("No")
else:
  print("No")

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

a = list(map(int,input().split()))

loop = False
count = 0
visited = []
i = 1
while(count != k):
	if i in visited: break
	visited.append(i)
	i = a[i-1]
	count += 1
print(visited)
if(count != k):
	itr = k%count
	print(visited[itr])
	# count = 0
	# i = 0
	# while(count != itr):
	# 	i = a[i-1]
	# 	count += 1
	# print(i,visited)
else:
	print(visited[len(visited)-1])
Problem p02681 (python)

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

TT = T[:-1]



if S == TT:
    print("Yes")
else:
    print("No")

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

l = []
kari = 1


for i in range(N*2):
    l.append(A[kari-1])
    kari = A[kari-1]
    
    zyuuhuku = set(l)
    if len(zyuuhuku) != len(l):
        tometatokoro = A[kari-1]
        break
    


    
    

#繰り返しでもどったところの列番号
aaaa = l.index(tometatokoro)

#繰り返すループの長さ
kurikaesi = len(l)-aaaa

#ループ繰り返す余り
ans = K % kurikaesi


ans = ans + aaaa

#print(l)
#print(ans)
print(l[ans])
Problem p02780 (python)

Fixed submission:
N,K = map(int,input().split())
P = list(map(float,input().split()))

wa = float(0)
for i in range(K):
    wa = wa + P[i]

ans = wa 
  
repeat = N-K
for i in range(repeat):
    wa = wa + P[i+K]-P[i]
    if ans <= wa :
        ans = wa
      
print(ans/2+(K*0.5))

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



PP = P *0.5+0.5

ans = float(0)
final = 0
repeat = N-K+1
for j in range(repeat):
    ans = 0
    for i in range(K):
        ans = ans+PP[i+j]
        if final <= ans :
            final = ans
        
print(final)

Buggy submission (verdict: Runtime Error):
N,K = map(float,input().split())
P = list(map(float,input().split()))


Psoat = sorted(P, reverse=True)

ans = 0
for i in range(K):
    ans = ans+Psoat[i]*0.5+0.5
    

print(ans)
Problem p02848 (python)

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


N = int(N)
Len = len(S)#文字数の長さ
LIST = list(S)#文字列を1文字ごとに分割する。

ANSWER = ""
#リストの中身をループ
for SS in LIST:
    NUNBER = ord(SS)#アスキーコードを出す組み込み関数:1文字しか対応していない
    NUNBER = NUNBER -65#アスキーコードからアルファベット順に変更
    AFFTER = NUNBER + N
    LAST  = AFFTER % 26
    LAST  = chr(LAST+65)#アスキーコードからアルファベットに戻す
    ANSWER = ANSWER + LAST
    
print(ANSWER)

Buggy submission (verdict: Runtime Error):


N= input()
S= input()







Len = len(S)#文字数の長さ
LIST = list(S)#文字列を1文字ごとに分割する。

ANSWER = ""
#リストの中身をループ
for SS in LIST:
    NUNBER = ord(SS)#アスキーコードを出す組み込み関数:1文字しか対応していない
    NUNBER = NUNBER -65#アスキーコードからアルファベット順に変更
    AFFTER = NUNBER + N
    LAST  = AFFTER % 26
   # if LAST == 0:
    #    LAST = 26
    LAST  = chr(LAST+65)#アスキーコードからアルファベットに戻す
    ANSWER = ANSWER + LAST
    
print(ANSWER)

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



Len = len(S)#文字数の長さ
LIST = list(S)#文字列を1文字ごとに分割する。

ANSWER = ""
#リストの中身をループ
for SS in LIST:
    NUNBER = ord(SS)#アスキーコードを出す組み込み関数:1文字しか対応していない
    NUNBER = NUNBER -64#アスキーコードからアルファベット順に変更
    AFFTER = NUNBER + N
    LAST  = AFFTER % 26
    if LAST == 0:
        LAST = 26
    LAST  = chr(LAST+64)#アスキーコードからアルファベットに戻す
    ANSWER = ANSWER + LAST
    
print(ANSWER)

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



Len = len(S)#文字数の長さ
LIST = list(S)#文字列を1文字ごとに分割する。

ANSWER = ""
#リストの中身をループ
for SS in LIST:
    NUNBER = ord(SS)#アスキーコードを出す組み込み関数:1文字しか対応していない
    NUNBER = NUNBER -64#アスキーコードからアルファベット順に変更
    AFFTER = NUNBER + N
    LAST  = AFFTER % 26
    if LAST == 0:
        LAST = 26
    LAST  = chr(LAST+64)#アスキーコードからアルファベットに戻す
    ANSWER = ANSWER + LAST
    
print(ANSWER)

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

Len = len(S)#文字数の長さ
LIST = list(S)#文字列を1文字ごとに分割する。

ANSWER = ""
#リストの中身をループ
for SS in LIST:
    NUNBER = ord(SS)#アスキーコードを出す組み込み関数:1文字しか対応していない
    NUNBER = NUNBER -64#アスキーコードからアルファベット順に変更
    AFFTER = NUNBER + N
    LAST  = AFFTER % 26
    LAST  = chr(LAST+64)#アスキーコードからアルファベットに戻す
    ANSWER = ANSWER + LAST
    
print(ANSWER)
Problem p02705 (python)

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

Buggy submission (verdict: Runtime Error):
a=int(input())
print(2a*3.1415926535)
Problem p02786 (python)

Fixed submission:
h=int(input())
a=1

if h ==1:
 print(1)
else:
 while True:
  h=h//2
  a+=1
  if h//2==0:
   break

 print(2**a-1)

Buggy submission (verdict: Runtime Error):
h=int(input())
a=0
while True:
 h=h//2
 a+=1
 if =h//2==0:
  break

print(2**a-1)
Problem p02885 (python)

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

if a-2*b>=0:
  print(a-2*b)
else:
  print(0)

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

if a-2b>=0:
  print a-2b
else:
  print 0
Problem p03101 (python)

Fixed submission:
H,W=map(int,input().split())
h,w=map(int,input().split())
X=(H-h)*(W-w)
print(X)

Buggy submission (verdict: Runtime Error):
H,W=map(int,input().split())
h,w=map(int,input().split())
X=(H-h)*(W-w)
print(x)
Problem p03433 (python)

Fixed submission:
n=int(input())
a=int(input())
if a >= n%500:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n,a=map(int,input().split())
if a >= n%500:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n,a=map(int,input().split())
if a>=(n%500):
  print('Yes')
else:
  print('No')
Problem p03657 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a%3 ==0:
  print('Possible')
elif b%3 ==0:
  print('Possible')
elif (a+b)%3 ==0:
  print('Possible')
else
  print('Impossible')
Problem p02687 (python)

Fixed submission:
S = str(input())
if S == "ARC":
  print("ABC")
else:
  print("ARC")

Buggy submission (verdict: Runtime Error):
S = str(input())
if S = "ABC":
  print("ARC")
else:
  print("ABC")
Problem p02705 (python)

Fixed submission:
import math

r = int(input())

print(r * 2 * math.pi)

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

data = list(map(int,input().split()))

total = 0

for i in range(count):
    a =data.count(i + 1)
    print(a)
    if total + a+1 == count:
        print("0 \n" *(count - i))
        break

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

data = list(map(int,input().split()))

total = 0

for i in range(count):
    a =data.count(i + 1)
    print(a)
    if total + a+1 == count:
        print("0 \n" *(count - i))
        break
Problem p02681 (python)

Fixed submission:
S = list(map(str, input().split()))[0]
T = list(map(str, input().split()))[0]

if (abs(len(T) - len(S)) == 1) and (T[:-1] == S):
    print("Yes")
else:
    print("No")

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

out = []
for i in [A,B,C]:
    if(i <= K):
        out.append(i)
        K = (K - i) if (K - i) >= 0 else K
    else:
        out.append(((K - i) if (K - i) > 0 else K))

# if len(out) < 3:
#     for i in range(3 - len(out)):
#         out.append(0)

print(1*out[0] + 0*out[1] + (-1)*out[2])

Buggy submission (verdict: Runtime Error):
S, T = list(map(str, input().split()))

if (abs(len(T) - len(S)) == 1) and (T[:-1] == S):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import sys, os, time, math
import numpy as np
from collections import deque
from functools import reduce
import itertools, math

# print("Start")
S, T = list(map(str, input().split()))
# N = int(input())

if (abs(len(T) - len(S)) == 1) and (T[:-1] == S):
    print("Yes")
else:
    print("No")
Problem p02755 (python)

Fixed submission:
from math import *
A,B=list(map(int, input().split()))
x=ceil(max(A/0.08,B/0.1))
y=min((A+1)/0.08,(B+1)/0.1)
if x<y:
    print(x)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
from math import *
A,B=list(map(input().split()))
x=ceil(max(A/0.08,B/0.1))
y=min((A+1)/0.08,(B+1)/0.1)
if x<y:
  print(x)
else:
  print(-1)
Problem p03035 (python)

Fixed submission:
A, B = map(int, input().split())
if A >= 13:
  print(B)
elif A >= 6:
  print(B//2)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
r, D, x = map(int, input().split())
for i in range(10):
  x = r*x-D
  print(x)
Problem p03243 (python)

Fixed submission:
print((1+((int(input())-1))//111)*111)

Buggy submission (verdict: Runtime Error):
print((1+(int(input()-1)//111))*111)
Problem p03434 (python)

Fixed submission:
n=int(input())
a=[int(i) for i in input().split()]
a.sort(reverse=True)
b=0
c=0
if n%2==0:
    for i in range(n//2):
        b+=a[2*i]
        c+=a[2*i+1]
else:
    for i in range(n//2):
        b+=a[2*i]
        c+=a[2*i+1]
    b+=a[n-1]
if b>c:
    print(b-c)
else:
    print(c-a)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[int(i) for i in input().split()]
a.sort(reverse=True)
b=0
c=0
if n%2==0:
    for i in range(n//2):
        b+=a[2*i]
        c+=a[2*i+1]
else:
    for i in range(n//2):
        b+=a[2*i]
        c+=a[2*i+1]
    b+=a[n]
if b>c:
    print(b-c)
else:
    print(c-a)
Problem p03478 (python)

Fixed submission:
n,a,b=map(int,input().split())
c=[i+1 for i in range(n)]
d=[i+1 for i in range(n)]
e=0
for i in range(n):
    d[i]=c[i]%10+(c[i]//10)%10+(c[i]//100)%10+(c[i]//1000)%10+(c[i]//10000)%10
    if d[i]>=a and d[i]<=b:
        e+=c[i]
print(e)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
c=[i+1 for i in range(n)]
e=0
for i in range(n):
    d[i]=c[i]%10+(c[i]//10)%10+(c[i]//100)%10+(c[i]//1000)%10+(c[i]//10000)%10
    if d[i]>=a and d[i]<=b:
        e+=c[i]
print(e)

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
c=[i+1 for i in range(n)]
e=0
for i in range(n):
    d[i]=c[i]%10+(c[i]//10)%10+(c[i]//100)%10+(c[i]//1000)%10+(c[i]//10000)%10
    if d[i]>=a and d[i]<=b:
        e+=c[i]
        print(c[i],e)
print(e)
Problem p02687 (python)

Fixed submission:
s = input()
if s == "ABC":
  print("ARC")
else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
s = input()
if s == "ABC":
  print("ARC")
  else if:
    print("ABC")
Problem p02694 (python)

Fixed submission:
X = int(input())
count = 0
money = 100

while True:
  money = int(money * 1.01)
  count += 1
  if money >= X:
    print(count)
    break

Buggy submission (verdict: Runtime Error):
X = int(input())
count = 0
money = 100

while Ture:
  money = int(money * 1.01)
  count += 1
  if money >= X:
    print(count)
    break

Buggy submission (verdict: Runtime Error):
X = int(input())
count = 0
money = 100

while Ture:
  money *= 1.01
  count += 1
  if money >= X:
    print(count)
    break

Buggy submission (verdict: Runtime Error):
X = int(input())
count = 0
money = 100

while money < X:
  money *= 1.01
  count++

print(count)

Buggy submission (verdict: Runtime Error):
K = int(input())
count = 0
money = 100

while money < X:
  money *= 1.01
  count += 1

print(count)

Buggy submission (verdict: Runtime Error):
K = int(input())
count = 0
money = 100

while money < X:
  money *= 1.01
  count++

print(count)

Buggy submission (verdict: Runtime Error):
K = int(input())
count = 0
money = 100

while(money < X):
  money *= 1.01
  count++

print(count)
Problem p02706 (python)

Fixed submission:
N,M = map(int, input().split())
A = list(map(int, input().split()))
N -= sum(A)
if N >= 0:
  print(N)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
N,M = map(int, input().split())
A = [0] * M
for i in M:
  A[i] = int(input())
  N -= A[i]

if N < 0:
  N = -1

print(N)
Problem p02717 (python)

Fixed submission:
a,b,c = map(int, input().split())
a,b,c = c,a,b
print("{} {} {}".format(a,b,c))

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
a,b,c = c,a,b
print(f"{a} {b} {c}")
Problem p02718 (python)

Fixed submission:
N,M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
S = sum(A)
if A[M-1] >= S/(4*M):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N,M = map(int, input().split())
A = map(int, input().split())
A.sort(reverse=True)
S = sum(A)
if A[M-1] >= S/(4*M):
  print("Yes")
else:
  print("No")
Problem p02801 (python)

Fixed submission:
word = input()
word_list = [chr(ord('a') + i) for i in range(26)]
print(word_list[word_list.index(word) + 1])

Buggy submission (verdict: Runtime Error):
nm = list(map(int, (input().split())))
if nm[1] == 0:
    print(0, 0)

else:    
    ans_dict = {}
    ans_list = [input().split() for i in range(nm[1])]
    for i in range(len(ans_list)):
        key_val = ans_list[i][0]

        try:
            ans_dict[key_val].append(ans_list[i][1])
        except:
            ans_dict[key_val] = [ans_list[i][1]]
    ans_cnt = 0
    wa_cnt = 0
    for key_val in ans_dict.keys():
        check_list = ans_dict[key_val]

        if "AC" in check_list:
            ans_cnt += 1
        else:
            pass
        try:
            wa_cnt += len(check_list[:check_list.index("AC")])
        except:
            pass
print(ans_cnt, wa_cnt)
Problem p02802 (python)

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

else:    
    ans_dict = {}
    ans_list = [input().split() for i in range(nm[1])]
    for i in range(len(ans_list)):
        key_val = ans_list[i][0]

        try:
            ans_dict[key_val].append(ans_list[i][1])
        except:
            ans_dict[key_val] = [ans_list[i][1]]
    ans_cnt = 0
    wa_cnt = 0
    for key_val in ans_dict.keys():
        check_list = ans_dict[key_val]

        if "AC" in check_list:
            ans_cnt += 1
        else:
            pass
        try:
            wa_cnt += len(check_list[:check_list.index("AC")])
        except:
            pass
    print(ans_cnt, wa_cnt)

Buggy submission (verdict: Runtime Error):
nm = list(map(int, (input().split())))
if nm[1] == 0:
    print(0, 0)

else:    
    ans_dict = {}
    ans_list = [input().split() for i in range(nm[1])]
    for i in range(len(ans_list)):
        key_val = ans_list[i][0]

        try:
            ans_dict[key_val].append(ans_list[i][1])
        except:
            ans_dict[key_val] = [ans_list[i][1]]
    ans_cnt = 0
    wa_cnt = 0
    for key_val in ans_dict.keys():
        check_list = ans_dict[key_val]

        if "AC" in check_list:
            ans_cnt += 1
        else:
            pass
        try:
            wa_cnt += len(check_list[:check_list.index("AC")])
        except:
            pass
print(ans_cnt, wa_cnt)

Buggy submission (verdict: Runtime Error):
nm = list(map(int, (input().split())))
if nm[1] == 0:
    print(0, 0)

else:    
    ans_dict = {}
    ans_list = [input().split() for i in range(nm[1])]
    for i in range(len(ans_list)):
        key_val = ans_list[i][0]

        try:
            ans_dict[key_val].append(ans_list[i][1])
        except:
            ans_dict[key_val] = [ans_list[i][1]]
    ans_cnt = 0
    wa_cnt = 0
    for key_val in ans_dict.keys():
        check_list = ans_dict[key_val]

        if "AC" in check_list:
            ans_cnt += 1
        else:
            pass
        try:
            check_list.index("AC")
            wa_cnt += len(check_list[:check_list.index("AC")])
        except:
            pass
print(ans_cnt, wa_cnt)
Problem p02911 (python)

Fixed submission:
import numpy as np
nkq = list(map(int, (input().split())))
ans = [int(input()) for i in range(nkq[2])]
total = nkq[1] - nkq[2]
hold_point = np.array([total]*nkq[0])
for i in ans:
    hold_point[i - 1] += 1
for i in hold_point:
    if i <= 0:
        print('No')
    else:
        print('Yes')

Buggy submission (verdict: Runtime Error):
import numpy as np
nkq = list(map(int, (input().split())))
ans = [int(input()) for i in range(nkq[2])]
total = nkq[1] - nkq[2]
hold_point = np.array([total]*nkq[0])
for i in ans:
    hold_point[i - 1] += 1
for i in hold_point:
    if i <= 0:
        print('No')
    else:
        print('Yes')
Problem p02971 (python)

Fixed submission:
n = int(input())
hoge = [int(input()) for i in range(n)]
max_value = max(hoge)
second_value = sorted(hoge)[-2]
if max_value == second_value:
    for i in range(len(hoge)):
        print(max_value)
else:
    for i in hoge:
        if i != max_value:
            print(max_value)
        else:
            print(second_value)

Buggy submission (verdict: Runtime Error):
n = int(input())
hoge = [int(input()) for i in range(n)]

for i in range(len(hoge)):
    temp = hoge.copy()
    del temp[i]
    print(pd.array(temp).max())