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:
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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

// Define
using ll = long long;
using ull = unsigned long long;
using ld = long double;
template <class T> using pvector = vector<pair<T, T>>;
template <class T>
using rpriority_queue = priority_queue<T, vector<T>, greater<T>>;
constexpr const ll dx[4] = {1, 0, -1, 0};
constexpr const ll dy[4] = {0, 1, 0, -1};
constexpr const ll MOD = 1e9 + 7;
constexpr const ll mod = 998244353;
constexpr const ll INF = 1LL << 60;
constexpr const ll inf = 1 << 30;
constexpr const char rt = '\n';
constexpr const char sp = ' ';
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define elif else if
#define all(a, v, ...)                                                         \
    ([&](decltype((v)) w) { return (a)(begin(w), end(w), ##__VA_ARGS__); })(v)
#define fi first
#define se second

template <class T> bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> bool chmin(T &a, const T &b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}

// Debug
#define debug(...)                                                             \
    {                                                                          \
        cerr << __LINE__ << ": " << #__VA_ARGS__ << " = ";                     \
        for (auto &&X : {__VA_ARGS__}) cerr << "[" << X << "] ";               \
        cerr << rt;                                                            \
    }

#define dump(a, h, w)                                                          \
    {                                                                          \
        cerr << __LINE__ << ": " << #a << " = [" << rt;                        \
        rep(i, h) {                                                            \
            rep(j, w) cerr << a[i][j] << sp;                                   \
            cerr << rt;                                                        \
        }                                                                      \
        cerr << "]" << rt;                                                     \
    }

#define vdump(a, n)                                                            \
    {                                                                          \
        cerr << __LINE__ << ": " << #a << " = [";                              \
        rep(i, n) if (i) cerr << sp << a[i];                                   \
        else cerr << a[i];                                                     \
        cerr << "]" << rt;                                                     \
    }

// Loop
#define inc(i, a, n) for (ll i = (a), _##i = (n); i <= _##i; ++i)
#define dec(i, a, n) for (ll i = (a), _##i = (n); i >= _##i; --i)
#define rep(i, n) for (ll i = 0, _##i = (n); i < _##i; ++i)
#define each(i, a) for (auto &&i : a)

// Stream
#define fout(n) cout << fixed << setprecision(n)
struct io {
    io() { cin.tie(nullptr), ios::sync_with_stdio(false); }
} io;

// Speed
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

// Math
inline constexpr ll gcd(const ll a, const ll b) {
    return b ? gcd(b, a % b) : a;
}
inline constexpr ll lcm(const ll a, const ll b) { return a / gcd(a, b) * b; }

inline constexpr ll modulo(const ll n, const ll m = MOD) {
    ll k = n % m;
    return k + m * (k < 0);
}
inline constexpr ll chmod(ll &n, const ll m = MOD) {
    n %= m;
    return n += m * (n < 0);
}
inline constexpr ll mpow(ll a, ll n, const ll m = MOD) {
    ll r = 1;
    rep(i, 64) {
        if (n & (1LL << i)) r *= a;
        chmod(r, m);
        a *= a;
        chmod(a, m);
    }
    return r;
}
inline ll inv(const ll n, const ll m = MOD) {
    ll a = n, b = m, x = 1, y = 0;
    while (b) {
        ll t = a / b;
        a -= t * b;
        swap(a, b);
        x -= t * y;
        swap(x, y);
    }
    return modulo(x, m);
}

signed main() {
    char A;
    cin >> A;
    cout << char(A + 1) << endl;
}

// -g -D_GLIBCXX_DEBUG -fsanitize=undefined

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
AC = set()
wa = [0] * (N+1)

for _ in range(M):
    p, s = input().split()
    p = int(p)
    if not p in AC:
        if s == 'AC':
            AC.add(p)
        if s == 'WA':
            wa[p] += 1

wa_ans = 0
for i in range(1,N+1):
    if i in AC:
        wa_ans += wa[i]

print(len(AC), wa_ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,m = map(int,input().split())
ACcount = 0
WAcount = 0
WA = []
AC = []
for i in range(n):
  WA.append(0)
  AC.append(1)
for i in range(m):
  p,s = input().split()
  p = int(p)
  if s == "WA":
    if WA[p-1] >= 0:
      WA[p-1] += 1
  if s == "AC":
    ACcount += AC[p-1]
    AC[p-1] = 0
    if WA[p-1] >= 0:
       WAcount += WA[p-1]
       WA[p-1] = -1
print(ACcount,WAcount)

Submission status: Runtime Error

Solution code:
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]
s = input()
for i in range(25):
  if s == l[i]:
    print(l[i+1])

Submission status: Runtime Error

Solution code:
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]
s = input()
for i in range(25):
  if s = l[i]:
    print(l[i+1])

Submission status: Runtime Error

Solution code:
print chr(ord(input()) + 1)

Submission status: Runtime Error

Solution code:
print chr(ord('a') + 1)

Submission status: Runtime Error

Solution code:
import sys
from fractions import gcd
from itertools import permutations, combinations, accumulate
from collections import deque
from heapq import heappush, heappop, heapify
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
MOD = 10**9 + 7

def main():
    c = ord(input())
    c += 1
    if c == 123:
        c = 97
    print(chr(c))

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
#define ll long long
using namespace std;

int main() 
{
    char c;
    cin >> c;
    cout << char(c+1);
    return 0;
}

Submission status: Runtime Error

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


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

#達成できる
#もう達成している
#無理

Submission status: Runtime Error

Solution code:
A=chr(input())
print(chr(B+1))

Submission status: Runtime Error

Solution code:
A=int(input())
print(chr(B+1))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A=int(input())
print("A+1")

Submission status: Runtime Error

Solution code:
def cmb(n, k, mod, fac, ifac):
    """
    nCkを計算する
    """
    k = min(k, n-k)
    return fac[n] * ifac[k] * ifac[n-k] % mod


def make_tables(mod, n):
    """
    階乗テーブル、逆元の階乗テーブルを作成する
    """
    fac = [1, 1] # 階乗テーブル・・・(1)
    ifac = [1, 1] #逆元の階乗テーブル・・・(2)
    inverse = [0, 1] #逆元テーブル・・・(3)

    for i in range(2, n+1):
        fac.append((fac[-1] * i) % mod)
        inverse.append((-inverse[mod % i] * (mod//i)) % mod)
        ifac.append((ifac[-1] * inverse[-1]) % mod)
    return fac, ifac
    
n,k=map(int,input().split())
a=sorted(list(map(int, input().split())))
MOD=10**9+7

fac, ifac=make_tables(MOD,n)

s=0
for i in range(k-1,n):
	s+=(a[i]-a[n-i-1])*cmb(i,k-1,MOD,fac,ifac)
	s%=10**9+7
print(s)

Submission status: Runtime Error

Solution code:
C = input()

alpha = [chr(ord('a') + i) for i in range(25)]

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

Submission status: Runtime Error

Solution code:
print(chr(ord(input()+1)))

Submission status: Runtime Error

Solution code:
c = input()
print(shr(ord(c)+1))

Submission status: Runtime Error

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

if n * m - sum(a) <= 0:
    print(0)

elif n * m - sum(a) > k:
    print('-1')
    
else:
    print(n * m - sum(a))

Submission status: Runtime Error

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

if m * n - sum(a) <= 0:
    print(0)

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

Submission status: Runtime Error

Solution code:
N,K,M=list(map(int,input().split()))
listA=list(map(int,input().split()))
S=sum(listA)
if S>=M*N-K and S<N*M:
  print(M*N-S)
elif S>=M*N:
    print(0)
else:
    print(-1)

Submission status: Runtime Error

Solution code:
s=str(input())

s+=1
print(s)

Submission status: Runtime Error

Solution code:
s = int(input())

print(chr(ord('s')+1))

Submission status: Runtime Error

Solution code:
n, m = [int(i) for i in input().split(' ')]
wa = [0] * n
ac = [0] * n
for _ in range(m):
    problem, status = input().split(' ')
    problem = int(problem) - 1
    if status == 'WA':
        if ac[problem] == 0:
            wa[problem] += 1
        continue
    ac[problem] = 1

no_ac = sum(ac)
no_wa = sum(wa)

print(str(no_ac) + ' ' + str(no_wa))

Submission status: Runtime Error

Solution code:
n, m = [int(i) for i in input().split(' ')]
wa = [0] * n
ac = [0] * n
for _ in range(m):
    problem, status = input().split(' ')
    problem = int(problem) - 1
    if status == 'WA':
        if ac[problem] == 0:
            wa[problem] += 1
        continue
    ac[problem] = 1

Submission status: Runtime Error

Solution code:
print(chr(ord(input() + 1)))

Submission status: Runtime Error

Solution code:
import sys
import numpy as np

S = []
for e in sys.stdin:
    S.append(e.rstrip())

H, M = map(int, S[0].split())

meiro = []
for i in range(H):
    meiro.append([])
    for k in S[i + 1]:
        if k == '.':
            meiro[i].append(1)
        else:
            meiro[i].append(0)
meiro_array = np.array(meiro)
susumikata = [[1, 0], [-1, 0], [0, 1], [0, -1]]


def BFS(y, x):
    global max_distance
    if meiro_array[x, y] == 1:
        max_distance = 0
        reached = {(x, y): 0}
        for i in range(H * M):
            zahyous = [k for k, v in reached.items() if v == i]
            for zahyou in zahyous:
                for susumi in susumikata:
                    new_zahyou = tuple([zahyou[0] + susumi[0], zahyou[1] + susumi[1]])
                    if not(0 <= new_zahyou[0] < H and 0 <= new_zahyou[1] < M):
                        a = 0
                    elif new_zahyou not in reached.keys() and meiro_array[new_zahyou] == 1:
                        reached[new_zahyou] = i + 1
                        max_distance = i + 1

    return max_distance


keiro_max = []
for x in range(H):
    for y in range(M):
        keiro_max.append(BFS(x, y))

print(max(keiro_max))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n, k, m = map(int, input().split())
a = list(map(int, input().split()))
if(sum(a)/4 > m):
    print(0)
elif (((sum(a)+k)/5) >= m):
    print(5*m-27)
else:
    (((sum(a)+k)/5) < m)
    print(-1)

Submission status: Runtime Error

Solution code:
a = input()
print chr(ord('a') + 1)

Submission status: Runtime Error

Solution code:
N = input()

ans = chr(ord('N'+1))

print(ans)

Submission status: Runtime Error

Solution code:
N, K, M = map(int, input().split())
L = list(map(int, input().split()))
diff = N*M-sum(L)
if diff <= K:
  print(max(0, diff))
else:
  print(-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

    penalties = 0
    wa_counts = [0] * n
    ac_flags = [0] * n

    for _ in range(m):
        line = input().split()
        q = int(line[0])
        r = line[1]

        if ac_flags[q-1] == 0:
            if r == 'WA':
                wa_counts[q-1] += 1

            else:
                ac_flags[q-1] = 1
                penalties += wa_counts[q-1]

    print(sum(ac_flags), penalties)

resolve()

Submission status: Runtime Error

Solution code:
C = raw_input()
C_ord = ord(C)
print(chr(C_ord + 1))

Submission status: Runtime Error

Solution code:
C = raw_input()
C_ord = ord(C)
print(str(C_ord+1))

Submission status: Runtime Error

Solution code:
c=input()
print(chr(ord(c)+1)

Submission status: Runtime Error

Solution code:
a=input()
b=('abcdefghijklmnopqrstuvwxyz')
for i in range(int(len(b)):
	if b[i]==a:
    	print(b[i+1])

Submission status: Runtime Error

Solution code:
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys

# import itertools
# import math

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

H = readline().decode('utf8')
print(chr(ord(H) + 1))

Submission status: Runtime Error

Solution code:
alpha = "abcdefghijklmnopqrstuvwxy"
C = input()
print(alpha[alpha.index(C)+1])

Submission status: Runtime Error

Solution code:
c=input()
c=c.upper()
c=chr(ord(c+1))
print(c)

Submission status: Runtime Error

Solution code:
c=input()
c=chr(ord(c+1))
print(c)

Submission status: Runtime Error

Solution code:
c=input()
chr(ord(c+1))
print(c)

Submission status: Runtime Error

Solution code:
C = input()

print(C++)

Submission status: Runtime Error

Solution code:
 print(chr(ord(input()) + 1))

Submission status: Runtime Error

Solution code:
C = input()
print(chr(ord(c)+1))

Submission status: Runtime Error

Solution code:
c = input()
abc = 'abcdefghijklmnopqrstuvwxyz'

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

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
acc = [False] * N
pen = 0
for _ in range(M):
    p, S = input().split()
    p = int(p) - 1
    if S[0] == 'A':
        acc[p] = True
    else:
        if not acc[p]:
            pen += 1
print('{} {}'.format(sum(acc), pen))

Submission status: Runtime Error

Solution code:
import queue
from itertools import product

H, W = map(int, input().split())
road_grid = [row for row in input()]

# for each start point, find the furthest travellable point
# then return largest path length of all these
# ps y is down, x is right
furthest_so_far = -1
for y_init, x_init in product(range(H), range(W)):
    if road_grid[y_init][x_init] == "#": continue
    boundary = queue.Queue()
    boundary.put((y_init, x_init))
    steps_taken = [[-1]*W for _ in range(H)]
    steps_taken[y_init][x_init] = 0
    while not boundary.empty():
        y, x = boundary.get()
        neighbours = [(y+1, x), (y, x+1), (y-1, x), (y, x-1)]
        for (new_y, new_x) in neighbours:
            if (0 <= new_y < H and 0 <= new_x < W
                and steps_taken[new_y][new_x] == -1 and road_grid[new_y][new_x] == "."):
                steps_taken[new_y][new_x] = steps_taken[y][x] + 1
                boundary.put((new_y, new_x))
    furthest_so_far = max(furthest_so_far, max(max(steps_taken)))
print(furthest_so_far)

Submission status: Runtime Error

Solution code:
c = input()
alp = 'abcdefghijklmnopqrstuvwxyz'

ans = alp[s.find(c)+1]
print(ans)

Submission status: Runtime Error

Solution code:
c = input()
alp = 'abcdefghijklmnopqrstuvwxyz'

ans = alp[s.find(c)+1]

Submission status: Runtime Error

Solution code:
n,k,m = map(int,input().split())
a = list(map(int,input().split()))
x = 0
for i in range(n-1):
    x+=a[i]
if n*m - x <= k:
    print(n*m-x)
else:
    print(-1)

Submission status: Runtime Error

Solution code:
a=input()

print(a+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
C=input()
alp=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
x=alp.index(C)
print(alp[x+1])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import itertools

N,K = map(int,input().split())
A = sorted(list(map(int,input().split())))

def fun(a):
    return max(a)-min(a)
def fun1(a):
    return sum(a) % (1000000007)
_1 = [fun(i) for i in itertools.combinations([int(i) for i in A], K)]    
print(fun1(_1))

mod = 10**9 + 7
 
def nCr(n,r):
  if n < r:
    return 0
  if n < 0 or r < 0:
    return 0
  return (fac[n] * facinv[r] * facinv[n - r]) % mod

Submission status: Runtime Error

Solution code:
list_a=['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']
c=input()
print(l[l.index(c)+1])

Submission status: Runtime Error

Solution code:
C = [chr(i) for i in range(ord('a'), ord('z'))]
print(C.sort(C))

Submission status: Runtime Error

Solution code:
import sys
# row = sys.stdin.readline
row = open('input.txt', 'r').readline
def read_string(row):
    return row().rstrip()
  
inp = read_string(row)
print(chr(ord(inp) + 1))

Submission status: Runtime Error

Solution code:
#include <stdio.h>

int main(void)
{
    char buffer[256];

    scanf("%*c");

    printf("%c", &buffer⁺1);
    return 0;
}

Submission status: Runtime Error

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

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

if N * M - sum(A) > K:
	print(-1)
else:
  	print(max(N*M -sum(A) , 0))

Submission status: Runtime Error

Solution code:
print(chr(ord(input()+1))

Submission status: Runtime Error

Solution code:
a

Submission status: Runtime Error

Solution code:
C = input()

print(chr(ord(C)+1)

Submission status: Runtime Error

Solution code:
num_of_subs, full_score, avg = [ int(i) for i in input().split(" ") ]
prevScores =  0
for i in input().split(" "):
  prevScores += int(i)

last_score = (avg * num_of_subs) - prevScores

if last_score <= 0:
  print(0)
else:
  if last_score >= 100:
    print(-1)
  else:
    print(last_score)

Submission status: Runtime Error

Solution code:
list = [a,b,c,d,e,f,g,h,i,j,k,m,n,o,p,q,r,s,t,u,v,w,x,y,z]

C = str(input())

print(list[(list.index(C)+1)%len(list)])

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
print chr(ord(input())+1)

Submission status: Runtime Error

Solution code:
c = input()
print chr(ord(c) + 1)

Submission status: Runtime Error

Solution code:
x=input(alphabet:)
print([cht(ord(x)+1)])

Submission status: Runtime Error

Solution code:
print("give a alpha")
print(alpha+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
h,w=map(int,input().split())
s=[[0 for i in range(w)] for j in range(h)]
for i in range(h):
	s[i]=list(input())
# h,w=3,3
# s=[['.', '.', '.'], ['.', '.', '.'], ['.', '.', '.']]
v=[[1000000 for i in range(w)] for j in range(h)]
s=np.array(s)
v=np.array(v)
def search(H,W,p):
	m=0
	if H<h-1 and s[H+1][W]=='.' and v[H+1][W]>p+1:
		v[H+1][W]=p+1
		m=p+1
	if H>0 and s[H-1][W]=='.' and v[H-1][W]>p+1:
		v[H-1][W]=p+1
		m=p+1
	if W>0 and s[H][W-1]=='.' and v[H][W-1]>p+1:
		v[H][W-1]=p+1
		m=p+1
	if W<w-1 and s[H][W+1]=='.' and v[H][W+1]>p+1:
		v[H][W+1]=p+1
		m=p+1
	return m

def dijk():
	f=False
	global P
	global M
	for i in range(h):
		for j in range(w):
			if v[i][j]==P:
				m=search(i,j,P)
				M=max(m,M)
				f=True

	P+=1
	if f==False:
		return 0
	dijk()
M_=0
for i in range(h):
	for j in range(w):
		v[i][j]=0
		P=0
		M=0
		if s[i][j]!='.':
			continue
		dijk()
		M_=max(M,M_)
		v=[[1000000 for i in range(w)] for j in range(h)]
print(M_)

Submission status: Runtime Error

Solution code:
from collections import deque
from itertools import chain, combinations
import json
from typing import List




def main():
    a = "abcdefghijklmnopqrstuvwxyz"
    c=input()
    print(a[a.index(c)+1])

    # N = int(input())
    # A = [int(a) for a in input().split()]
    # B = [
    #     [int(a) for a in input().split()]
    #     for _ in range(N)
    # ]
    print()


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
C=input()
print(chr(ord(c[0])+1))

Submission status: Runtime Error

Solution code:
import time

# success
# https://atcoder.jp/contests/abc151/tasks/abc151_e
# https://blogarithms.github.io/articles/2019-01/fermats-theorem


MOD =  1000000007
MOD2 = 1000000005
MAX = 100001

# facs = [1 for _ in range(MAX)]



"""for i in range(1, MAX):
	facs[i] = (facs[i-1] * i) % MOD"""


def get_facs(n, k):
	if k<n-k:
		k = n-k
	r = 1
	for i in range(k+1, n+1):
		r *= i
	for i in range(2, n-k+1):
		r /= i
	return r

def choose(n, k):

	if k==0 or n==k:
		return 1
	if n==0:
		return 0
	if k>n:
		return 0
	return get_facs(n, k)



def main():
	N, K = map(int, input().split())
	numbers = sorted(map(int, input().split()))
	if K==1:
		return 0
	if K==N:
		return abs(numbers[0] - numbers[-1])

	score = 0
	for i, x in enumerate(numbers):
		score += ((choose(i, K-1) - choose(N-1-i, K-1)) * x)

	return int(score%MOD)
	
	
print(main())

Submission status: Runtime Error

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

A = []

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

S = sum(A)
Score = M * N

n = Score - S

if n >=0 and n <= 100:
    print(n)
elif n > 100:
    print('-1')
else:
    print(0)

Submission status: Runtime Error

Solution code:
print(input() + 1)

Submission status: Runtime Error

Solution code:
c = input()
dic = ['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']
ind = dic.index(c)
print(dic[ind+1])

Submission status: Runtime Error

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

A = []

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

S = sum(A)
Score = M * N

n = Score - S

if n >=0 and n < 100:
    print(n)
elif n >= 100:
    print('-1')
else:
    print(0)

Submission status: Runtime Error

Solution code:
lst = []
n, m  = map(int, input().split())
for _ in range(m):
    i, h = input().split()
    lst.append([int(i), str(h)])

jdg_wa = [0] * n 
jdg_ac = [0] * n

for _ in lst:
    idx = _[0] - 1
    if _[1] == 'WA' and jdg_ac[idx] != 1:
        jdg_wa[idx] += 1
    elif _[1] == 'AC':
        jdg_ac[idx] = 1
        
print(int(sum(jdg_ac)), int(sum(jdg_wa)))

Submission status: Runtime Error

Solution code:
kamo,max,ave = map(int, input().split())
now = list(map(int, input().split()))
ten = 0
for i in now:
    ten += i

need = kamo * ave

if ( kamo * ave > ten + max):
    print(-1)
else:
    if(kamo * ave - ten >= 0):
        print(kamo * ave - ten)
    else:
        print(0)

Submission status: Runtime Error

Solution code:
C = gets.strip
alp = 'abcdefghijklmnopqrstuvwxyz'
puts alp[alp.index(C)+1]

Submission status: Runtime Error

Solution code:
C = input()
print(chr(ord(C)+1)

Submission status: Runtime Error

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

list = [[] for i in range(N)]
# print(list)

for i in range(M):
    p, S = input().split(" ")
    p = int(p)
    if "AC" not in list[p-1]:
        list[p-1].append(S)
    else:
        pass
pe = 0
cl = 0
for l in list:
    if "AC" in l:
        for i in l:
            if i == "AC":
                cl += 1
            else:
                pe += 1
    else:
        pass
print(cl, pe)

Submission status: Runtime Error

Solution code:
print(ord(ord(input())+1))

Submission status: Runtime Error

Solution code:
C=input()
lst=["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"]
print(lst[lst.index(C)+1])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
C = input()

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

Submission status: Runtime Error

Solution code:
in_char = input()

alpha_bete = {"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 cnt, charct in enumerate(alpha_bete):
	if charact == in_char
  		print(alpha_bete[cnt+1])

Submission status: Runtime Error

Solution code:
C =str(input())

alph = "abcdefghijklmnopqrstuvwxyz"

alphabet_list = list(alph)

print(alphabet[alphabet_list.index(C)+1])

Submission status: Runtime Error

Solution code:
C =str(input())

alph = "abcdefghijklmnopqrstuvwxyz"

alphabet_list = list(alph)
print(alphabet_list)

print(alphabet[alphabet_list.index(C)+1])

Submission status: Runtime Error

Solution code:
C = input()

alphabet = "abcdefghijklmnopqrstuvwxyz"

alphabet_list = list[alphabet]

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

Submission status: Runtime Error

Solution code:
total_subjects, max_points, target_points = map(int, input().split())
subject_points = list(map(int, input().split()))

calc_result = (total_subjects * target_points) - sum(subject_points)

if calc_result > max_points:
    print(-1)
elif calc_result < 0:
    print(0)
else:
    print(calc_result)

Submission status: Runtime Error

Solution code:
total_subjects, max_points, target_points = map(int, input().split())
subject_points = list(map(int, input().split()))

calc_result = total_subjects * target_points - sum(subject_points)

if calc_result > max_points:
    print(-1)
elif calc_result < 0:
    print(0)
else:
    print(calc_result)

Submission status: Runtime Error

Solution code:
total_subjects, max_points, target_points = map(int, input().split())
subject_points = input().split()
total_points = 0

for subject_point in subject_points:
    total_points += int(subject_point)

calc_result = total_subjects * target_points - total_points

if calc_result > max_points:
    print(-1)
elif calc_result < 0:
    print(0)
else:
    print(calc_result)

Submission status: Runtime Error

Solution code:
C = input()
alphabetlist = [chr(i) for i in range(97, 97+26)]
next_index = alphabetlist.index(C)+1
print(alphabetlist(next_index))

Submission status: Runtime Error

Solution code:
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']
print(l[l.index(c)+1]

Submission status: Runtime Error

Solution code:
from collections import deque

H,W=[int(i) for i in input().split()]
# c=[[i for i in input().split()] for _ in range(h)]
C=list(input() for _ in range(H))
C=list(list(i) for i in C) #visited_listを用いずに壁にしていく方法ではリスト化が必要

def bfs(maze,s1,s2,g1,g2):
    for y in range(H):
        for x in range(W):
            if maze[y][x]!='#':
                maze[y][x]=10**9

    maze[s1][s2]=0
    que=deque([[s1,s2]])
    while que:
        y,x=que.popleft()
        for i,j in [(1,0),(0,1),(-1,0),(0,-1)]:
            nexty,nextx=y+i,x+j
            if nexty >= 0 and nexty < H and nextx >= 0 and nextx < W:
                dist=maze[nexty][nextx]
                if dist!='#':
                    if dist>maze[y][x]+1:
                        maze[nexty][nextx]=maze[y][x]+1
                        que.append([nexty,nextx])
    return maze[g1][g2]

ans=0
for s1,c_w in enumerate(C):
    for s2,c in enumerate(c_w):
        if C[s1][s2]!="#":
            for g1,c_w in enumerate(C):
                for g2,c in enumerate(c_w):
                    if C[g1][g2]!="#":
                        temp=bfs(C,s1,s2,g1,g2)
                        ans=max(temp,ans)
print(ans)

Submission status: Runtime Error

Solution code:
import sys

for alpha in sys.stdin:
	sys.stdout.write(chr(ord(alpha)+1))

Submission status: Runtime Error

Solution code:
import sys

alphas = [chr(i) for i in range(ord('a'), ord('z') +1)]
for alpha in sys.stdin:
	print(alphas[alphas.index(alpha)+1])