Problem:


Score : 200 points

Problem Statement

We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.

Shift each character of S by N in alphabetical order (see below), and print the resulting string.

We assume that A follows Z. For example, shifting A by 2 results in C (A \to B \to C), and shifting Y by 3 results in B (Y \to Z \to A \to B).

Constraints

0 \leq N \leq 26

1 \leq |S| \leq 10^4

S consists of uppercase English letters.

Input

Input is given from Standard Input in the following format:

N
S

Output

Print the string resulting from shifting each character of S by N in alphabetical order.

Sample Input 1

2
ABCXYZ

Sample Output 1

CDEZAB

Note that A follows Z.

Sample Input 2

0
ABCXYZ

Sample Output 2

ABCXYZ

Sample Input 3

13
ABCDEFGHIJKLMNOPQRSTUVWXYZ

Sample Output 3

NOPQRSTUVWXYZABCDEFGHIJKLM



Sample input:
2
ABCXYZ


Sample output:
CDEZAB

Submission status: Accepted

Solution code:
from operator import mul
from functools import reduce
from collections import Counter
# from itertools import combinations as comb
# from itertools import permutations as perm
# from copy import copy
# 配列二分法アルゴリズム
# https://docs.python.jp/3/library/bisect.html
# import bisect
# 桁数指定
# print('{:.3f}'.format(X))
# from collections import defaultdict
# dic = defaultdict(lambda: ...)
# 値で辞書をソート
# sorted(dic.items(), key=lambda x:x[1])
# ヒープキュー
# https://docs.python.org/ja/3/library/heapq.html
# import heapq
# 正規表現(regular expression)のためのモジュール
# import re

import sys

sys.setrecursionlimit(2000)


def inpl():
    return list(map(int, input().split()))


# 重複組み合わせは nHr = (n + r - 1)Cn
def cmb(n, r):
    # combination
    if n < r:
        return 0
    r = min(n - r, r)
    if r == 0:
        return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under


def gcd(a, b):
    # greatest common divisor
    while b > 0:
        a, b = b, a % b

    return a


def lcm(a, b):
    # least common multiple
    return a * b // gcd(a, b)


al = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")

N = int(input())
S = list(input())

for i, s in enumerate(S):
    j = al.index(s)
    S[i] = al[(j + N) % 26]

print("".join(S))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    n=int(input())
    S=list(input())
    S=list(map(ord,S))
    for i in range(len(S)):
        s=S[i]
        S[i]=65+(s+n-65)%26
    S=list(map(chr,S))
    print(''.join(S))
resolve()

Submission status: Accepted

Solution code:
[chr(i) for i in range(65, 65+26)]

n = int(input())
s = list(input())

for i in range(len(s)):
  s[i] = chr((ord(s[i])+n-65)%26+65)

print("".join(s))

Submission status: Accepted

Solution code:
KEY = int(input())
PLAIN = input().lower()

enc = ""

for char in list(PLAIN):
    ASCII = ord(char)
    num = ASCII - 97
    num = (num + KEY) % 26
    ASCII = num + 97
    enc += chr(ASCII)

print(enc.upper())

Submission status: Accepted

Solution code:
n = int(input())
s = input()
r = ''
for i in range(len(s)):
    c = ord(s[i]) - ord('A') + n
    c = c % 26
    c = chr(c + ord('A'))
    r += c
print(r)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
A = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = ""
for i in range(len(S)):
  x = A.index(S[i])
  ans += A[(x + N) % 26]
print(ans)

Submission status: Accepted

Solution code:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    s = str(readline().rstrip().decode('utf-8'))
    al = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
    ans = []
    for i in range(len(s)):
        for j in range(len(al)):
            if s[i] == al[j]:
                ans.append(al[(j+n) % 26])
                break
    print("".join(ans))


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
N = int(input())
S = input()

L = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

ans = ''
for i in range(len(S)):
    ans += L[L.index(S[i])+N]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()

res = []
for c in S:
    res.append(chr((ord(c) - ord('A') + N) % 26 + ord('A')))
print(''.join(res))

Submission status: Accepted

Solution code:
n = int(input())
s = input()

ans = ""

for c in s:
    ind = ord(c) - ord('A')
    ind += n
    ind %= 26
    ans += chr(ord('A') + ind)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())

for i, x in enumerate(s):
    temp = ord(x) - ord('A')
    temp = (temp + n) % 26
    s[i] = chr(ord('A') + temp)

print(''.join(s))

Submission status: Accepted

Solution code:
words = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
n = int(input())
s = input()
ans = ""
for w in s:
    ans += words[(n+words.index(w))%26]
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def solve():
    return


def main():
    N = int(input())
    S = input()

    N %= 26

    ans = ""
    for i in range(len(S)):
        x = ((ord(S[i]) - ord('A')) + N) % 26
        ans += chr(x + ord('A'))
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

# A~Z -- START --
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']
# A~Z --- END ---

def main():
  n=I()
  s=S()

  ans=''
  for x in s:
    t=l.index(x)
    ans+=l[(t+n)%26]
  return ans

# main()
print(main())

Submission status: Accepted

Solution code:
N=int(input())
S=list(input())

T="ABCDEFGHIJKLMNOPQRSTUVWXYZ"*3

for i in range(len(S)):
    S[i]=T[T.index(S[i])+N]

print("".join(S))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
f = ""
for c in S:
    f += chr(((ord(c) - ord("A") + N) % 26) + ord("A"))
print(f)

Submission status: Accepted

Solution code:
N = int(input())
S = input()

ans = ''
for s in S:
    ans += chr(ord('A') + (ord(s) - ord('A') + N) % 26)

print(ans)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    n=int(input())
    s=input()
    ans="".join(chr((ord(c)-65+n)%26+65) for c in s)
    print(ans)
main()

Submission status: Accepted

Solution code:
N = int(input())
S = input()
ans = ''
for s in S:
    s_ = ord(s)+N
    if(s_>90):
        s_ = s_-90+64
    ans += chr(s_)
print(ans)

Submission status: Accepted

Solution code:
n = input()
print ''.join(map(lambda c: chr((ord(c) - ord('A') + n) % 26 + ord('A')), raw_input()))

Submission status: Accepted

Solution code:
n=int(input())
s=input()
for c in s:
  print(chr((ord(c)+n-65)%26+65),end="")

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())

D = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")

D = D + D

T = ""

for i in S:
  for j in range(26):
    if D[j] == i:
      T += D[j + N]
      break
print(T)

Submission status: Accepted

Solution code:
def f(c): return ord(c) - ord('A')


def g(x): return chr((x % 26) + ord('A'))


n = int(input())
print(''.join(g(x + n) for x in map(f, input())))

Submission status: Accepted

Solution code:
import string
import sys

input = sys.stdin.readline

ri = lambda: int(input())
rs = lambda: input().rstrip()
ril = lambda: list(map(int, input().split()))
rsl = lambda: input().rstrip().split()
ris = lambda n: [ri() for _ in range(n)]
rss = lambda n: [rs() for _ in range(n)]
rils = lambda n: [ril() for _ in range(n)]
rsls = lambda n: [rsl() for _ in range(n)]

n = ri()
s = rs()
res = ''
for c in s:
    res += string.ascii_uppercase[(ord(c) - ord('A') + n) % 26]
print(res)

Submission status: Accepted

Solution code:

N = int(input())

S = input()

alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"

ans = ""

for i in S:

    for j in range(26):

        if alp[j] == i:
            ans += alp[j + N]

print (ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

N = int(input())
S = input()

alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

for c in S:
    idx = alphabet.index(c) + N
    print(alphabet[idx], end='')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
input = sys.stdin.readline
INF = 10**9

n = int(input())
s = input().rstrip()
ans = ""
ordA = ord("A")
for ch in s:
    val = ord(ch) - ordA
    val = (val + n) % 26
    ans += chr(val + ordA)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = input()

t = [chr(ord('A') + (ord(s[i]) - ord('A') + n) % 26) for i in range(len(s))]
ans = ''.join(t)
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=list(input())
c=[chr(i) for i in range(65, 65+26)]
for i in range(len(s)):
  s[i]=c[(c.index(s[i])+n)%26]
print(''.join(s))

Submission status: Accepted

Solution code:
n = int(input())
s = input()
t = ""
for i in s:
    t += chr((ord(i)-ord('A')+n)%26 + ord('A'))
print(t)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    S = input()
    print(''.join(chr(ord('A') + (ord(i) - ord('A') + N) % 26) for i in S))

main()

Submission status: Accepted

Solution code:
N = int(input())
S = input()

print(''.join(map(lambda c: chr(ord(c)+N) if ord(c) + N <= ord('Z') else chr(ord(c)+N-26), S)))

Submission status: Accepted

Solution code:

N = int(input())
S = input()

ALP = [chr(i) for i in range(65, 65+26)]
A = ALP + ALP
ans = ""
for s in S:
    ind = A.index(s)
    ans += A[ind+N]
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
s = [chr((ord(i)-ord("A")+n)%26+ord("A")) for i in s]
ans = "".join(s)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()

ret = ''
for s in S :
    c = ord(s)
    c += N
    if c >= 91 :
        c = 64 + c - 90
    ret += chr(c)
print(ret)

Submission status: Accepted

Solution code:
N = input()
S = raw_input()

print "".join(chr((ord(s)-ord("A")+N)%26+ord("A")) for s in S)

Submission status: Accepted

Solution code:
N = int(input())
S = input()

ans = ""
for s in S:
    c = chr((ord(s)-65+N)%26+65)
    ans += c
print(ans)

Submission status: Accepted

Solution code:
from string import ascii_uppercase

n = int(input())
s = input()

base = ord('A')

ret = ''
for c in s:
    idx = (ord(c) - base + n) % 26 + base
    ret += chr(idx)
print(ret)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
al1 = [chr(ord('A') + i) for i in range(26)]
al2 = [chr(ord('A') + i) for i in range(26)]
al = al1 + al2
ans = ""
for i in range(len(S)):
    ans += al[al.index(S[i]) + N]
print(ans)

Submission status: Accepted

Solution code:
def main():

    N = int(input())
    S = input()
    T = ""
    for c in S:
        T += chr((ord(c)-65 + N) % 26 + 65 )
    return T

if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:
n=int(input())
s=input()

print("".join(chr((ord(i)-ord('A')+n)%26+ord('A')) for i in s))

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    s = input()
    alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"*2
    ans = [alp[alp.find(i)+n] for i in s]
    print(*ans,sep = "")
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()
s = ns().strip()
for c in s:
    x = ord(c)-ord('A')
    x = (x + n) % 26
    sys.stdout.write(chr(x+ord('A')))

Submission status: Accepted

Solution code:
n = int(input())
s = input()

ai = ord("A")

ans = ""
for e in s:
    ei = ord(e) - ai
    ei = (ei + n) % 26
    let = chr(ei + ai)
    ans += let

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())

alph = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
memo = {}
for i in range(26):
    memo[alph[i]] = i
  
for i in range(len(s)):
    tmp = (memo[s[i]] + n) % 26
    s[i] = alph[tmp]
print("".join(s))

Submission status: Accepted

Solution code:
N = int(input())
S = input()

ans = ''
for c in S:
    i = ord(c) - ord('A')
    i = (i+N)%26
    ans += chr(i + ord('A'))
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
t=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ"*2)
a=""
for i in s:a+=t[t.index(i)+n]
print(a)

Submission status: Accepted

Solution code:
def rotN(c, N):
  if 'A' <= c and c <= 'Z':
    return chr((ord(c) - ord('A') + N) % 26 + ord('A'))

N=int(input())
S=input()
ans=""
for c in S:
  ans+=rotN(c, N)
print(ans)

Submission status: Accepted

Solution code:
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353



N = int(sys.stdin.buffer.readline())
S = sys.stdin.buffer.readline().decode().rstrip()

ans = ''
for c in S:
    ans +=chr(((ord(c) + N) - ord('A')) % 26 + ord("A"))
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
import sys
import bisect
import heapq
import math

# input = sys.stdin.readline

sys.setrecursionlimit(1000000000)

MIN = -10 ** 9
MOD = 10 ** 9 + 7

ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"


def main():
    N = int(input())
    S = input()

    res = ""
    for i in range(len(S)):
        c = S[i]
        ind = ALPHA.index(c)
        kk = (ind + N) % len(ALPHA)
        res += ALPHA[kk]
    print(res)

    # A, B = [int(a) for a in input().split()]


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
r = ""
S = input()
for s in S :
    m = ord(s)+n
    if m > ord("Z") :
        m -= 26
    r+=chr(m)
print(r)

Submission status: Runtime Error

Solution code:
N=int(input())
S=input()
l="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(0,len(S)):
    for j in range(0,26):
        if S[i]==l[j]:
            S[i]=l[(j+N)%26]
print(S)

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
ans=[]
for i in range(n):
    num=ord(s[i])+2
    if num>90:
        num-=90
    ans.append(chr(num))
ans="".join(ans)
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
for i in range(len(s)):
  s[i] = chr(ord((s[i]-65+n) % 26 + 65))
print(s)

Submission status: Runtime Error

Solution code:
A, B, X = map(int, input().split())
lb = 0
rb = 10**9+1
while(rb - lb > 1):
  mid = (lb + rb)//2
  if A * mid + B * len(str(mid)) > X:
    rb = mid
  else:
    lb = mid
print(lb)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**9)
n = int(input())
ab = []
t = [[] for _ in range(n)]
for _ in range(n-1):
  a,b = map(lambda x:int(x)-1,input().split())
  t[a].append(b)
  t[b].append(a)
  ab.append((min(a,b),max(a,b)))
k = max(map(len,t))
d = {}
def dfs(pre,cur,col):
  cn = 1 if col != 1 else 2
  for i in t[cur]:
    if i == pre:
      continue
    d[(min(i,cur),max(i,cur))] = cn
    dfs(cur,i,cn)
    cn += 1
    if col == cn:
      cn += 1
dfs(0,0,0)
print(k)
for i in ab:
  print(d[i])

Submission status: Runtime Error

Solution code:
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"]
n=int(input())
s=str(input())
x=n%26
for i in range(len(A)):
  for j in range(25):
    if s[i]==A[j]:
      if j+x<=25:
        s[i]=A[j+x]
        break
      else:
        s[i]=A[j+x-26]
        break

print(s)

Submission status: Runtime Error

Solution code:
N=int(input())
S=list(map(str, input()))
li=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','W','X','Y','Z']
answer=[]
for i in range(len(S)):
  for j in range(len(li)):
    if S[i]==li[j] and j<len(li)-N:
      answer.append(li[j+N])
    elif S[i]==li[j] and j>=len(li)-N:
      answer.append(li[j+N-len(li)])
print("".join(answer))

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
x = len(s)
for i in range(x):
  a = s[i]
  b = ord(a)
  c = ord("A")
  d = (b + n - c)%26
  s[i] = chr(c + d)
print(s)

Submission status: Runtime Error

Solution code:
n = int(input())
A = list(input())
A_change={}
B = [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 A:
  for j in B:
    if i==j:
      A_change[i] = str(B[(B.index(j)+n)%26])
print(list(A_change.values()))

Submission status: Runtime Error

Solution code:
n = int(input())
A = list(input())
A_change={}
B = [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 A:
  for j in B:
    if i= j:
      A_change[i] = B[(B.index(j)+n)%26]
print(list(A_change.values()))

Submission status: Runtime Error

Solution code:
n = int(input())
A = list(input())
A_change={}
B = [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 A:
  for j in B:
    if A[i]=B[j]
  A_change[i] = B[(j+n)%26]
print(list(A_change.values()))

Submission status: Runtime Error

Solution code:
import string
l = string.ascii_uppercase

N = int(input())
S = input()

ans = []
plusNumber = N % 26
for c in S :
    ans.append(l[l.index(c) + plusNumber])
print("".join(ans))

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
I="abcdefghijklmnopqrstuvwxyz"
for i in range(len(s)):
    s[i]=I[i+n]
print(s)

Submission status: Runtime Error

Solution code:
import sys
import string
import itertools
N = int(input())
S = list(input())
array = string.ascii_uppercase

for I in S:
    if array.index(I) + N <= 25:
        print(array[array.index(I) + N],end='')
    else:
        print(array[(array.index(I) + N) - 25],end='')
print('\n')

Submission status: Runtime Error

Solution code:
import sys
import string
import itertools
N = int(input())
S = list(input())
array = string.ascii_uppercase

for I in S:
    if array.index(I) + N <= 25:
        print(array[array.index(I) + N],end='')
    else:
        print(array[(array.index(I) + N) - 25],end='')

Submission status: Runtime Error

Solution code:
N=int(input())
S=input()
tmp=""
for i in range(N):
  if(S[i]!="Z"):
    tmp+=chr(ord(S[i])+1)
  else:
    tmp+="A"
print(tmp)

Submission status: Runtime Error

Solution code:
N=int(input())
S=input()
tmp=""
for i in range(N):
  if(S[i]!=Z):
    tmp+=chr(ord(S[i])+1)
  else:
    tmp+="A"
print(tmp)

Submission status: Runtime Error

Solution code:
alphabet = list("ABCDEFGHRJKLMNOPQRSTUVWXYZ")
n = int(input())
s = input()
for i in s:
  #print(i, alphabet.index(i))
  print(alphabet[(alphabet.index(i)+n) % 26], end='')

Submission status: Runtime Error

Solution code:
n = int(input())

def push(chara, dig):
  if ord(chara) + dig > 90: return chr(64 + dig + ord(chara) -90)
  else: return chr(dig + ord(chara))
  
string = input()

for i in range(0, len(string)):
  string[i] = push(string[i], n)
  
print(string)

Submission status: Runtime Error

Solution code:
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']
N=int(input())
X=input()
for i in range(0,len(X)-1):
  n=(A.index(X[i])+N)%26
  X[i]=A[n]
print(X)

Submission status: Runtime Error

Solution code:
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']
N=int(input())
X=input()
for i in range(0,len(X)-1):
  n=(A.index(i)+N)%26
  X[i]=A[n]
print(X)

Submission status: Runtime Error

Solution code:
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']
N=int(input())
X=input()
for i in range(0,len(X)):
  n=(A.index(i)+N)%26
  X[i]=A[n]
print(X)

Submission status: Runtime Error

Solution code:
N = int(input())
S = input()
alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

new_S = list()
for word in S:
    num = alpha.index(word)+N
    if num > 25:
        num -= 25
    new_S.append(alpha[num])
print(''.join(new_S))

Submission status: Runtime Error

Solution code:
N=int(input())
S=input()

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','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']
anslist=[]

for i in range(len(S)):
    b=a.index(S[i])
    ans.append(a[b+N])

ans="".join(anslist)

Submission status: Runtime Error

Solution code:
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]*2
N = int(input())
S = list(input())
for i in range(len(S)):
  Anum = Alp.index(S[i])
  S.replace(S[i],Alp[Anum+N])
print("".join(S))

Submission status: Runtime Error

Solution code:
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]*2
N = int(input())
S = list(input())
for i in range(len(S)):
	Anum = Alp.index(S[i])
    S.replace(S[i],Alp[Anum+N])
print("".join(S))

Submission status: Runtime Error

Solution code:
arb='ABCDEFDHIJKLMNOPQRSTUVWXYZ'
N = int(input())
S = input()
ans =''
for i in range(len(S)):
    if arb.index(S[i]) + N +1 <= len(arb):
        ans += arb[arb.index(S[i])+N]
    else:
        ans += arb[-len(arb) + arb.index(S[i]) + N]
print(ans)

Submission status: Runtime Error

Solution code:
import sys

def main():
    input = sys.stdin.readline
    n = int(input())
    s = input().rsplit()
    first = ord("A") - 1
    last = ord("Z")
    increment = lambda x: chr(ord(x)+n) if ord(x)+n <= last else chr(first + (ord(x)+n - last))
    new_s = "".join(map(increment, s))
    print(new_s, end="")
    


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
from string import ascii_uppercase


def actual(n, s):
    answer = ''

    for char in s:
        # mod 26 で 26パターンに分類できる。 `-13` はidx調整項
        old_ord = ord(char) % 26
        shift_n = n % 26
        idx_shift_n = old_ord + shift_n - 13

        answer += ascii_uppercase[idx_shift_n]

    return answer

n = int(input())
s = input()

print(actual(n, s))

Submission status: Runtime Error

Solution code:
from string import ascii_uppercase


def actual(n, s):
    answer = ''

    for char in s:
        # mod 26 で 26パターンに分類できる。 `-13` はidx調整項
        idx_shift_n = (ord(char) % 26) + n - 13

        answer += ascii_uppercase[idx_shift_n]

    return answer


n = int(input())
s = input()

print(actual(n, s))

Submission status: Runtime Error

Solution code:
from string import ascii_uppercase


def actual(n, s):
    answer = ''

    for char in s:
        # mod 26 で 26パターンに分類できる。 `-13` はidx調整項
        idx_shift_n = (ord(char) % 26) + n - 13

        answer += ascii_uppercase[idx_shift_n]

    return answer

n = int(input())
s = input()

print(actual(n, s))

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <sstream>
using namespace std;


int main(){
    int n;
    string a,b;
    cin >> n;
    cin >> a;
    b = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    for (int x = 0; x < a.size() ; x++){
        for (int i = 0; i < 26 ; i++){
            if (a.at(x) == b.at(i)){
                if (i < 26 - n)
                    cout << b.at(i + n);
                else
                    cout << b.at(i - 26 + n);
            }
        }
    }
    cout << endl;
    
}

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <cassert>

using namespace std;
typedef long long LL;
template <typename F, typename S> std::ostream& operator<<(ostream& os, const pair<F,S>& p) {
    os << "(" << p.first << "," << p.second << ")"; return os; }
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    os << "["; for(const T& a: v){ os << a << ", "; } os << "]"; return os; }
template <typename K, typename V> ostream& operator<<(ostream& os, const map<K,V>& m) {
    os << "{"; for(const auto& p: m){ os << p.first <<":"<< p.second << ", "; } os << "}"; return os; }


// import here

int main(){
    LL n;
    cin >> n;
    string s;
    cin >> s;
    for(LL i = 0; i < s.size(); ++i){
        s[i] = (s[i] + n - 'A') % 26 + 'A';
    }
    cout << s << endl;
    return 0;
}

Submission status: Runtime Error

Solution code:
n = int(input())
S = input()

ANS = ''
for s in S:
    if ord(s) + n < ord('Z'):
        ANS += chr(ord(s) + n)
    else:
        ANS += chr(ord(s) + n -26(ord(s) + n)%26)
print(ANS)

Submission status: Runtime Error

Solution code:
N = input()
S = input()
rot = "rot"+N
print(codecs.decode(S,rot))

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
b = ""
ab = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in range(int(len(s))):
    for j in range(int(len(ab))):
        if (s[i] == ab[j]):
            if (int(j+n) > 25):
                b += ab[j+n-25]
                break
            else:
                b += ab[j+n]
                break

print(b)

Submission status: Runtime Error

Solution code:
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
n = int(input())
print(alphabet[(alphabet.index(input())+n)%26])

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
l = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ') * 2
a = ''

for i in s:
    a += l[l.index(i) + n]

pritn(a)

Submission status: Runtime Error

Solution code:
n=int(input())
s=list(input())
a=[chr(i) for i in range(65,65+26)]

for i in range(n):
  for j in range(26):
    if s[i]==a[j]:
      s[i]=a[(j+n)%26]
print(''.join(s))

Submission status: Runtime Error

Solution code:
k=int(input())
s=input()
n=len(s)
for i in range(n):
    z=ord(s[i]+k)
    if z>123:
        z-=27
    s[i]=chr(z)
print(s)

Submission status: Runtime Error

Solution code:
N = int(input())
S = list(input())

result = ''
for i in range(0,N):
  num = ord(S[i])
  new = chr(num+2)
  result += new

print(result)

Submission status: Runtime Error

Solution code:
N = int(input())
S = str(input())
ans = []
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','Z']

for i in range(len(S)):
    tmp = lst.index(S[i])
    tmp += N
    if tmp > 25:
        tmp -= 25
    ans.append(lst[tmp])
print(''.join(ans))

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
S = ''
list = [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]*2

for i in range(len(s)):
  S += list[list.index('i') + n]
  
print(S)

Submission status: Runtime Error

Solution code:
S = str(input())
N = int(input())
ans = []
tmp = 0

for i in range(0,len(S)):
  tmp = N+ord(S[i])
  if tmp >= 91:
    tmp = tmp - 26
  ans.append(chr(tmp))

print("".join(ans))

Submission status: Runtime Error

Solution code:
a=int(input())
s=input()
for i in range(a):
  d=List[i]+a
  if d>=91:
    d-=26
  print(d,end="")

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
for i in s:
    print((i-'A'+n)%26+'A')

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()

ans = ""
for i in range(n):
  ascii = ord(s[i]) + n
  if ascii > ord('Z'):
    ascii -= ord('A')
  ans += char(ascii)

print(ans)

Submission status: Runtime Error

Solution code:
N=int(input())
S=input()
L='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans=''
for i in range(len(S)):
  a=S[i]
  index=L.find(a)
  b=L[index+N]
  ans=ans+b
prin(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
for i in s:
    i=chr()
ans="".join(s)
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
s = str(input())
for i in range(n):
    if s[i] == "Z":
        print("A",end="")
    else:
        print(chr(ord(s[i])+1),end="")
print()

Submission status: Runtime Error

Solution code:
n = input()
s = raw_input()
l = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
r = ""
for i in s:
    r += l[l.index(i)+n]
print r

Submission status: Runtime Error

Solution code:
N = int(input())
S = input(())
a = len(S)
A = chr(ord(S[0])+N)
for i in range(1,N):
  A += chr(ord(S[i])+N)
print(A)

Submission status: Runtime Error

Solution code:
n = int(input())
moji = str(input())
alphabet = ["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"]
lst = list(moji)
for i in range(len(lst)):
  num = alphabet.index(lst[i])
  if i + n > 25:
    lst[i] = alphabet[i+n-26]
  else:
    lst[i] = alphabet[i+n]
ans = ""
for j in range(len(lst)):
  ans += lst[j]
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
s = str(input())
c = len(s)
for i in range(c):
  if (ord(s[i])+n)>90:
    s[i] = chr(ord(s[i])+n-26)
  else:
    s[i] = chr(ord(s[i])+n)
print(s)

Submission status: Runtime Error

Solution code:
n = int(input())
s = inuput()
alfha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ''
for i in s:
  a += alfha[(alfha.index(i)+n) % 26]
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
list=ABCDEFGHIJKLMNOPQRSTUVWXYZ
for i in range(len(s)):
  x=list[(list.index(s[i])+n)%26]
  s.replace(s[i],x)
print(s)

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()
list=ABCDEFGHIJKLMNOPQRSTUVWXYZ
for i in range(len(s)):
  x=list[(list.index(s[i])+n)%26]
  s.replace(s[i],x)

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
for i in range(len(s)):
    for j in range(26):
        if s[i]==alpha[j]:
            s = s[:i]+alpha[j+n]+s[i+1:]
            break
print(s)