TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
alpha2num=lambda c:ord(c)-ord('a')+1

result=(alpha2num(input()))
print(result)
if result==1:
    print('b')
elif result==2:
    print('c')
elif result==3:
    print('d')
elif result==4:
    print('e')
elif result==5:
    print('f')
elif result==6:
    print('g')
elif result==7:
    print('h')
elif result==8:
    print('i')
elif result==9:
    print('j')
elif result==10:
    print('k')
elif result==11:
    print('l')
elif result==12:
    print('m')
elif result==13:
    print('n')
elif result==14:
    print('o')
elif result==15:
    print('p')
elif result==16:
    print('q')
elif result==17:
    print('r')
elif result==18:
    print('s')
elif result==19:
    print('t')
elif result==20:
    print('u')
elif result==21:
    print('v')
elif result==22:
    print('w')
elif result==23:
    print('x')
elif result==24:
    print('y')
elif result==25:
    print('z')


n, m = list(map(int, input().split()))

ac = [0] * (n+1)
wa = [0] * (n+1)
pena = 0

for i in range(m):
    question, answer = input().split()
    question = int(question)
    if (answer == "AC") and (ac[question] == 0):
        ac[question] = 1
        pena += wa[question]
    elif (answer == "WA") and (ac[question] == 0):
        wa[question] += 1

print(sum(ac), pena)

alpha2num=lambda c:ord(c)-ord('a')+1

result=(alpha2num(input()))

if result==1:
    print('b')
elif result==2:
    print('c')
elif result==3:
    print('d')
elif result==4:
    print('e')
elif result==5:
    print('f')
elif result==6:
    print('g')
elif result==7:
    print('h')
elif result==8:
    print('i')
elif result==9:
    print('j')
elif result==10:
    print('k')
elif result==11:
    print('l')
elif result==12:
    print('m')
elif result==13:
    print('n')
elif result==14:
    print('o')
elif result==15:
    print('p')
elif result==16:
    print('q')
elif result==17:
    print('r')
elif result==18:
    print('s')
elif result==19:
    print('t')
elif result==20:
    print('u')
elif result==21:
    print('v')
elif result==22:
    print('w')
elif result==23:
    print('x')
elif result==24:
    print('y')
elif result==25:
    print('z')


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
h,a=map(int,input().split())
print(-(-h//a))

print(chr(ord(input())+1))

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
n = input()
print(n,'is followed by',chr(ord(n) + 1))

n = input()
a='funcionaaaaaaaaaaa'
print(chr(ord(n) + 1))

Verdicts: Wrong Answer

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
n, m = map(int, input().split())

ac = 0
wa = [0]*n
d = [False]*n

for _ in range(m):
    p, s = input().split()
    p = int(p)-1
    if not d[p] and s == 'AC':
        ac += 1
        d[p] = True
    elif not d[p] and s == 'WA':
        wa[p] += 1
p = 0
for i in range(n):
    if d[i]:
        p += wa[i]
print(ac, p)

c = input()
print(chr(ord(c)+1))

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
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)    

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

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
import sys, string
c = sys.stdin.readline().rstrip()
a = string.ascii_lowercase
i = a.index('c') + 1
print(a[i])


import sys, string
c = sys.stdin.readline().rstrip()
a = string.ascii_lowercase
i = a.index(c) + 1
print(a[i])

Verdicts: Wrong Answer

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
from collections import deque

def search(h, w, pre_h, pre_w):
    can = []
    if h > 0:
        can.append((h-1, w))
    if h < H-1:
        can.append((h+1, w))
    if w > 0:
        can.append((h, w-1))
    if w < W-1:
        can.append((h, w+1))
    res = []
    for h, w in can:
        if S[h][w]=='.' and (h, w) != (pre_h, pre_w):
            res.append((h, w))
    return res

def bfs(h, w):
    d = [[float('inf') for _ in range(W)] for _ in range(H)]
    d[h][w] = 0
    pre_h, pre_w = h, w
    adj_list = search(h, w, pre_h, pre_w)
    open_list = deque([])
    closed_list = []
    closed_list = set(closed_list)
    for adj in adj_list:
        open_list.append((adj[0], adj[1], pre_h, pre_w))
    cnt = 0
    while True:
        cnt+=1
        if H==20 and W==20:
            if cnt > 2200:
                break
        if len(open_list) == 0:
            break
        h, w, pre_h, pre_w = open_list.popleft()
        closed_list.add((h, w, pre_h, pre_w))
        d[h][w] = min(d[h][w], d[pre_h][pre_w] + 1)
        adj_list = search(h, w, pre_h, pre_w)
        for adj in adj_list:
            if (adj[0], adj[1], h, w) in closed_list:
                continue
            open_list.append((adj[0], adj[1], h, w))

    res = 0
    for h in range(H):
        for w in range(W):
            if not d[h][w] == float('inf'):
                res = max(res, d[h][w])
    return res

def bounday():
    for h in range(H):
        for w in range(W):
            if S[h][w] == '#':
                return False
    return True

H, W = map(int, input().split())
S = []
for i in range(H): 
    S.append(list(input()))

if __name__ == "__main__":

    if bounday():
        print(H+W-2)
        exit(0)

    ans = 0
    for h in range(H):
        for w in range(W):
            if S[h][w] == '#':
                continue
            maxd = bfs(h, w)
            ans = max(maxd, ans)
    print(ans)

c = input()
print(chr(ord(c) + 1))

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
import sys

x = sys.argv[1]

y = ord(x)
y += 1
x = chr(y)
print(x)

params = input().split(' ')
n = eval(params[1])
 
acfoundfor = []
 
penalties = 0
points = 0
 
for i in range(n):
    submission = input().split(' ')
    p = eval(submission[0])
    status = submission[1]
    
    if p in acfoundfor:
        continue
 
    if status == 'AC':
        points += 1
        acfoundfor.append(p)
    else:
        penalties += 1
        
print(points, penalties)

x = input()
y = ord(x)
y += 1
x = chr(y)
print(x)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
c = input()
import string
alphStr = string.ascii_lowercase
print(alphStr.index(c)[alph+1])


c = input()
import string
alphStr = string.ascii_lowercase
print(alphStr[alphStr.index(c)+1])


Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
s = int(input())
print(str(ord(s)+1))

l = a = [chr((ord("a") + i)) for i in range(26)]
print(l[l.index(input())-25])

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
C = input()

c_l = [chr(i) for i in range(65, 65+26)]

for i in range(len(c_l)):
  if c_l[i] == C:
    print(c_l[i+1])

C = input()

c_l = [chr(i) for i in range(97, 97+26)]

for i in range(len(c_l)):
  if c_l[i] == C:
    print(c_l[i+1])

Verdicts: Wrong Answer

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
al = abcdefghijklmnopqrstuvwxyz
C = input()
print(al[al.index(C)+1])

al = "abcdefghijklmnopqrstuvwxyz"
C = input()
print(al[al.index(C)+1])

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
C = input()
lis = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
       'p', 'q', 'r', 's', 't'. 'u', 'v', 'w', 'x', 'y', 'z']
for x in range(len(lis)):
  if C == lis[x]:
    print(lis[x+1])
    break

C = input()
lis = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
       'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for x in range(len(lis)):
  if C == lis[x]:
    print(lis[x+1])
    break

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
from sys import stdin
input = stdin.readline()
alpha = 'abcdefghijklmnopqrstuvwxyz'

flag = False
for i in alpha:
    if flag:
        print(i)
        flag =False
    if i == input:
        flag = True

from sys import stdin
input = stdin.readline().rstrip()
alpha = 'abcdefghijklmnopqrstuvwxyz'

flag = False
for i in alpha:
    if flag:
        print(i)
        flag =False
    if i == input:
        flag = True

Verdicts: Wrong Answer

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
n,k,m = map(int,input().split())
a = list(map(int,input().split()))

t = n*m - sum(a)
if 0<=t<=k:
 print(t)
if  k<t:
 print(-1)
else:
 print(0

print(chr(ord(input())+1))

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
c = int(input())
C = ord(c)
print(chr(C))

c = input()
C = ord(c)
print(chr(C+1))

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
l = list("abcdefghijklmnopqrstuvwxyz")
a = input()
print(l[l.index(a)])


l = list("abcdefghijklmnopqrstuvwxyz")
a = input()
print(l[l.index(a)+1])


Verdicts: Wrong Answer

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
import sys
input = sys.stdin.readline

c = input()
print(chr(ord(c)+1))

import sys
input = sys.stdin.readline

c = input()
print(chr(ord(c)+1))

import sys
input = sys.stdin.readline

c = input()
print(chr(ord(c)+1))

import sys
input = sys.stdin.readline

c = input()
ans = ord(c)+1
print(chr(ans))

import sys
input = sys.stdin.readline

c = input()
print(chr(ord(c)+1))

print(chr(ord(input())+1))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
C=input()
alp=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
x=alp.index(C)
print(alp[x+1])

C=input()
alp=list("abcdefghijklmnopqrstuvwzyz")
x=alp.index(C)
print(alp[x+1])

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
C = input()

abc ='abcdefghijklmnopqrstuvwxyz'

print(abc[abc.index(C+1))]

C = input()

abc ='abcdefghijklmnopqrstuvwxyz'

print(abc[abc.index(C) +1])


Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
char = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
print(char[char.index(input())])


char = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
print(char[char.index(input()) + 1])

Verdicts: Wrong Answer

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
# !/usr/bin/python3




if __name__ == "__main__":
    n, m = list(map(int, input().split()))

    accepted = [False for _ in range(n+5)]
    wrong = [0 for _ in range(n+5)]
    ac = wa = 0

    for _ in range(m):
        p, s = input().split()
        p = int(p)

        if accepted[p]: continue
        elif s == "WA": wrong[p] += 1
        elif s == "AC":
            ac += 1
            wa += wrong[p]
            accepted[p] = True

    print(ac, wa)



# !/use/bin/python3



def solve(c):
    print(c)
    ans = ord(c)
    return chr(ans+1)

if __name__ == "__main__":
    c = input()
    print(solve(c))


# !/use/bin/python3



def solve(c):
    ans = ord(c)
    return chr(ans+1)

if __name__ == "__main__":
    c = input()
    print(solve(c))


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
C=input()
CN=ord(C)
print(C+" is followed by "+chr((CN)+1)+".")

n = str(input())
a = string.ascii_lowercase.index(n) 
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
print (n,'is followed by',letters[a+1])


C= input ()
print (chr (ord (C)+1))

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
C = input()

print(chr(ord(C)+1)

C = input()

print(chr(ord(C)+1)

C = input()

print(chr(ord(C)+1))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
N,K,M=map(int,input().split())
l = input().split()
L = [int(i) for i in l]

Lsum=sum(L)

if M*N-Lsum>K:
    print(-1)
elif M*N-Lsum<0:
    print(0)
else:
    print(M*N-Lsum)


print(chr(ord(input())+1))

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
print(input() + 1)

print(str(ord(input())+1))

print(chr(ord(input())+1))

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
mod=10**9+7
n,k=map(int,input().split())
l=sorted(map(int,input().split()))
ans=0
ll=1
ans+=ll*l[k-1]%mod
b,s=1,1
for i in range(k,n):
  ll=ll*i//(i-k+1)
  ans+=l[i]*ll%mod
  s*=i
  b*=(i-k+1)
ml=s//b

ans-=ml*l[0]
ans%=mod
for i in range(1,n-k+1):
  ml=ml*(n-i-k+1)//(n-i)
  ans-=ml*l[i]%mod

print(ans%mod)


s=input()
l="abcdefghijklmnopqrstuvwxyz"
print(l[l.index(s)+1])

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
n, m = map(int, input().split())
li = []
seitou = 0
penalty = 0

if m == 0:
    print(0, 0)

else:
    for x in range(m):
        i, j = map(str, input().split())
        if i in li:
            pass
        else:
            if j == "WA":
                penalty += 1
            if j == "AC":
                li.append(i)
                seitou += 1

    print(seitou, penalty)

n, k, m = map(int, input().split())
li = list(map(int, input().split()))
genzai = sum(li)
mokuhyou = n*m
theta = mokuhyou-genzai
if theta > k:
    print(-1)
elif k >= theta:
    print(theta)
elif theta < 0:
    print(0)

x = str(input())
alph = 'abcdefghijklmnopqrstuvwxyz'
a = alph.find(x) + 1
b = alph[a]
print(b)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
print(chr(ord(int(input())) + 1))

print(chr(ord(input()) + 1))

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
n, k, m = map(int, input().split())
a = list(map(int, input().split()))
count = 0
total_score = 0
while count <= n - 2:
  total_score += a[count]
  count += 1 
last_score = n * m - total_score
if last_score < 0:
  print(0) 
else:
  print(last_score)

c = input()
alp = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
count1 = 0
count2 = 0
while count2 <= 26:
  if alp[count1] == c:
     count1 += 1
     count2 += 27
  else:
    count1 += 1
    count2 += 1
print(alp[count1])

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):


c = raw_input()



ls = [chr(ord('a') + i) for i in range(26)]

for i in range(len(ls)):
    if ls[i] == c:
        print(ls[i + 1])
        break



import string

c = raw_input()



ls = string.ascii_lowercase

for i in range(len(ls)):
    if ls[i] == c:
        print(ls[i + 1])
        break





c = input()



ls = [chr(ord('a') + i) for i in range(26)]

for i in range(len(ls)):
    if ls[i] == c:
        print(ls[i + 1])
        break



Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
print chr(ord(input())+1)

print(chr(ord(input()) + 1))

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
c=input()
l="qwertyuioplkjhgfdsazxcvbnm"
l.sort()
print(l[l.index(c)+1])

c=input()
print(chr(ord(c)+1))

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
alphabet = map(str,input().split())
if alphabet == "a":
	print("b")

elif alphabet == "b":
	print("c")

elif alphabet == "c":
	print("d")

elif alphabet == "d":
	print("e")

elif alphabet == "e":
	print("f")

elif alphabet == "f":
	print("g")

elif alphabet == "g":
	print("h")

elif alphabet == "h":
	print("i")

elif alphabet == "i":
	print("j")

elif alphabet == "j":
	print("k")

elif alphabet == "k":
	print("l")

elif alphabet == "l":
	print("m")

elif alphabet == "m":
	print("n")

elif alphabet == "n":
	print("o")

elif alphabet == "o":
	print("p")

elif alphabet == "p":
	print("q")

elif alphabet == "q":
	print("r")

elif alphabet == "r":
	print("s")

elif alphabet == "s":
	print("t")

elif alphabet == "t":
	print("u")

elif alphabet == "u":
	print("v")

elif alphabet == "v":
	print("w")

elif alphabet == "w":
	print("x")

elif alphabet == "x":
	print("y")

elif alphabet == "y":
	print("z")



alphabet = str(input())
if alphabet == "a":
	print("b")
elif alphabet == "b":
	print("c")
elif alphabet == "c":
	print("d")
elif alphabet == "d":
	print("e")
elif alphabet == "e":
	print("f")
elif alphabet == "f":
	print("g")
elif alphabet == "g":
	print("h")
elif alphabet == "h":
	print("i")
elif alphabet == "i":
	print("j")
elif alphabet == "j":
	print("k")
elif alphabet == "k":
	print("l")
elif alphabet == "l":
	print("m")
elif alphabet == "m":
	print("n")
elif alphabet == "n":
	print("o")
elif alphabet == "o":
	print("p")
elif alphabet == "p":
	print("q")
elif alphabet == "q":
	print("r")
elif alphabet == "r":
	print("s")
elif alphabet == "s":
	print("t")
elif alphabet == "t":
	print("u")
elif alphabet == "u":
	print("v")
elif alphabet == "v":
	print("w")
elif alphabet == "w":
	print("x")
elif alphabet == "x":
	print("y")
elif alphabet == "y":
	print("z")



Verdicts: Wrong Answer

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
A=int(input())
print(chr(B+1))

A=int(input())
print("A+1")

A=int(input())
B=chr(A+1)
print("" + B)

A=chr(input())
print(chr(B+1))

A=ord(input())
print(chr(A+1))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):


C = input()
C_asc ord(C)
ret = chr(C_asc + 1)
print(ret)



C = input()
C_asc = ord(C)
ret = chr(C_asc + 1)
print(ret)




Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
import string

AL = string.lowercase

C = input()
idx = AL.find(C)
idy = (idx + 1) % 26
print(AL[idy])


import sys
from string import ascii_lowercase as a2z

input = sys.stdin.readline


def main():
    C = input().rstrip()

    i = a2z.index(C)
    ans = a2z[i + 1]
    print(ans)


if __name__ == "__main__":
    main()


Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
c = input()
s = 'abcdefghijklmnopqrstuvwxyz'
flg = True
while flg:
    if c == s[i] and c != 'z':
        print(s[i + 1])
        flg = False
    elif c == 'z':
        print('a')
        flg = False

c = input()
s = 'abcdefghijklmnopqrstuvwxyz'
flg = True
while flg:
    if c == s[i] and c != 'z':
        print(s[i + 1])
        flg = False
    elif c == 'z':
        print('a')
        flg = False

C = input()

print(chr(ord(C[0]) + 1))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
if __name__=="__main__":
    n, m = map(int, input().split())
    p, s=[], []
    for i in range(m):
        pin, sin = map(str, input().split())
        p.append(int(pin))
        s.append(sin)

    cnt_wa = 0
    cnt_ac = 0
    pfin = 0
    for i in range(m):
        if pfin < p[i]:
            if s[i]=="WA":  
                cnt_wa += 1
            else:
                cnt_ac += 1
                pfin = p[i]
                if pfin==n:
                    break
        
    print("{} {}".format(cnt_ac, cnt_wa))

abts = "abcdefghijklmnopqrstuvwxyz"
cin = str(input())
for i in range(len(abts)):
  if cin == abts[i]:
    print(abts[i+1])

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
C = input()
k = [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]
for i in range(len(k)):
  if C == k[i]:
    print(k[i+1])


C = input()
k = [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,g]
for i in range(len(k)):
  if C == k[i]:
    print(k[i+1])

from intertools import chain
from collections import deque
H, W = map(int,input().split())
S = [list(map(str,input().split())) for _ in range(H)]
dhw = [[0,1],[0,-1],[1,0],[-1,0]]

ans = 0
for h in range(H):
  for w in range(W):
    d = deque([h,w])
    maze = [[-1] * W for _ in range(H)]
    if S[h][w] == '#':
      continue
    maze[h][w] = 0
    while d:
      ht , hw = d.popleft()
      for dh, dw in dhw:
        nh = ht + dh
        nw = wt + dw
        if 0 <= nh < H and 0 <= nw < W:
          if maze[nh][nw] == -1 and S[nh][nw] == '.':
            d.append([nh,nw])
            maze[nh][nw] = maze[ht][wt] + 1
    ans = max(ans,max(chain(*maze))
print(ans)


C = input()
k = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
for i in range(len(k)):
  if C == k[i]:
    print(k[i+1])


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
N, M = map(int, input().split())
A = {}
ac = []
total=0
count = 0
for i in range(M):
    p, s = map(str, input().split())
    if int(p) not in ac:
        if int(p) not in A.keys(): 
            if int(p) >0 and int(p) <=N :
                if s == "WA":
                    A[int(p)] =1
                elif s =="AC":
                    A[int(p)] =0
                    ac.append(int(p))
        elif int(p) in A.keys():
            if s == "WA":
                    A[int(p)] +=1
            elif s =="AC":
                    A[int(p)] +=0
                    ac.append(int(p))
                    count += 1
                    total += A[int(p)]

print(count,total)

c = str(input())
d=int(ord(c)+1)
print(chr(d))

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
from collections import defaultdict
N, M = map(int, input().split())
P = []
S = []
for i in range(M):
  p, s = input().split()
  P.append(int(p))
  S.append(s)
d = defaultdict(int)
d1 = defaultdict(int)
for i in range(M):
  if S[i] == "WA":
    if d[P[i]] != 1:
      d1[P[i]] += 1
  elif S[i] == "AC":
    d[P[i]] = 1
for i in range(M):
  if d[P[i]] == 0 and d1[P[i]] > 0:
    d1[P[i]] = 0
print(sum(d.values()), sum(d1.values()))

c=input()
l = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
for i in range(len(l)):
  if l[i] == c:
    print(l[i+1])

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
N, M = input().split(" ")

idxw = {}
idxa = {}

for i in range(int(M)):
  p, s = input().split(" ")
  if not ('{}{}'.format(p,s) in idxa):
    if s == 'AC':
      idxa['{}{}'.format(p, s)] = True
  if not ('{}{}'.format(p,s) in idxw):
    if not ('{}{}'.format(p,'AC') in idxa):
      if s == 'WA':
        idxw['{}{}'.format(p, s)] = True
#print(idxw)
#print(idxa)

print('{} {}'.format(len(idxa), len(idxw)))
  

C = input()

a = 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,w,v,x,y,z'

arr = a.split(",")

idx = 0
count = 0

for i in arr:
  if i == C:
    idx = count
  count += 1
  
print(arr[idx+1])

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
C = input()
print chr(ord(C) + 1)

C = input()
print(chr(ord(C) + 1))

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
list_alpha = [chr(ord('a') + i) for i in range(26)]
c = input()
index = list_alpha.find(c)
print(list_alphs[index + 1])

list_alpha = [chr(ord('a') + i) for i in range(26)]
c = input()
index = list_alpha.index(c)
print(list_alpha[index + 1])

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
n=int(input())
x=[0]*n
y=[0]*n
for i in range(n):
  x[i],y[i]=map(int,input().split())
if n==2:
  print(((x[0]-x[1])**2+(y[0]-y[1])**2)**(1/2)/2)
else:
  ans=10**5
  A=[0]*3
  B=[0]*3
  for i in range(n-2):
    for j in range(i+1,n-1):
      A[0]=x[j]-x[i]
      A[1]=y[j]-y[i]
      A[2]=A[0]*(x[i]+x[j])/2+A[1]*(y[i]+y[j])/2
      for k in range(j+1,n):
        B[0]=x[k]-x[i]
        B[1]=y[k]-y[i]
        B[2]=B[0]*(x[i]+x[k])/2+B[1]*(y[i]+y[k])/2
        if A[0]*B[1]==A[1]*B[0] and A[0]*B[1]!=0:
          r=((max(x[i],x[j],x[k])-min(x[i],x[j],x[k]))**2+(max(y[i],y[j],y[k])-min(y[i],y[j],y[k]))**2)**(1/2)/2
          xc=(max(x[i],x[j],x[k])+min(x[i],x[j],x[k]))/2
          yc=(max(y[i],y[j],y[k])+min(y[i],y[j],y[k]))/2
        elif A[0]==B[0]==0:#2
          r=(max(y[i],y[j],y[k])-min(y[i],y[j],y[k]))/2
          xc=x[i]
          yc=(max(y[i],y[j],y[k])+min(y[i],y[j],y[k]))/2
        elif A[1]==B[1]==0:#3
          r=(max(x[i],x[j],x[k])-min(x[i],x[j],x[k]))/2
          yc=y[i]
          xc=(max(x[i],x[j],x[k])+min(x[i],x[j],x[k]))/2
        else:
          xc=(A[2]*B[1]-A[1]*B[2])/(A[0]*B[1]-A[1]*B[0])
          yc=(A[0]*B[2]-A[2]*B[0])/(A[0]*B[1]-A[1]*B[0])
          r=((x[i]-xc)**2+(y[i]-yc)**2)**(1/2)
        aa=0
        r=min(r*1.000000999,r+0.000000999)
        for l in range(n):
          if ((x[l]-xc)**2+(y[l]-yc)**2)**(1/2)>r:
            aa=1
        if aa==0:
          if r<ans:
            ans=r
  print(ans)

print(chr(ord(input())+1))

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
N=input()
L=[a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]
print(L[L.index(N)+1])

N=input()
L=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
print(L[L.index(N)+1])  

Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
list1 = [chr(i) for i in range(97, 97+26)]
i = input()
print(list1[list1.index('i')+1])

list1 = [chr(i) for i in range(97, 97+26)]
i = input()
print(list1[list1.index(i)+1])

Verdicts: Wrong Answer

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
n,k,m = map(int, input().split())
a = input().split()
a = [int(_a) for _a in a]
ans = m*n - sum(a)
if ans >= k:
  ans = -1
print(ans)

C = input()

ans = ''
for i in range(26):
  if chr(ord('a') + i) == C:
    ans = chr(ord('a') + i + 1)
    
print(ans)


Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
import sys
input = sys.stdin.readline

N, M = map(int, input().split())
A_list = [input().split() for _ in range(M)]

wa_count, ac_count = 0, 0
WA_List = {}  # {prob_id: wa_count}
AC_list = []  # [prob_id]

for i in range(M):
    if A_list[i][1] == 'AC':
        if not A_list[i][0] in AC_list:
            if A_list[i][0] in WA_List:
                wa_count += WA_List[A_list[i][0]]
            ac_count += 1
            AC_list.append(A_list[i][0])
    else:
        if A_list[i][0] in WA_List:
            WA_List[A_list[i][0]] += 1
        else:
            WA_List[A_list[i][0]] = 1

print(ac_count, wa_count)


from sys import stdin


N, M = map(int, stdin.readline().rstrip().split())
A_list = [stdin.readline().rstrip().split() for _ in range(M)]

wa_count, ac_count = 0, 0
WA_List = {}  # {prob_id: wa_count}
AC_list = []  # [prob_id]

for i in range(M):
    if A_list[i][1] == 'AC':
        if not A_list[i][0] in AC_list:
            if A_list[i][0] in WA_List:
                wa_count += WA_List[A_list[i][0]]
            ac_count += 1
            AC_list.append(A_list[i][0])
    else:
        if A_list[i][0] in WA_List:
            WA_List[A_list[i][0]] += 1
        else:
            WA_List[A_list[i][0]] = 1

print(ac_count, wa_count)


C = str(input())

print(chr(ord(C) + 1))


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
n = input()
if n == "a":
    print("b")
if n == "b":
    print("c")
if n == "c":
    print("d")
if n == "d":
    print("e")
if n == "e:"
    print("f")
if n == "f":
    print("g")
if n == "g":
    print("h")
if n =="h":
    print("i")
if n == "i":
    print("j")
if n == "j":
    print("k")
if n == "k":
    print("l")
if n == "l":
    print("m")
if n == "m":
    print("n")
if n == "n":
    print("o")
if n == "o":
    print("p")
if n == "p":
    print("q")
if n == "q":
    print("r")
if n == "r":
    print("s")
if n == "s":
    print("t")
if n == "t":
    print("u")
if n == "u":
    print("v")
if n == "v":
    print("w")
if n == "w":
    print("x")
if n == "x":
    print("y")
if n == "y":
    print("z")
if n == "z":
    print("a")

n = input()
if n == "a":
    print("b")
if n == "b":
    print("c")
if n == "c":
    print("d")
if n == "d":
    print("e")
if n == "e":
    print("f")
if n == "f":
    print("g")
if n == "g":
    print("h")
if n =="h":
    print("i")
if n == "i":
    print("j")
if n == "j":
    print("k")
if n == "k":
    print("l")
if n == "l":
    print("m")
if n == "m":
    print("n")
if n == "n":
    print("o")
if n == "o":
    print("p")
if n == "p":
    print("q")
if n == "q":
    print("r")
if n == "r":
    print("s")
if n == "s":
    print("t")
if n == "t":
    print("u")
if n == "u":
    print("v")
if n == "v":
    print("w")
if n == "w":
    print("x")
if n == "x":
    print("y")
if n == "y":
    print("z")
if n == "z":
    print("a")


Verdicts: Runtime Error

Accepted
Problem: Given is a lowercase English letter C that is not `z`. Print the letter that follows C in alphabetical order.

Submission attempts (in order):
C=int(input())
li=[a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]
print(li[C+1])

C=input()
li=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
count=li.index(C)
count=count+1
print(li[count])

Verdicts: Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
N,M = list(map(int,input().split()))
colect_quest = [0]*N
WA_quest = [0]*N
for i in range(M):
    pi,si = list(map(str,input().split()))
    pi = int(pi)
    if si == "AC":
        colect_quest[pi] = 1
    if si == "WA" and colect_quest[pi] != 1:
        WA_quest[pi] += 1
    
print(sum(colect_quest),sum(WA_quest))

N,M = list(map(int,input().split()))
colect_quest = [0]*N
WA_quest = [0]*N
for i in range(M):
    pi,si = list(map(str,input().split()))
    pi = int(pi)
    if si == "AC":
        colect_quest[pi-1] = 1
    if si == "WA" and colect_quest[pi-1] != 1:
        WA_quest[pi-1] += 1
WA_count = 0
for i in range(len(WA_quest)):
    if colect_quest[i] == 1 :
        WA_count += WA_quest[i] 
print(sum(colect_quest),WA_count)

Verdicts: Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
n, m = [int(v) for v in input().split()]

count_map = [0] * m

count = 0
miss = 0
for i in range(m):
	p, s = input().split()
    
    if count_map[p] == True:
      continue
    
    if s == 'AC':
	    count_map[p] = True
        count += 1
    else:
      	miss += 1
      
print(count, miss)




n, m = [int(v) for v in input().split()]

count_map = [0] * (n + 1)
miss_map = [0] * (n + 1)

count = 0
miss = 0
for i in range(m):
    p, s = input().split()
    p = int(p)

    if count_map[p]:
        continue

    if s == 'AC':
        count_map[p] = True
        count += 1
        miss += miss_map[p]
    else:
        miss_map[p] += 1

print(count, miss)

Verdicts: Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
[n,m] = [int(x) for x in input().split()]
ac=[0]*(n+1)
wa=[0]*(n+1)
cnt_ac=0
cnt_wa=0
for i in range(m):
	p,s=input().split()
	p=int(p)
	if s=="AC":
		if	fac[p]==0:
			cnt_ac+=1
			cnt_wa+=wa[p]
			ac[p]=1
		
	else: 
		wa[p]+=1

print(int(cnt_ac),int(cnt_wa))

[n,m] = [int(x) for x in input().split()]
ac=[0]*(n+1)
wa=[0]*(n+1)
cnt_ac=0
cnt_wa=0
for i in range(m):
	p,s=input().split()
	p=int(p)
	if s=="AC":
		if ac[p]==0:
			cnt_ac+=1
			cnt_wa+=wa[p]
			ac[p]=1
	else: 
		wa[p]+=1

print(int(cnt_ac),int(cnt_wa))

Verdicts: Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
N, M = list(map(int, input().split()))
list_WA = [0] * N
list_Flag = [0] * N
for i in range(M):
  a, b = list(map(int, input().split()))
  if list_Flag[a-1] == 1:
	pass
  else:
    if b=='WA':
      list_WA[a-1]=list_WA[a-1]+1
    elif b=='AC':
      list_Flag[a-1]=1
    else:
      pass
WA=sum(list_WA)
AC=sum(list_Flag)
print(AC,WA)

import sys
import os
f = open('input.txt', 'r')
sys.stdin = f

N, M = list(map(int, input().split()))
list_WA = [0] * N
list_Flag = [0] * N
for i in range(M):
  a, b = list(map(str, input().split()))
  a=int(a)
  if list_Flag[a-1] == 1:
      pass
  else:
    if b=='WA':
      list_WA[a-1]=list_WA[a-1]+1
    elif b=='AC':
      list_Flag[a-1]=1
    else:
      pass
WA=sum(list_WA)
AC=sum(list_Flag)
ans=[AC,WA]
print(' '.join(map(str, ans)))


N, M = list(map(int, input().split()))
list_WA = [0]*N
list_Flag = [0]*N
for i in range(M):
  a, b = list(map(int, input().split()))
  if list_Flag[a-1] == 1:
	pass
  else:
    if b=='WA':
      list_WA[a-1]+=1
    elif b=='AC':
      list_Flag[a-1]=1
    else:
      pass
WA=sum(list_WA)
AC=sum(list_Flag)
ans=[AC,WA]
print(*ans)

N, M = list(map(int, input().split())) 
list_WA = [0] * N
list_Flag = [0] * N
for i in range(M):
  a, b = list(map(int, input().split()))
  if list_Flag[a-1] == 1:
	pass
  else:
    if b=='WA':
      list_WA[a-1]=list_WA[a-1]+1
    else:
      list_Flag[a-1]=list_Flag[a-1]+1
WA=sum(list_WA)
AC=sum(list_Flag)
ans=[AC,WA]
print(' '.join(map(str, ans)))

N, M = list(map(int, input().split()))
list_WA = [0] * N
list_Flag = [0] * N
for i in range(M):
  a, b = list(map(str, input().split()))
  a=int(a)
  if not list_Flag[a-1] == 1:
    if b=='WA':
      list_WA[a-1]=list_WA[a-1]+1
    elif b=='AC':
      list_Flag[a-1]=1
penalty = [0] * N
for p in range(N):
    penalty[p]=list_WA[p]*list_Flag[p]
PE=sum(penalty)
AC=sum(list_Flag)
print(AC,PE)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
def main():
    n,m=map(int,input().split())
    r=set()
    x={}
    for _ in range(m):
        p,s=input().split()
        print(p,s)
        if p not in r:
            if s=='WA':
                x[p]=x.setdefault(p,0)+1
            else:
                x[p]=x.setdefault(p,0)
                r.add(p)
    print(len(r),sum(x[p] for p in r)) 

main()

def main():
    n,m=map(int,input().split())
    r=set()
    x={}
    for _ in range(m):
        p,s=input().split()
        if p not in r:
            if s=='WA':
                x[p]=x.setdefault(p,0)+1
            else:
                x[p]=x.setdefault(p,0)
                r.add(p)
    print(len(r),sum(x[p] for p in r)) 

main()

Verdicts: Wrong Answer

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
    N,M = map(int, input().split())
	ac = [0]*N
	wa = [0]*N
	for i in range(M):
		p,s = input().split()
		if s == 'AC':
			if ac[int(p) - 1] != 0:
				continue
			else:	
				ac[int(p) - 1] = 1
		else:
			if ac[int(p) - 1] != 0:
				continue
			else:
				wa[int(p) - 1] += 1
	AC,WA = 0,0

	for i in range(N):
		AC += ac[i]
		if ac[i] >= 1:
			WA += wa[i]
	print(AC,WA)




N,M = map(int, input().split())
ac = [0]*N
wa = [0]*N
for i in range(M):
	p,s = input().split()
	if s == 'AC':
		if ac[int(p) - 1] != 0:
			continue
		else:	
			ac[int(p) - 1] = 1
	else:
		if ac[int(p) - 1] != 0:
			continue
		else:
			wa[int(p) - 1] += 1
AC,WA = 0,0

for i in range(N):
  AC += ac[i]
  if ac[i] >= 1:
    WA += wa[i]
print(AC,WA)

Verdicts: Runtime Error

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
n,m=map(int,input().split())
d=[ input().split() for i in range(m)]
ans=[[0,0] for i in range(m+n+1)]
count=0
ac=0
wa=0

for i in range(m):
  if count!=d[i][0]:
    if ans[count][0]==0 and ans[count][1]>=1:
      ans[count][1]=0
    count=int(d[i][0])
  if d[i][1]=="WA" and ans[count][0]==0:
    ans[count][1]+=1
  elif d[i][1]=="AC" and ans[count][0]==0:
    ans[count][0]+=1
if ans[count][0]==0 and ans[count][1]>=1:
      ans[count][1]=0
for i in range(n+m+1):
  ac+=int(ans[i][0])
  wa+=int(ans[i][1])
print(ac,wa)

n,m=map(int,input().split())
d=[ input().split() for i in range(m)]
ans=[[0,0] for i in range(m+n+1)]
count=0
ac=0
wa=0

for i in range(m):
  if count!=d[i][0]:
    count=int(d[i][0])
  if d[i][1]=="WA" and ans[count][0]==0:
    ans[count][1]+=1
  elif d[i][1]=="AC" and ans[count][0]==0:
    ans[count][0]+=1
for i in range(n+m+1):
  ac+=int(ans[i][0])
  if int(ans[i][0])>=1:
    wa+=int(ans[i][1])
print(ac,wa)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi participated in a contest on AtCoder.  The contest had N problems.  Takahashi made M submissions during the contest.  The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`).  The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more.  The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem.  Find the numbers of Takahashi's correct answers and penalties.

Submission attempts (in order):
n,m = map(int,input().split())
li = list()
for i in range(m):
  li.append(input().split())
print(li)
ac_cnt=0
wa_cnt=0

s_ac=set()
d_wa=dict()
for l in li:
  if l[1] == 'WA':
    d_wa[l[0]] = d_wa.get(l[0],0) + 1
  elif l[1] == 'AC':
    if l[0] not in s_ac:
      s_ac.add(l[0])
      ac_cnt +=1
      wa_cnt +=d_wa.get(l[0],0)
    else:
      pass

print(ac_cnt,wa_cnt)
  

n, m = map(int, input().split())
li = list()
for i in range(m):
    li.append(tuple(input().split()))
 
ac_cnt = 0
wa_cnt = 0
 
s_ac = set()
d_wa = dict()
for l in li:
    if l[1] == 'AC':
        if l[0] not in s_ac:
            s_ac.add(l[0])
            ac_cnt += 1
            wa_cnt += d_wa.get(l[0], 0)
        else:
            pass
    elif l[1] == 'WA':
        d_wa[l[0]] = d_wa.get(l[0], 0) + 1
 
print(ac_cnt, wa_cnt)

Verdicts: Wrong Answer

Accepted