Problem:


Score : 100 points

Problem Statement

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

Constraints

C is a lowercase English letter that is not z.

Input

Input is given from Standard Input in the following format:

C

Output

Print the letter that follows C in alphabetical order.

Sample Input 1

a

Sample Output 1

b

a is followed by b.

Sample Input 2

y

Sample Output 2

z

y is followed by z.



Sample input:
a


Sample output:
b

Submission status: Runtime Error

Solution code:
import math


N = int(input())
x = [0] * N
y = [0] * N
xy = []
for i in range(N):
    xy.append(list(map(int, input().split())))


def signed_area(p1, p2, p3):
    area = (p2[0] - p1[0]) * (p3[1] - p1[1])\
            - (p3[0] - p1[0]) * (p2[1] - p1[1])
    return area/2


def convex_hull(p_list):
    p_sort = []
    for i in p_list:
        p_sort.append(i[0])

    # x座標が最小のものをリストの先頭に配置。
    min_index = p_sort.index(min(p_sort))
    min_p = p_list.pop(min_index)
    p_list.insert(0, min_p)

    # 座標最小の点と他の点との角度順にソート ソートアルゴリズムに選択の余地が有る。
    p_length = len(p_list)
    count = 0
    index = 0
    while True:
        count += 1
        index += 1

        area_sign = signed_area(p_list[0], p_list[index], p_list[index + 1])

        # 符号付き面積が負ならば点を入れ替え
        if area_sign < 0:
            p_list[index], p_list[index + 1] = p_list[index + 1], p_list[index]
            count = 0

        if count == p_length - 1:
            break

        if index == p_length - 2:
            index = 0

    # 凹部の点を削除する。
    index = -1
    count = 0
    while True:
        index += 1
        count += 1

        area_sign = signed_area(p_list[index],
                                p_list[index + 1],
                                p_list[index + 2])
        if area_sign < 0:
            del p_list[index + 1]
            count = 0

        if count == len(p_list):
            break

        if index >= len(p_list) - 3:
            index = -1
    return p_list


def euc(p1, p2):
    return (p1[0]-p2[0])**2 + (p1[1]-p2[1])**2


def find_max_euc(xy):
    ans = []
    max_dis = 0
    n = len(xy)
    for i in range(n):
        for j in range(n):
            dis = math.sqrt(euc(xy[j], xy[i]))
            if dis >= max_dis+1e-05:
                max_dis = dis
                ans = [xy[j], xy[i]]
    return ans


if len(xy) == 2:
    dis = math.sqrt(euc(xy[0], xy[1]))
    print(dis/2)
else:
    xy = convex_hull(xy)
    xy = find_max_euc(xy)
    dis = math.sqrt(euc(xy[0], xy[1]))
    print(dis/2)

Submission status: Runtime Error

Solution code:
N,K,M =  map(int,input().split())
A =  list(map(int,input().split()))

result = N*M - sum(A) 
if result > K:
    print("-1")
elif result <=0:
    print("0")
else:
    print(result)

Submission status: Runtime Error

Solution code:
import math
import sys

def func(a,b,c,d,e,f):
    try:
        aa=(c-e)**2+(d-f)**2
        bb=(a-e)**2+(b-f)**2
        cc=(a-c)**2+(b-d)**2
        o,p,q=bb+cc-aa,cc+aa-bb,aa+bb-cc
        m=aa*o+bb*p+cc*q

        px=(aa*o*a+bb*p*c+cc*q*e)/m
        py=(aa*o*b+bb*p*d+cc*q*f)/m

        r = math.hypot(px-a, py-b)
        return px,py,r

    except ZeroDivisionError:
        return 0,0,10**6

n=int(input())

x,y=[],[]
for i in range(n):
    a,b=map(int,input().split())
    x.append(a)
    y.append(b)


if n==2:
    print(math.hypot(x[0]-x[1],y[0]-y[1])/2)
    sys.exit()
elif n==3:
    px,py,r=func(x[0],y[0],x[1],y[1],x[2],y[2])
    print(r)
    sys.exit()
    

minr=10**6
for i in range(n-2):
    for j in range(i+1,n-1):
        for k in range(j+1,n):
            px,py,r=func(x[i],y[i],x[j],y[j],x[k],y[k])

            sgn=1
            for p in range(n):
                if math.hypot(x[p]-px,y[p]-py)>r:
                    sgn=0
            if sgn==1: minr=min(minr,r)

print(minr)

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())

P = list()
for m in range(M):
    n, rst = input().split()
    n = int(n)
    P.append( (n, rst) )


ck = [False for _ in range(N+1)]

ret_cor, ret_pen = 0, 0

for n, rst in P:
    if rst == 'AC':
        if not ck[n]:
            ck[n] = True
            ret_cor += 1

    else: # rst == 'WA'
        if not ck[n]:
            ret_pen += 1

print(ret_cor, ret_pen)

Submission status: Runtime Error

Solution code:
import queue
import copy
 
def ngoin(bo,now):
    return 0 <= now[0] and now[0] < len(bo) and 0 <= now[1] and now[1] < len(bo[0])
 
def minido(bo,si,sj):
    tb = [[False for i in range(len(bo[0]))] for j in range(len(bo))]
    q = queue.Queue()
    q.put([si,sj,0])
    tb[si][sj] = True
    ret = 0
    while not q.empty():
        now = q.get()
        ret = now[2]
        if ngoin(bo,[now[0]-1,now[1]]):
            if bo[now[0]-1][now[1]] and not tb[now[0]-1][now[1]]:
                q.put([now[0]-1,now[1],now[2]+1])
                tb[now[0]-1][now[1]] = True
                
        if ngoin(bo,[now[0],now[1]+1]):
            if bo[now[0]][now[1]+1] and not tb[now[0]][now[1]+1]:
                q.put([now[0],now[1]+1,now[2]+1])
                tb[now[0]][now[1]+1] = True
                
        if ngoin(bo,[now[0]+1,now[1]]):
            if bo[now[0]+1][now[1]] and not tb[now[0]+1][now[1]]:
                q.put([now[0]+1,now[1],now[2]+1])
                tb[now[0]+1][now[1]] = True
                
        if ngoin(bo,[now[0],now[1]-1]):
            if bo[now[0]][now[1]-1] and not tb[now[0]][now[1]-1]:
                q.put([now[0],now[1]-1,now[2]+1])
                tb[now[0]][now[1]-1] = True
    return ret
            
 
h,w = map(int,input().split())
bo = [[True if x == '.' else False for x in input()] for i in range(h)]
grap = [[float('inf') for i in range(h*w)] for j in range(h*w)]
ans = 0
for i in range(h*w):
    grap[i][i] = 0
for si in range(h):
    for sj in range(w):
        if not bo[si][sj]:
            continue
        ans = max(ans,minido(bo,si,sj))
                
print(ans)

Submission status: Runtime Error

Solution code:
N, M = list(map(int, input().split()))

p = []
tmp_p = [0]*N
S = []

wa = 0
ac = 0

for i in range(M):
    P, s = list(map(str, input().split()))

    if s == 'AC' and P not in p:
        ac += 1
        p.append(P)
        wa += tmp_p[int(P)-1]
    if s == 'WA' and P not in p:
        tmp_p[int(P)-1] += 1


print(ac, wa)

Submission status: Runtime Error

Solution code:
alpha = 'abcdefghijklmnopqrstuvwxyz'
C = input().split()
print(alpha[alpha.index(C)+1])

Submission status: Runtime Error

Solution code:
c=str(input())
print(c+1)

Submission status: Runtime Error

Solution code:
s=input()
print(char(ord(s)+1))

Submission status: Runtime Error

Solution code:
c=str()
print(c+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from itertools import combinations as cc

n,k = map(int,input().split())

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

total=0
mod = 10**9+7
for i in list(cc(a,k)):
	maxx=max(i)%mod
	minx=min(i)%mod
	total=(total%mod+(maxx-minx)%mod)%mod
	
print(total)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
A = list(map(int, input().split()))

ans = 0
mod = 10 ** 9 + 7

A.sort()
for i in range(N-K):
    fs = A[i+K] - A[i]
    ans += fs % mod

print(ans % mod)

Submission status: Runtime Error

Solution code:
import math
import sys

def func(a,b,c,d,e,f):
    try:
        aa = a * a
        bb = b * b
        cc = c * c
        dd = d * d
        ee = e * e
        ff = f * f

        py = ((e - a) * (aa + bb - cc - dd) - (c - a) * (aa + bb - ee- ff)) / (2 * (e - a)*(b - d) - 2 * (c - a) * (b - f))

        px = (2 * (b - f) * py - aa - bb + ee + ff) / (2 * (e - a)) \
            if (c == a) else (2 * (b - d) * py - aa - bb + cc + dd) / (2 * (c - a))

        r = math.hypot(px - a, py - b)
        return px,py,r

    except ZeroDivisionError:
        return 0,0,10**6

n=int(input())

x,y=[],[]
for i in range(n):
    a,b=map(int,input().split())
    x.append(a)
    y.append(b)


if n==2:
    print(math.hypot(x[0]-x[1],y[0]-y[1])/2)
    sys.exit()
elif n==3:
    px,py,r=func(x[0],y[0],x[1],y[1],x[2],y[2])
    print(r)
    sys.exit()
    

minr=10**6
for i in range(n-2):
    for j in range(i+1,n-1):
        for k in range(j+1,n):
            px,py,r=func(x[i],y[i],x[j],y[j],x[k],y[k])

            sgn=1
            for p in range(n):
                if math.hypot(x[p]-px,y[p]-py)>r+10**(-5):
                    sgn=0
            if sgn==1: minr=min(minr,r)

print(minr)

Submission status: Runtime Error

Solution code:
import sys
from collections import deque
from copy import deepcopy
INPUT = lambda: sys.stdin.readline().rstrip()
MAP = lambda: map(int, INPUT().split())
sys.setrecursionlimit(10 ** 9)


def main():
    H, W = MAP()
    c = [list(INPUT()) for _ in range(H)]

    C = []
    for i in range(H+2):
        tmpc = []
        for j in range(W+2):
            if i == 0 or i == H+1 or j == 0 or j == W+1: tmpc.append(0)
            else: tmpc.append(c[i-1][j-1])
        C.append(tmpc)

    sp = deque()
    for i in range(H+2):
        for j in range(W+2):
            if C[i][j] == ".": sp.append([i, j])
            elif C[i][j] == "#": C[i][j] = 0

    ans = 0
    while sp:
        copy_c = deepcopy(C)
        sy, sx = sp.popleft()
        copy_c[sy][sx] = 0
        d = [(1, 0), (-1, 0), (0, 1), (0, -1)]
        queue = deque([[sy, sx]])

        while queue:
            y, x = queue.popleft()
            for dy, dx in d:
                if copy_c[y+dy][x+dx] == ".":
                    copy_c[y+dy][x+dx] = copy_c[y][x] + 1
                    queue.append([y+dy, x+dx])

        tmp = -1
        for i in range(H+2):
            tmp = max(tmp, max(copy_c[i]))

        ans = max(tmp, ans)

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import math
import sys

def func(a,b,c,d,e,f):
    try:
        aa = a * a
        bb = b * b
        cc = c * c
        dd = d * d
        ee = e * e
        ff = f * f

        py = ((e - a) * (aa + bb - cc - dd) - (c - a) * (aa + bb - ee- ff)) / (2 * (e - a)*(b - d) - 2 * (c - a) * (b - f))

        px = (2 * (b - f) * py - aa - bb + ee + ff) / (2 * (e - a)) \
            if (c == a) else (2 * (b - d) * py - aa - bb + cc + dd) / (2 * (c - a))

        r = math.hypot(px - a, py - b)
        return px,py,r

    except ZeroDivisionError:
        return 0,0,10**6

n=int(input())

x,y=[],[]
for i in range(n):
    a,b=map(int,input().split())
    x.append(a)
    y.append(b)


if n==2:
    print(math.hypot(x[0]-x[1],y[0]-y[1])/2)
    sys.exit()
elif n==3:
    px,py,r=func(x[0],y[0],x[1],y[1],x[2],y[2])
    print(r)
    sys.exit()
    

minr=10**6
for i in range(n-2):
    for j in range(i+1,n-1):
        for k in range(j+1,n):
            px,py,r=func(x[i],y[i],x[j],y[j],x[k],y[k])

            sgn=1
            for p in range(n):
                if math.hypot(x[p]-px,y[p]-py)>r:
                    sgn=0
            if sgn==1: minr=min(minr,r)

print(minr)

Submission status: Runtime Error

Solution code:
N, M=map(int,input().split())
if M==0:
	print("0 0")
else:
	A=[]
	for i in range(M):
		a=list(map(str,input().split()))
		A.append(a)
	ch=[]
	ac=0
	pe=0
	for i in range(M):
		if A[i][0] in ch:
			continue
		elif A[i][1]=="AC":
			ch.append(A[i][0])
			ac+=1
		else:
			pe+=1
	print(ac,pe)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String c = sc.next();
        char ch = c.charAt(0);
        System.out.println(++ch);
    }
}

Submission status: Runtime Error

Solution code:
import sys
import string
input = sys.stdin.readline

C = input()
print(string.ascii_lowercase[string.ascii_lowercase.index(C)+1])

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 12 22:19:09 2020

@author: nanasakiwataru
"""

def alphabet(C):
    ans = chr(ord(C) + 1)
    st = C + 'の次は'+ n + 'です。'
    return  st

n = alphabet('a')
print(n)

Submission status: Runtime Error

Solution code:
N,K,M = input().split()
N = int(N)
K = int(K)
M = int(M)

A = input().split()
A = [int(s) for s in A]

AN = M * N - sum(A)

if (AN <= K) and (AN >= 0):
	print (AN)
else:
	print (-1)

Submission status: Runtime Error

Solution code:
N,K,M = input().split()
N = int(N)
K = int(K)
M = int(M)

A = input().split()
A = [int(s) for s in A]

AN = M * N - sum(A)

if (AN <= K) and (AN >= 0):
	print (AN)
elif AN < 0:
	print (0)
else:
	print (-1)

Submission status: Runtime Error

Solution code:
import sys
import string
input = sys.stdin.readline

C = input()
if C == 'z': print('a')
else: print(string.ascii_lowercase[string.ascii_lowercase.index(C)+1])

Submission status: Runtime Error

Solution code:
H,W = map(int,input().split())
maze = []
pad = ' ' * (W+2)
maze.append(pad)
for i in range(H):
  m = input()
  maze.append(' ' + m + ' ')
maze.append(pad)
  
def bfs(maze, x,y, score):
    queue = [(x,y,0)]
    visited = {}
    while queue:
      x,y,s = queue.pop(0)
      if maze[x][y] != '.':
        continue
      visited[(x,y)] = s
      if (x+1,y) not in visited:
        queue.append((x+1,y,s+1))
      if (x-1,y) not in visited:
        queue.append((x-1,y,s+1))
      if (x,y+1) not in visited:
        queue.append((x,y+1,s+1))
      if (x,y-1) not in visited:
        queue.append((x,y-1,s+1))
    return max(visited.values())
  
ans = -1
for h in range(1,H+1):
  for w in range(1,W+1):
    now = maze[h][w]
    if now == '#':
      continue
    if maze[h-1][w] == maze[h+1][w] == maze[h][w-1] == maze[h][w+1] == '.':
      continue
    a = bfs(maze,h,w,0)
    if a > ans:
      ans = a
print(ans)

Submission status: Runtime Error

Solution code:
N,K,M = input().split()
N = int(N)
K = int(K)
M = int(M)
print(N)
A = input().split()
print(A)
A = [int(s) for s in A]
print(A)
AN = M * N - sum(A)
print (AN)
if (AN <= K) and (AN >= 0):
	print (AN)
elif AN < 0:
	print (0)
else:
	print (-1)

Submission status: Runtime Error

Solution code:
import sys

str = sys.stdin.readline()
alp = "abcdefghijklmnopqrstuvwxyz"
print(alp[ord(str)-96])

Submission status: Runtime Error

Solution code:
n,m=map(int, input().split())
li_1=list(range(m))
li_2=list(range(m))
pr=list(range(n))
wa=0
ac=0
for i in range(n):
    pr[i]=0
for i in range(m):
    li_1[i],li_2[i]=map(str, input().split())
    li_1[i]=int(li_1[i])

for i in range(m):
    if li_2[i]=='AC':
        a=li_1[i]-1
        if pr[a]==0:
            for j in range(i):
                if li_1[j]==li_1[i]:
                    wa=wa+1
            pr[a]=1
            ac=ac+1
print(ac,wa)

Submission status: Runtime Error

Solution code:
N,K,M = input().split()
N = int(N)
K = int(K)
M = int(M)
A = input().split()
A = [int(s) for s in A]
AN = M * N - sum(A)
if AN <= K:
	print (AN)
else:
	print ('-1')

Submission status: Runtime Error

Solution code:
N,K,M = input().split()
N = int(N)
K = int(K)
M = int(M)
A = input().split()
A = [int(s) for s in A]
AN = M * N - sum(A)
if (AN <= K) and (AN >= 0):
	print (AN)
else:
	print ('-1')

Submission status: Runtime Error

Solution code:
h,w=map(int,input().split())
l=[]
for i in range(h):
    l.append(list(input()))
for i in range(h):
    for j in range(w):
        if l[i][j]=='.':
            s=[i,j]
v=[[0 for i in range(w)] for j in range(h)]       
v[s[0]][s[1]]=1
mc=0
ms=s
q=[[s,0]]
while q:
    p=q.pop(0)
    x=p[0][0]
    y=p[0][1]
    c=p[1]
    k=[[0,1],[0,-1],[1,0],[-1,0]]
    for j in k:
        nx=x+j[0]
        ny=y+j[1]
        if 0<=nx<h and 0<=ny<w and l[nx][ny]=='.' and v[nx][ny]==0:
            v[nx][ny]=1
            q.append([[nx,ny],c+1])
            if mc<c+1:
                mc=c+1
                ms=[nx,ny]
v=[[0 for i in range(w)] for j in range(h)]       
v[ms[0]][ms[1]]=1
ans=0
q=[[ms,0]]
while q:
    p=q.pop(0)
    x=p[0][0]
    y=p[0][1]
    c=p[1]
    k=[[0,1],[0,-1],[1,0],[-1,0]]
    for j in k:
        nx=x+j[0]
        ny=y+j[1]
        if 0<=nx<h and 0<=ny<w and l[nx][ny]=='.' and v[nx][ny]==0:
            v[nx][ny]=1
            q.append([[nx,ny],c+1])
            ans=max(ans,c+1)
                #ms=[nx,ny]
print(ans)

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())

l = [list(input().split()) for _ in range(M)]

answers = {}
wrongs = {}

for a in l:
    if a[1] == "AC":
        answers[a[0]] = a[1]
    elif a[1] == "WA":
        if not a[0] in wrongs:
            wrongs[a[0]] = 1
        elif a[0] in wrongs:
            wrongs[a[0]] = wrongs[a[0]] + 1

# 集計
wc = 0
for k, v in wrongs.items():
    if k in answers.keys():
        wc += 1
result = [len(answers.keys()), wc]

print(result[0], result[1])

Submission status: Runtime Error

Solution code:
N,K,M = input().split()
N = int(N)
K = int(K)
M = int(M)
A = input().split()
A = [int(s) for s in A]
AN = M * N - sum(A)
if (AN <= K) and (AN >= 0):
	print (AN)
else:
	print (-1)

Submission status: Runtime Error

Solution code:
N,K,M = input().split()
N = int(N)
K = int(K)
M = int(M)
A = input().split()
A = [int(s) for s in A]
AN = M * N - sum(A)
if (AN <= K) and (AN >= 0):
	print (AN)
elif AN < 0:
	print (0)
else:
	print (-1)

Submission status: Runtime Error

Solution code:
N,K,M = input().split()
N = int(N)
K = int(K)
M = int(N)
print(N)
A = input().split()
print(A)
A = [int(s) for s in A]
print(A)
AN = M * N - sum(A)
if (AN <= K) and (AN >= 0):
	print (AN)
elif AN < 0:
	print (0)
else:
	print ('-1')

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())

l = [list(input().split()) for _ in range(M)]

answers = {}
wrongs = {}

for a in l:
    if a[1] == "AC":
        answers[a[0]] = a[1]
    elif a[1] == "WA":
        if not a[0] in answers:
            if a[0] in wrongs:
                wrongs[a[0]] = wrongs[a[0]] + 1
            else:
                wrongs[a[0]] = 1


# 集計
result = [len(answers.keys()), sum(wrongs.values())]

print(result[0], result[1])

Submission status: Runtime Error

Solution code:
N,K,M = input().split()
N = int(N)
K = int(K)
M = int(N)
A = input().split()
A = [int(s) for s in A]
AN = M * N - sum(A)
if (AN <= K) and (AN >= 0):
	print (AN)
elif AN < 0:
	print (0)
else:
	print (-1)

Submission status: Runtime Error

Solution code:
import sys

args = sys.argv

a = "abcdefghijklmnopqrstuvwxyz"

c = args[1]
idx = a.index(c)
print(a[idx + 1])

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
l=[list(input().split()) for _ in range(m)]

ac=[]
wa=0
for i in range(m):
  if l[i][1]=="AC":
    if(l[i][0] in ac) == False:
      ac.append(l[i][0])
  elif l[i][1]=="WA":
    if (l[i][0] in ac) == False:
      wa += 1
    

    
print(len(ac),wa)

Submission status: Runtime Error

Solution code:
N,K,M = input().split()
N = int(N)
K = int(K)
M = int(N)
A = input().split()
A = [int(s) for s in A]
AN = M * N - sum(A)
if (AN <= K) and (AN >= 0):
	print (AN)
else:
	print ('-1')

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
N,K,M = input().split()
N = int(N)
K = int(K)
M = int(N)
# print(N)
A = input().split()
# print(A)
A = [int(s) for s in A]
# print(A)
AN = M * N - sum(A)
if (AN <= K) and (AN >= 0):
	print (AN)
else:
	print ('-1')

Submission status: Runtime Error

Solution code:
s = input()

print(s[0] + 1)

Submission status: Runtime Error

Solution code:
import sys
N,M = map(int,input().split())
if M == 0:
	print('0 0')
	sys.exit()


p = [0]*M#問題の番号
s = [0]*M#結果 AC,WA

for i in range(M):
	p[i],s[i] = input().split()

cor_count = 0
pen_count = 0
AC_list = []

for i in range(M):
	if not p[i] in AC_list:
		if s[i] == 'AC':
			AC_list.append(p[i])
		else:
			pen_count += 1

#print(AC_list)
cor_count = len(set(AC_list))
if M != 0:
	print(cor_count,pen_count)

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
point = input().split()
thr = 0
good = 0
bad = 0

if M == 0:
    print("0 0")
else:
    for i in range(M - 1):
        if point[0] == str(thr):
            point = input().split()
            continue
        elif point[1] == "AC":
            good += 1
            thr = point[0]
            point = input().split()
            continue
        elif point[1] == "WA":
            bad += 1
            point = input().split()
            continue
    print(str(good), str(bad))

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
cleared = []
ac_counter = 0
wa_counter = 0
for i in range(m):
    p, s = input().split()
    p = int(p)
    if not p in cleared:
        if s == 'AC':
            ac_counter += 1
            cleared.append(p)
        else:
            wa_counter += 1
print('{} {}'.format(ac_counter, wa_counter))

Submission status: Runtime Error

Solution code:
import sys
n, m = map(int, input().split())
wa, ac = 0, 0
memo = []
hi = n
if n < m:
    hi = m
b = [0] * hi
table = [sys.stdin.readline().split() for x in range(m)]
for x in range(m):
    if table[x][1] == 'AC' and not table[x][0] in memo:
        memo.append(table[x][0])
        ac += 1
        wa += b[int(table[x][0])]
    elif table[x][1] == 'WA':
        b[int(table[x][0])] += 1
print(ac, wa)

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
ac = [0] * N
wa = [0] * N

ac = 0
wa = 0

for i in range(M):
    p, S = input().split()
    p = int(p)

    if S == "AC":
        if ac[p-1] == 0:
            ac += 1
            
    else:
        if ac[N-1] == 0:
            wa += 1

print(ac, wa)

Submission status: Runtime Error

Solution code:

input_ = input()
print(chr(ord(str(input_)) + 1))

Submission status: Runtime Error

Solution code:
# AC を 1回以上出した各問題において、初めて AC を出すまでに出した WA の数
n,m = map(int, input().split())
p = []
s = []
wacounter = 0
walist = []
for i in range(0, n):
  walist.append(0)
point = 0
point_to_num = [] #acをとった問題
for i in range(0, m):
  list = input().split()
  p.append(int(list[0]))
  s.append(list[1])
 
for i in range(0, m):
  if s[i] == "AC" and not p[i] in point_to_num: #もし正解で、今までにその問題に正解していなかったら
    point_to_num.append(p[i]) #正解リストにその問題を追加
    #point = point + 1 正解ポイントをあげる
  elif s[i] == "WA" and not p[i] in point_to_num: #不正解かつ今まで正解を出したことがない
      wacounter += 1
      walist[p[i]-1] += 1
for i in range(0, n):
  if not i + 1 in point_to_num:#もし正解してない番号があったら、walistからwacounterをとってきてひく
    wacounter = wacounter - walist[i]
print(len(point_to_num), wacounter)

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())

A = [[0] * 2 for i in range(M)]

for i in range(M):
    A[i][0], A[i][1] = input().split()


AC = [0] * M
WA = [0] * M

for j in range(M)[::-1]:
    if A[j][1] == 'AC' and (A[j][0] in AC) is False:
        AC[j] = A[j][0]
    elif A[j][1] == 'WA' and (A[j][0] in AC) is True:
        WA[j] = A[j][0]

print(len(AC) - AC.count(0), len(WA) - WA.count(0))

Submission status: Runtime Error

Solution code:
chrs=string.ascii_lowercase
nx={c:d for c,d in zip(chrs,chrs[1:])}
print(nx(input())

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
a = str(input())
# 文字列の入力

# 出力
print chr(ord(a) + 1)

Submission status: Runtime Error

Solution code:
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)))

Submission status: Runtime Error

Solution code:
from collections import defaultdict
N, M = map(int, input().split())
P = [input().split() for _ in range(M)]
X = defaultdict(int)
ac = 0
wa = 0
for pi in P:
    i = int(pi[0])
    s = pi[1]
    if X[i-1] == 0:
        if s == 'WA':
            wa += 1
        else:
            ac += 1
            X[i-1] = 1

print(ac, wa)

Submission status: Runtime Error

Solution code:
from collections import deque
import copy
def solve(maze, start, end):
  memo = []
  q = deque()
  q.append([start,[]])
  ans = 0
  while q:
    cur, path = q.popleft()
    if cur == end:
      ans = path
      break
    elif cur in memo:
      continue
    else:
      memo.append(cur)
      for y, x in zip((0,0,1,-1),(1,-1,0,0)):
        if maze[cur[0]+y][cur[1]+x] == ".":
          q.append([[cur[0]+y,cur[1]+x],copy.deepcopy(path)+[cur]])
  return ans


H, W = map(int, input().split())
Maze = [["#"]*(W+2)]+[["#"]+list(input())+["#"] for _ in range(H)] + [["#"]*(W+2)]
Ans = 0
for sy in range(1, H+1):
  for sx in range(1, W+1):
    if Maze[sy][sx] == "#":
      continue
    memo = [[False]*(W+2) for _ in range(H+2)]
    for ey in range(H+1, sy,-1):
      for ex in range(1, W+1):
        if Maze[ey][ex] == "#" or memo[ey][ex]:
          continue
        P = solve(Maze, [sy, sx], [ey,ex])
        Ans = max(Ans, len(P))
        for p in P:
          memo[p[0]][p[1]] = True
print(Ans)

Submission status: Runtime Error

Solution code:
N,M = [int(i) for i in input().split()]
submissions = {str(i):[] for i in range(1,N+1)}
AC,WA = 0,0
for i in range(M):
    P,S = [j for j in input().split()]
    submissions[P].append(S)
for i in submissions:
    if 'AC' not in submissions[i]:
        continue
    for j in submissions[i]:
        if j == 'AC':
            AC+=1
            break
        WA +=1
print(AC,WA)

Submission status: Runtime Error

Solution code:
N, M = input().split()
N = int(N)
M = int(M)
p = []
S = []
for i in range(M):
    a, b = input().split()
    a = int(a)
    p.append(a)
    S.append(b)
right = []
wrong = []
for j in range(N):
    right.append(0)
    wrong.append(0)
for k in range(M):
    if S[k] == 'WA' and right[p[k] - 1] == 0:
        wrong[p[k] - 1] += 1
    else if S[k] == 'AC':
        if right[p[k] - 1] == 0:
            right[p[k] - 1] += 1
print(str(sum(right)) + ' ' + str(sum(wrong)))

Submission status: Runtime Error

Solution code:
N,M = [int(i) for i in input().split()]
submissions = {str(i):[] for i in range(1,N+1)}
AC,WA = 0,0
for i in range(M):
    P,S = [j for j in input().split()]
    submissions[P].append(S)
for i in submissions:
    if(not 'AC' in submissions[i]):
        continue
    for j in submissions[i]:
        if j == 'AC':
            AC+=1
            break
        WA +=1
print(AC,WA)

Submission status: Runtime Error

Solution code:
n, k, m = map(int, input().split())
a = list(map(int, input().split()))
if sum(a) + k < n * m:
  ans = -1
else :
  ans = n * m - sum(a)
  if ans < 0:
    ans = 0
print(ans)

Submission status: Runtime Error

Solution code:
c=int(input())
print(c+1)

Submission status: Runtime Error

Solution code:
i1 = list(map(int,input().split()))
i2 = list(map(int,input().split()))

x = sum(i2)

for i in range(i1[1]):
    if (x+i)/(i1[0]) >= i1[2]:
        print(i)
        break
    else if i == i1[1]-1:
        print(-1)

Submission status: Runtime Error

Solution code:
N,M = [int(i) for i in input().split()]
submissions = {str(i):[] for i in range(1,N+1)}
AC,WA = 0,0
for i in range(M):
    P,S = [j for j in input().split()]
    submissions[P].append(S)
for i in submissions:
    for j in submissions[i]:
        if not 'AC' in j:
            break
        if j == 'AC':
            AC+=1
            break
        WA +=1
print(AC,WA)

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())


li = []

for i in range(m):
    p,q = map(str, input().split())
    li.append((int(p),q))

wa = 0

se = {i for i in li if i[1]=='AC'}
ac = len(se)

flag = True
for i in range(m-1):
    if li[i][0]!=li[i+1][0]:
        flag = True
    elif li[i][0]==li[i+1][0] and li[i][1]=='AC':
        flag = False
    elif li[i][0]==li[i+1][0] and li[i][1]=='WA' and flag:
        wa += 1

print(ac, wa)

Submission status: Runtime Error

Solution code:
al = input()

# ald = [1:a,2:b,3:c,4:d,5:e,6:f,8:g,9:h,10:i,11:j,12:k,13:l,14:m,15:n,16:o,16:p,17:q,18:r,19:s,20:t,21:u,22:v,23:w,24:x,25:y,26:z]

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

if al in ald:
    print(ald[al])