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

Fixed submission:
lines = [input().split() for i in range(3)]
 
num = int(input())
bs = []
for i in range(num):
  bs.append(input())
 
hits = []
for i in bs:
  for row_index in range(len(lines)):
    for col_index in range(len(lines[row_index])):
      if lines[row_index][col_index] == i:
        hits.append((row_index,col_index))
row_hits = [0,0,0]
col_hits = [0,0,0]
stride_hits = [0,0]
 
for hit in hits:
  r = hit[0]
  c = hit[1]
  row_hits[r]+=1
  col_hits[c]+=1
  if r == c:
    stride_hits[0]+=1
  if (r,c) == (0,2) or (r,c) == (1,1) or (r,c) == (2,0) :
    stride_hits[1]+=1
 
if max(row_hits)>= 3 or max(col_hits)>=3 or max(stride_hits)>= 3:
  print ('Yes')
else:
  print ('No')

Buggy submission (verdict: Runtime Error):
lines = [input().split() for i in range(3)]
 
num = int(input())
bs = []
for i in range(num):
  bs.append(input())
 
hits = []
for i in bs:
  for row_index in range(len(lines)):
    for col_index in range(len(line)):
      if lines[row_index][col_index] == i:
        hits.append((row_index,col_index))
row_hits = (0,0,0)
col_hits = (0,0,0)
stride_hits = (0,0)
 
for hit in hits:
  r = hit[0]
  c = hit[1]
  row_hits[r]+=1
  col_hits[c]+=1
  if r == c:
    stride_hits[0]+=1
  else if (r,c) == (0,2) or (r,c) == (1,1) or (r,c) == (2,0) :
    stride_hits[1]+=1
 
if max(row_hits)>= 3 or max(col_hits)>=3 or max(stride_hits)>= 3:
  print 'Yes'
else:
  print 'No'

Buggy submission (verdict: Runtime Error):
lines = [input().split() for i in range(3)]

num = int(input())
bs = []
for i in range(num):
  bs.append(input())

hits = []
for i in bs:
  for row_index in range(len(lines)):
    for col_index in range(len(line)):
      if lines[row_index][col_index] == i:
        hits.append((row_index,col_index))
row_hits = (0,0,0)
col_hits = (0,0,0)
stride_hits = (0,0)

for hit in hits:
  r = hit[0]
  c = hit[1]
  row_hits[r]++
  col_hits[c]++
  if r == c:
    stride_hits[0]++
  else if (r,c) == (0,2) or (r,c) == (1,1) or (r,c) == (2,0) :
    stride_hits[1]++

if max(row_hits)>= 3 or max(col_hits)>=3 or max(stride_hits)>= 3:
  print 'Yes'
else:
  print 'No'
Problem p02812 (python)

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

print(S.count("ABC"))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [c  for c in input()]

count = 0

for i in range(N):
  if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C" and i+2 <= N:
    count += 1

print(count)
Problem p02922 (python)

Fixed submission:
a,b = map(int,input().split())
outlet = 1
ans = 0
while outlet < b:
  outlet -= 1
  outlet += a
  ans += 1
  
print(ans)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
outlet = 1
ans = 0
while outlet < B:
  outlet -= 1
  outlet += a
  ans += 1
  
print(ans)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
ans = round((a-1)/(b-1))  
print(ans)
Problem p02971 (python)

Fixed submission:
n=int(input())
a=[int(input())for _ in range(n)]
b=sorted(a) # sortする降順に

for a in a:print(b[(a<b[-1])-2])

Buggy submission (verdict: Runtime Error):
n = int(input())
list = []
for i in range(0,n):
  list.append(int(input()))
  
new_list = sorted(list, reverse=True)
print lst in new_list:
  print(lst)
Problem p03145 (python)

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

print((int)(a*b/2))

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

print((int)a*b/2)
Problem p03206 (python)

Fixed submission:
input = (int)(input())
 
if input == 22:
  print("Christmas Eve Eve Eve")
elif input == 23:
  print("Christmas Eve Eve")
elif input == 24:
  print("Christmas Eve")
elif input == 25:
  print("Christmas")
else:
  print(null)

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

if input == 22:
  print("Christmas Eve Eve Eve")
else if input == 23:
  print("Christmas Eve Eve")
else if input == 24:
  print("Christmas Eve")
else if input == 25:
  print("Christmas")
else:
  print(null)
Problem p02761 (python)

Fixed submission:
N, M = input().split(" ")
N = int(N)
M = int(M)
s_list = []
c_list = []
for i in range(M):
    si, ci = input().split(" ")
    s_list.append(int(si))
    c_list.append(int(ci))
num = ["0" for i in range(N)]
is_break = False
for si, ci in zip(s_list, c_list):
    if num[si-1] != "0" and num[si-1] != str(ci):
        print(-1)
        is_break = True
        break
    elif N > 1 and si == 1 and ci == 0:
        print(-1)
        is_break = True
        break
    else:
        num[si-1] = str(ci)
if not is_break:
    num = "".join([val for val in num])
    if int(num[0]) or N == 1:
        print(int(num))
    else:
        print(int("1" + num[1:]))

Buggy submission (verdict: Runtime Error):
N, M = input().split(" ")
N = int(N)
M = int(M)
s_list = []
c_list = []
for i in range(M):
    si, ci = input().split(" ")
    s_list.append(int(si))
    c_list.append(int(ci))
num = ["0" for i in range(N)]
for si, ci in zip(s_list, c_list):
    if num[si-1] != "0" and num[si-1] != str(ci):
        print(-1)
        is_break = True
        break
    elif N > 1 and si == 1 and ci == 0:
        print(-1)
        is_break = True
        break
    else:
        num[si-1] = str(ci)
if not is_break:
    num = int("".join([val for val in num]))
    if num:
        print(num)
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
N, M = input().split(" ")
N = int(N)
M = int(M)
s_list = []
c_list = []
for i in range(M):
    si, ci = input().split(" ")
    s_list.append(int(si))
    c_list.append(int(ci))

num = ["0" for i in range(N)]
is_num = [0 for i in range(N)]
is_break = False
for si, ci in zip(s_list, c_list):
    if num[si-1] != "0" and num[si-1] != str(ci):
        print(-1)
        is_break = True
        break
    else:
        num[si-1] = str(ci)
        num[si-1] = 1
if not is_break:
    num = int("".join([val for val in num]))
    if num:
        print(num)
    elif is_num[-1] == 0:
        print(1)
    else:
        print(0)
Problem p02772 (python)

Fixed submission:
import numpy as np
 
N = int(input())
A = input().split()
A = np.array([int(val) for val in A])
 
A_even = set(A[A%2==0])
A_three = set(A[A%3==0])
A_five = set(A[A%5==0])
 
A_approve = A_even & (A_three | A_five)
 
if A_even == A_approve:
    print('APPROVED')
else:
    print('DENIED')

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

N = int(input())
A = np.array([int(val) for val in A])

A_even = set(A[A%2==0])
A_three = set(A[A%3==0])
A_five = set(A[A%5==0])

A_approve = A_even & (A_three | A_five)

if A_even == A_approve:
    print('APPROVED')
else:
    print('DENIED')
Problem p02803 (python)

Fixed submission:
from collections import deque


def dfs(maze, start):
    move = [(0, 1), (1, 0), (0, -1), (-1, 0)]
    q = deque([(0, start)])
    dist = [[-1] * w for _ in range(h)]

    depth, i, j = -1, -1, -1

    while q:
        depth, (i, j) = q.popleft()
        if dist[i][j] != -1:
            continue
        dist[i][j] = depth
        for di, dj in move:
            ni, nj = i + di, j + dj

            if (not 0 <= ni < h) or (not 0 <= nj < w):
                continue

            if maze[ni][nj] == "#" or dist[ni][nj] != -1:
                continue

            q.append((depth + 1, (ni, nj)))

    return depth, i, j


h, w = list(map(int, input().split()))

maze = []

for _ in range(h):
    maze.append(input())

answer = 0

for i in range(h):
    for j in range(w):
        if maze[i][j] == ".":
            depth, i, j = dfs(maze, (i, j))
            answer = max(answer, depth)

print(answer)

Buggy submission (verdict: Runtime Error):
from collections import deque


def dfs(maze, start):
    move = [(0, 1), (1, 0), (0, -1), (-1, 0)]
    q = deque([0, start])
    dist = [[-1] * w for _ in range(h)]

    depth, i, j = -1, -1, -1

    while q:
        depth, (i, j) = q.popleft()
        if dist[i][j] != -1:
            continue
        dist[i][j] = depth
        for di, dj in move:
            ni, nj = i + di, j + dj

            outside = not 0 <= ni < h or not 0 <= nj < w
            is_wall = maze[ni][nj] == "#"
            visited = dist[ni][nj] != -1

            if outside or is_wall or visited:
                continue

            q.append((depth + 1, (ni, nj)))

    return depth, i, j


h, w = list(map(int, input().split()))

maze = []

for _ in range(h):
    maze.append(input())

answer = 0

for i in range(h):
    for j in range(w):
        if maze[i][j] == ".":
            depth, i, j = dfs(maze, (i, j))
            answer = max(answer, depth)

print(answer)
Problem p02882 (python)

Fixed submission:
import math

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

x /= a  # focus on the rectangle a * b

if a * b / 2 > x:
    c = 2 * x / b
    answer = math.degrees(math.atan(b / c))
    print(answer)
else:
    rest = a * b - x
    c = 2 * rest / a
    answer = math.degrees(math.atan(c / a))
    print(answer)

Buggy submission (verdict: Runtime Error):
import math

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

x /= a  # focus on the rectangle a * b

if a * b / 2 > x:
    c = 2 * x / b
    answer = math.degrees(math.atan2(b / c))
    print(answer)
else:
    rest = a * b - x
    c = 2 * rest / a
    answer = math.degrees(math.atan2(c / a))
    print(answer)
Problem p03000 (python)

Fixed submission:
def main():
    n, x = list(map(int, input().split()))
    ls = list(map(int, input().split()))

    count = 1
    d = 0
    for i in range(n):
        d = d + ls[i]
        if d > x:
            break
        else:
            count += 1

    print(count)


main()

Buggy submission (verdict: Runtime Error):
def main():
    n, x = list(map(int, input().split()))
    ls = list(map(int, input().split()))

    count = 1
    d = 0
    for i in range(n + 1):
        d = d + ls[i]
        if d > x:
            break
        else:
            count += 1

    print(count)


main()
Problem p03061 (python)

Fixed submission:
from fractions import gcd  # in math module python >= 3.5


def main():
    n = int(input())
    a = list(map(int, input().split()))
    if len(a) < 3:
        print(max(a))
        return

    ls = []
    for i in range(n+1):
        if i == 0:
            ls.append(0)
        else:
            ls.append(gcd(ls[i-1], a[i-1]))

    rs = []
    for i in range(n+1):
        if i == 0:
            rs.append(0)
        else:
            rs.append(gcd(rs[i-1], a[-i]))
    rs = list(reversed(rs)) + [0]

    m = [gcd(ls[i], rs[i+1]) for i in range(n+1)]

    print(max(m))


main()

Buggy submission (verdict: Runtime Error):
from fractions import gcd  # in math module python >= 3.5
from functools import reduce


def gcdall(numlist):
    return reduce(gcd, numlist)


def main():
    _ = int(input())
    a = list(map(int, input().split()))
    if len(a) < 3:
        print(max(a))
        return

    a = list(set(map(int, input().split())))
    if len(a) < 3:
        print(max(a))
        return

    gcds = []
    for i in range(len(a)):
        excepted = [a[j] for j in range(len(a)) if j != i]
        b = 0
        while all([k % 2 == 0 for k in excepted]):
            b += 1
            excepted = [k // 2 for k in excepted]

        if b > 0:
            gcds.append(gcdall(excepted) * 2 * b)
        else:
            gcds.append(gcdall(excepted))
    print(max(gcds))


main()
Problem p03062 (python)

Fixed submission:
def main():
    n = int(input())
    aa = list(map(int, input().split()))

    pos = [0] * n
    neg = [0] * n

    pos[0] = aa[0]
    neg[0] = -aa[0]

    for i, a in enumerate(aa[1:-1], start=1):
        pos[i] = max(pos[i - 1] + a, neg[i - 1] - a)
        neg[i] = max(pos[i - 1] - a, neg[i - 1] + a)

    pos[n - 1] = pos[n - 2] + aa[n - 1]
    neg[n - 1] = neg[n - 2] - aa[n - 1]

    score = max(pos[n - 1], neg[n - 1])

    print(score)


main()

Buggy submission (verdict: Runtime Error):


def main():
    n = int(input())
    a = list(map(int, input().split()))

    def dp(i, j):
        if i == 0 and j == 0:
            return 0
        if i == 0 and j == 1:
            return -float('inf')
        if j == 0:
            return max(dp(i - 1, 0) + a[i - 1], dp(i - 1, 1) - a[i - 1])
        if j == 1:
            return max(dp(i - 1, 0) - a[i - 1], dp(i - 1, 1) + a[i - 1])

    score = dp(n, 0)

    print(score)


main()
Problem p04044 (python)

Fixed submission:
# 入力
N,L=map(int,input().split())

l=[]
for i in range(N):
  l.append(input())

# ソート
l.sort()

# 出力
print(''.join(l))

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
P = [input() for i in range(L)]
P.sort()
print("".join(P))

Buggy submission (verdict: Runtime Error):

alpha = [chr(ord('a') + i) for i in range(26)]
# print(alpha)

N, L = map(int, input().split())
P = [input().split() for i in range(L)]

scores = []

for word in P:
    score = 0
    for t in word[0]:
        score += alpha.index(t)
    scores.append({"word": word[0], "score": score})

sorted_dict_list = sorted(scores, key=lambda x:x['score'])

out_str = ""
for d in sorted_dict_list:
    out_str += d["word"]
print(out_str)

Buggy submission (verdict: Runtime Error):

alpha = [chr(ord('a') + i) for i in range(26)]
# print(alpha)
N, L = map(int, input().split())
P = [input().split() for i in range(L)]

scores = []

for word in P:
    score = 0
    for t in word[0]:
        score += alpha.index(t)
    scores.append({"word": word[0], "score": score})

sorted_dict_list = sorted(scores, key=lambda x:x['score'])

out_str = ""
for d in sorted_dict_list:
    out_str += d["word"]
print(out_str)
Problem p02844 (python)

Fixed submission:
import sys

def is_password(s, p):
    check = s.find(p[0])
    idx = check + 1
    if check == -1:
        return False
    check = s[idx:].find(p[1])
    if check == -1:
        return False
    idx = idx + check + 1
    check = s[idx:].find(p[2])
    if check == -1:
        return False
    return True

f = sys.stdin
n = int(f.readline())
s = f.readline()[:-1]

count = 0
for l1 in range(10):
    for l2 in range(10):
        for l3 in range(10):
            p = str(l1) + str(l2) + str(l3)
            if is_password(s, p):
                count += 1

print(count)

Buggy submission (verdict: Runtime Error):
import sys
from collections import defaultdict
from itertools import combinations

def n_cmb(n, r):
    from math import factorial
    return factorial(n) / factorial(r) / factorial(n - r)

f = sys.stdin
n = int(f.readline())
s = f.readline()[:-1]

duplicates = defaultdict(list)
for idx, v in enumerate(s):
    duplicates[v].append(idx)
print(duplicates)
n_duplicates = 0
for key in duplicates:
    # import pdb
    # pdb.set_trace()
    idxs = duplicates[key]
    n_idxs = len(idxs)
    if n_idxs > 3:
        n_duplicates += n_cmb(n_idxs - 3, 1)
    if n_idxs == 1:
        continue
    for i in range(n_idxs-1):
        for j in range(i+1, n_idxs):
            m = idxs[i] + n - idxs[j] - 1
            if m < 2:
                continue
            n_duplicates += n_cmb(m, 2)
print(n_cmb(n, 3))
print(n_duplicates)
result = n_cmb(n, 3) - n_duplicates

print(result)
Problem p02910 (python)

Fixed submission:
import numpy as np

S = input()
 
S = np.array( [S[i] for i in range(len(S))] )
 
if (S[0::2]=='L').any():
  print('No')
elif (S[1::2]=='R').any():
  print('No')
else:
  print('Yes')

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

S = np.array( [S[i] for i in range(len(S))] )

if (S[0::2]=='L').any():
  print('No')
elif (S[1::2]=='R').any():
  print('No')
else:
  print('Yes')
Problem p03359 (python)

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

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

if a =< b:
  print(a)
else:
  print(a-1)
Problem p02789 (python)

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

if N==M:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N=int(input())
P = list(map(int,input().split()))
ans=0
 
 
for i in range(N):
    if min(P[:i+1])==P[i]:
      ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
P = list(map(int,input().split()))
ans=0
 
 
for i in range(N):
    if min(P[:i+1])==P[i]:
        ans+=1
print(ans)
Problem p02791 (python)

Fixed submission:
N=int(input())
P = list(map(int,input().split()))
ans=0
m=P[0]
 
for i in range(N):
    if m >= P[i]:
        ans += 1
        m = P[i]

print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
P = list(map(int,input().split()))
ans=0
m=P[0]

for i in P:
	if m >= i:
    	ans += 1
   		m = i
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
P = list(map(int,input().split()))
ans=0
m=10*10

for i in range(N):
    if min(m,p[i])==P[i]:
        ans+=1
        m=P[i]
print(ans)
Problem p02885 (python)

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

if A>B*2:
    print(A-B*2)

else:
    print(0)

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

if A>B*2:
    print(A-B*2)
if A=B*2:
    print(0)
if A<B*2:
    print(0)
Problem p02911 (python)

Fixed submission:
N,K,Q=map(int, input().split())

list=[(K-Q) for j in range(N)]

for i in range(Q):
    a=int(input())-1
    list[a]+=1

for score in list:
    if 0<score:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
N,K,Q=map(int, input().split())
 
list=[(K-Q) for j in range(N)]
 
for i in range(Q):
	A=int(input())-1
  	list[A]+=1
 
for score in list:
  	if score>0:
      	print("Yes")
	else:
      	print("No")

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

list=[(K-Q) for i in range(N)]

for i in range(Q):
	A=int(input())-1
  	list[A]+=1

for score in list:
  	if score>0:
      	print("Yes")
	else:
      	print("No")
Problem p02765 (python)

Fixed submission:
n,r = map(int,input().split())

if n >= 10:
  print(r)
else:
  print(r+100*(10-n))

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

if n >= 10:
  print(k)
else:
  print(r+100*(10-n))
Problem p02934 (python)

Fixed submission:
N=int(input())
num2=input().split(" ")
num3=list(map(int,num2))
sum=0
for i in range(N):
  	sum+=1/num3[i]
print(1/sum)

Buggy submission (verdict: Runtime Error):
N=int(input())
num2=input().split(" ")
num3=list(map(int,num2))
sum=0
fori in range(N):
  	sum+=1/num[i]
print(sum)
Problem p02797 (python)

Fixed submission:
N, K, S = map(int, input().split())

if S == 10**9:
    ans = [S for _ in range(K)] + [1] * (N - K)
else:
    ans = [S for _ in range(K)] + [S + 1] * (N - K)

print(' '.join(map(str, ans)))

Buggy submission (verdict: Runtime Error):
N, K, S = map(int, input().split())
 
ans = []

if S == 10**9:
    ans = [S for _ in range(K)] + [1] * (N - K)
else:
    ans = [S for _ in range(K)] + [S + 1] * (N - K)

print(' '.join(map(str, result)))

Buggy submission (verdict: Runtime Error):
N, K, S = map(int, input().split())
 
ans = []

if S == 10**9:
    ans = [s for _ in range(K)] + [1] * (N - K)
else:
    ans = [s for _ in range(K)] + [S + 1] * (N - K)

print(' '.join(map(str, result)))
Problem p03162 (python)

Fixed submission:
N = int(input())
P = []

for _ in range(N):
    P.append(list(map(int, input().split())))

dp = [[0 for _ in range(3)] for _ in range(10**5)]

for i in range(N):
    for j in range(3):
        for k in range(3):
            if k == j:
                continue
            dp[i][k] = max(dp[i][k], dp[i-1][j] + P[i][k])
            
print(max(dp[N-1]))

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

for _ in range(N):
    P.append(list(map(int, input().split())))

dp = [[0 for _ in range(3)] for _ in range(1000)]

for i in range(N):
    for j in range(3):
        for k in range(3):
            if k == j:
                continue
            dp[i][k] = max(dp[i][k], dp[i-1][j] + P[i][k])
            
print(max(dp[N-1]))
Problem p03455 (python)

Fixed submission:
a,b=map(int,input().split())
p = a*b % 2
if p == 0 :
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
ans = a*b
if ans % 2 = 0:
    print("Even")
else:
    print("Odd")
Problem p02761 (python)

Fixed submission:
N, M = map(int, input().split())
num = [None] * (N)
ans = ''
for _ in range(M):
    x, y = map(int, input().split())
    if num[x-1] == None:
        num[x-1] = str(y)
    elif num[x-1] != str(y):
        ans = -1
        break

if ans == -1:
    print(ans)
elif len(num) >= 2 and num[0] == '0':
    print(-1)
elif len(num) >= 2 and num[0] == None:
    for i in range(N):
        if i == 0:
            ans += '1'
        else:
            if num[i] == None:
                ans += '0'
            else:
                ans += num[i]
    print(ans)
else:
    for i in num:
        if i == None:
            ans += '0'
        else:
            ans += i
    print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
num = [None] * (N)
ans = ''
for _ in range(M):
    x, y = map(int, input().split())
    if num[x-1] == None:
        num[x-1] = str(y)
    elif num[x-1] != str(y):
        ans = -1
        break

if ans == -1:
    print(ans)
elif len(num) >= 2 and num[0] == '0':
    print(-1)
elif len(num) >= 2 and num[0] == None:
    for i in range(N):
        if i == 0:
            ans += '1'
        else:
            if i == None:
                ans += '0'
            else:
                ans += i
    print(ans)
else:
    for i in num:
        if i == None:
            ans += '0'
        else:
            ans += i
    print(ans)
Problem p02789 (python)

Fixed submission:
n, m = input().split()
if n == m :
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
li = list(map(int,input().split()))
icount = 0
for i in range(n):
    if li[i] == min(li[0:i+1]):
        icount += 1
print(icount)
Problem p02791 (python)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
count = 1
min_p = p[0]
for i in range(n):
    if min_p > p[i]:
        count += 1
        min_p = p[i]
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
li = list(map(int,input().split()))
icount = 0
for i in range(n):
    if li[i] == min(li[0:i]):
        icount += 1:
print(icount)
Problem p02801 (python)

Fixed submission:
c = input()
a_list= list('abcdefghijklmnopqrstuvwxyz')
for i in range(0, len(a_list)):
    if a_list[i] == c:
        i += 1
        print(a_list[i])

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
ac = [0] * n
pen = [0] * n
pen_count = 0
for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if ac[p] == "AC":
        continue
    elif s == "AC":
        ac[p] = "AC"
    else:
        pen[p] += 1
 
for i in range(n):
    if ac[i] == "AC":
        pen_count += pen[i]
 
print(ac.count("AC"), pen_count)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
ac = [0] * n
pen = [0] * n
pen_count = 0
for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if ac[p] == "AC":
        continue
    elif s == "AC":
        ac[p] = "AC"
    else:
        pen[p] += 1

for i in range(n):
    if ac[i] == "AC":
        pen_count += pen[i]

print(ac.count("AC"), pen_count)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split()) #n:問題数 m:提出回数
ac = [0] * n
pen = [0] * n
pen_count = 0
for i in range(m):
    p, s = input().split()#p = 1, s = "WA"
    p = int(p) - 1
    if ac[p] == "AC":
        continue
    elif s == "AC":
        ac[p] = "AC"
    else:
        pen[p] += 1

for i in range(n):
    if ac[i] == "AC":
        pen_count += pen[i]

print(ac.count("AC"), pen_count)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
ac = [0] * n
pen = [0] * n
pen_count = 0
for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if ac[p] == "AC":
        continue
    elif s == "AC":
        ac[p] = "AC"
    else:
        pen[p] += 1

for i in range(m):
    if ac[i] == "AC":
        pen_count = pen[i]

print(ac.count("AC"), pen_count)