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


def resolve():
    n = int(input())
    s = input()
    l = string.ascii_uppercase * 2
    a = ""
    for i in s:
        a += l[l.index(i) + n]
    print(a)


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        N = int(input())
        S = input().rstrip()

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


# Run main
if __name__ == '__main__':
    AtCoder().main()

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
S = input()
ans = []
for s in S:
	ans.append(ascii_uppercase[(ascii_uppercase.index(s)+N)%26])
print(*ans, sep="")

Submission status: Accepted

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

result = ""
for i in range(0, len(s)):
    tmp = ord(s[i])+n
    while 0x40+26 < tmp:
        tmp -= 26
    result += chr(tmp)

print(result)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
l='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans=''
for i in s:
  for j in range(26):
    if i==l[j]:
      ans+=str(l[j+n])
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
al = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
res = []
for si in s:
    i = ord(si)-65
    i = (i+n)%26
    res.append(al[i])

print(''.join(res))

Submission status: Accepted

Solution code:
def f(alp, num):
  LI = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
  return LI[LI.find(alp)+num]

N = int(input())
S = input()
ans = ""
for i in S:
  ans += f(i,N)
  
print(ans)

Submission status: Accepted

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

abc="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"

L=len(S)

for i in range(L):
    idx=abc.index(S[i])
    ans=ans+abc[idx+N]

print(ans)

Submission status: Accepted

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

ans = ''
for ch in s:
  ans += a[a.find(ch)+n]
print(ans)

Submission status: Accepted

Solution code:
def caesar(s, n):
    ns = []
    for ch in s:
        ns.append(chr((ord(ch) - ord('A') - n) % 26 + ord('A')))

    return "".join(ns)

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

print(caesar(s, -n))

Submission status: Accepted

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

list1 = ["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"]

mods = 26
list2 = []
for i in s:
    a = (list1.index(i) +n)%mods
    list2.append(list1[a])

print("".join(list2))

Submission status: Accepted

Solution code:
al=["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=list(input())
ans=[]
for i in S:
  ans.append(al[(al.index(i)+N)%26])
  
print("".join(ans))

Submission status: Accepted

Solution code:
import string
k = str(string.ascii_uppercase)
n = int(input())
s = input()
p = ''
for i in s:
	p += k[(k.index(i)+n)%26]
print(p)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
alpha=["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"]
ans=""
for i in range(len(s)):
    si=s[i]
    si_ind=alpha.index(si)
    si_ind+=n
    if(si_ind>=len(alpha)):
        si_ind-=len(alpha)
    ans+=alpha[si_ind]
print(ans)

Submission status: Accepted

Solution code:
base_int = ord('A')
N = int(input())
S = input()


s_base = [ord(s) - base_int for s in S]
s_base = [(s + N) % 26 for s in s_base]
s_base = [chr(s + base_int) for s in s_base]

# print(s_base)
print(''.join(s_base))

Submission status: Accepted

Solution code:
n = int(input())
s = input()
ls = list('ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ')
sans = str()
for i in s:
    sans+= ls[ls.index(i) + n]

print(sans)

Submission status: Accepted

Solution code:
n = int(input())
word = input()
list1 = ['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']
new = ""
for char in word:
    new+=list1[(list1.index(char)+n)%26]
print(new)

Submission status: Accepted

Solution code:
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n = ni()
s = input()

for si in s:
  os = ord(si)
  print(chr(((os+n)-ord('A'))%26+ord('A')),end="")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
ls = ["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 s:
    if ls.index(i)+n > len(ls)-1:
        print(ls[ls.index(i)+n-len(ls)],end="")
    else:
        print(ls[ls.index(i)+n],end="")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

N = int(input())
S = list(input().strip())
L = []

for i in range(len(S)):
    if ord(S[i])+N > 90:
        L.append(ord(S[i])+N-26)
    else:
        L.append(ord(S[i])+N)

for i in range(len(S)):
    print(chr(L[i]), end="")

Submission status: Accepted

Solution code:
from string import ascii_uppercase
maketrans = str.maketrans 

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

cipher_map = maketrans(ascii_uppercase, ascii_uppercase[N:] + ascii_uppercase[:N])
ans = S.translate(cipher_map)

print(ans)

Submission status: Accepted

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

ans = [chr(ord(x)+N) if ord(x)+N <= 90 else chr(ord(x)+N-90+64) for x in S]
print("".join(ans))

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]
n=int(input())
s=input()
ans=""

for i in range(len(s)):
    tmp=n
    if ord(s[i])+n>ord("Z"):
        tmp=ord(s[i])+n-ord("Z")
        ans+=chr(tmp+ord("A")-1)
        continue
    ans+=chr(ord(s[i])+tmp)
print(ans)

Submission status: Accepted

Solution code:
x = "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"
x = x.split()
N = int(input())
S = input()

ans = []
for i in S:
    for j in range(len(x)):
        if i==x[j]:
            ans.append(x[(j+N)%26])
print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
s = input()
s1 = ""
for i in s:
    t = ord(i) + N
    if t > 90:
        t -= 26
    s1 += chr(t)
print(s1)

Submission status: Accepted

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

Submission status: Accepted

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

a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

N = N % 26
new_S = []
for i in S:
    for j in range(len(a)):
        if i == a[j]:
            new_S.append(a[j + N])
            break
print(''.join(new_S))

Submission status: Accepted

Solution code:
c='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
a=int(input())
print(''.join([c[(c.index(i)+a)%26]for i in input()]))

Submission status: Accepted

Solution code:
S = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
N = int(input())
SEQ = input()

print("".join([S[(S.find(s) + N)%len(S)] for s in SEQ]))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
p=[]
for i in range(len(s)):
	if ord(s[i])-ord("A")+n>=26:
		q=-26
	else:
		q=0
	p.append(ord(s[i])-ord("A")+q+n)
ans=""
for i in range(len(s)):
	ans+=chr(ord("A")+p[i])
print(ans)

Submission status: Accepted

Solution code:
def calc(N, s):
    abc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    d = {abc[i]: i for i in range(len(abc))}
    t = [abc[(d[c] + N) % 26] for c in s]
    return ''.join(t)


N = int(input())
s = input()
print(calc(N, s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
for n in range(len(S)):
    S[n] = ord(S[n])
    S[n] += N
    if S[n] > 90:
        S[n] -= 26
    S[n] = chr(S[n])
print(''.join(S))

Submission status: Accepted

Solution code:
n = int(input())
s = input()
a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ''
for i in range(len(s)):
    idx = n + a.find(s[i])
    ans += a[idx % 26]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
from string import ascii_uppercase as a
ans = ''
for s in S:
    i = a.index(s)
    ans += a[(i+N)%26]
print(ans)

Submission status: Accepted

Solution code:
import string

txt = string.ascii_uppercase

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

print(''.join([txt[(txt.index(i) + N) % len(txt)] for i in S]))

Submission status: Accepted

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

Submission status: Accepted

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

alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

ans = []
for s in S:
    for i, a in enumerate(alphabet):
        if s == a:
            break
    ans.append(alphabet[(i + N) % 26])

print("".join(ans))

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    N = int(inputs[0])
    S = inputs[1]
    new_s = []
    ord_a = ord('A')
    ord_z = ord('Z')
    for c in S:
        ordc = ord(c)
        ordc += N
        if ordc > ord_z:
            d = ordc - ord_z - 1
            ordc = ord_a + d
        new_s.append(chr(ordc))
    return "".join(new_s)


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(2))
    print(ret)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
ans = ""
for i in range(len(s)):
    tmp_ord = ord(s[i]) + n
    if tmp_ord > 90:
        tmp_ord = (tmp_ord - 90) + 64
    ans = ans + chr(tmp_ord)
print(ans)

Submission status: Accepted

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

def _rot13(c):
    if 'A' <= c and c <= 'Z':
        # 13 文字分ずらす
        return chr((ord(c) - ord('A') + n) % 26 + ord('A'))

    if 'a' <= c and c <= 'z':
        # 13 文字分ずらす
        return chr((ord(c) - ord('a') + n) % 26 + ord('a'))

    # その他の文字は対象外
    return c


def rot13(s):
    # ジェネレータ内包表記で文字列に ROT13 を適用する
    g = (_rot13(c) for c in s)
    # 文字列に直す
    return ''.join(g)



print(rot13(inputStr))

Submission status: Accepted

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']
for s in S:
    idx = A.index(s)+N
    if idx > 25:
        idx -= 26
    print(A[idx], end='')

Submission status: Accepted

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())
S = stdin.readline().rstrip()
ans = ''

alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

for i in range(len(S)):
    j = 0
    while alphabet[j] != S[i]:
        j += 1
    ans += alphabet[(j + N) % 26]

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import string

N = int(input().split()[0])
S = input()

s_list = list(string.ascii_uppercase + string.ascii_uppercase)
r = ""
for c in list(S):
    n = s_list.index(c)
    r += s_list[n + N]

ans = r
print(ans)

Submission status: Accepted

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

alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'*2

ans = ''
for s in S:
    i = alpha.index(s)
    ans += alpha[i+n]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
#abc146_b
import sys
import math
import collections
#sys.setrecursionlimit(100000)

n=int(input())
#tmp = input().split()
#d,c = list(map(lambda a: int(a), tmp))

s=input()
ans=""

for i in range(len(s)):
	tmp=ord(s[i])
	tmp+=n
	if(tmp>90):
		tmp-=26
	ans+=chr(tmp)

print(ans)

Submission status: Accepted

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

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

ans = ""
for i in range(len(s)):
    a = A.index(s[i])
    idx = (a + n) % 26
    ans += A[idx]

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
x=[]
abc='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(s)):
    idx=abc.find(s[i])
    x.append(abc[(idx+n)%26])
for i in range(len(s)):
    print(x[i],end='')
print()

Submission status: Accepted

Solution code:
import string
x = string.ascii_uppercase
t = int(input())
s = input()
ans = ""
for val in s:
    ans += x[(x.index(val)+t)%26]
print(ans)

Submission status: Accepted

Solution code:
#gcdは3.4.3だとfractionsにある
from fractions import gcd
import math

from math import factorial as f

from math import ceil,floor,sqrt

from sys import exit

from copy import deepcopy
import numpy as np

import bisect
import re
import heapq


from copy import deepcopy
import itertools

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))



def main():
    n = ii()
    s = list(input())

    alpha = list('ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ')



    ans = ''
    for i in s:
        for a in range(26):
            if alpha[a] == i:
                ans+=alpha[a+n]


    print(ans)

main()

Submission status: Accepted

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

T = ""

for s in S:
    T += chr((ord(s) - 65 + N) % 26 + 65)

print(T)

Submission status: Accepted

Solution code:
from string import ascii_uppercase

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

for c in s:
    x = (ascii_uppercase.index(c) + n) % len(ascii_uppercase)
    print(ascii_uppercase[x], end="")

Submission status: Accepted

Solution code:
ord_a = ord('A')
n = int(input())
l = "".join(map(lambda x:chr((ord(x)-ord_a+n)%26+ord_a), list(input())))
print(l)

Submission status: Accepted

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

ans = ''
for i in s:
    temp  = ord(i)+n
    
    if temp>90:
        temp-=26
    ans+=chr(temp)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
L = []
for i in range(len(s)):
  L.append(s[i])
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']
for i in range(len(L)):
  cur = 0
  for j in range(26):
    if Alp[j] == L[i]:
      cur = j
  if cur+n < 26:
    L[i] = Alp[cur+n]
  else:
    L[i] = Alp[cur+n-26]
print(''.join(map(str, L)))

Submission status: Accepted

Solution code:
W = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

N = int(input())
S = input()
for s in S:
    print(W[(W.index(s)+N) % len(W)],end='')
print()

Submission status: Accepted

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

for i in s:
	i = ord(i)
	t = 0
	for j in range(ord('A'), ord('Z')+1):
		if i == j:
			t = j
	t+=N
	if t>ord('Z'):
		t -= 26
	print(chr(t),end='')
print()

Submission status: Accepted

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

a = [chr(i) for i in range(ord('A'),ord('Z')+1)]

res = ""
for x in S:
    for y in range(len(a)):
        if x == a[y]:
            index = y
            break
    res += a[(y+N)%26]
print(res)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
alphabet = "abcdefghijklmnopqrstuvwxyz"
alphabet = alphabet.upper()

ans = ""
for i in s:
    ans += alphabet[(alphabet.index(i) + n)%26]
print(ans)

Submission status: Accepted

Solution code:

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

n = n%26
abc="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
dic={}
for i in range(26):
  dic[abc[i]]=abc[i+n]


tmp = [dic[si] for si in s]
ret="".join(tmp)

print(ret)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
ans = ''
for l in S:
    ans += chr(ord('A') + (ord(l) - ord('A') + N) % 26)
print(ans)

Submission status: Accepted

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

arr_init="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
arr="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"

arr_new = arr[N:N+26]

print(''.join(list(map(lambda x:arr_new[arr_init.index(x)], S))))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
d = {chr(i):i for i in range(65, 65+26)}
ans = ''
for s in S:
    ans = ans+chr((d[s]+N-65)%26+65)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
r = ""
for i in range(len(S)):
  r += chr((ord(S[i]) - ord("A") + N) % 26 + ord("A"))
print(r)

Submission status: Accepted

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

ans = ''.join([chr(ord(s) + N if ord(s) + N <= ord('Z') else ord(s) + N - 26)  for s in S])

print(ans)

Submission status: Accepted

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

def rot(c, n):
    return chr(( ord(c)-ord('A') + n) % 26 + ord('A'))

for a in s:
    print(rot(a, n), end='')

Submission status: Accepted

Solution code:
a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" * 2
N = int(input())
S = input()
ans = ""
for s in S:
    ans += a[a.index(s) + N]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
ans = ''
a = list('ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ')
for s in S:
    ind = a.index(s) + N
    # print(ind)
    ans = ans + a[ind]
print(''.join(ans))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
alphabet = [chr(i) for i in range(65, 65+26)]
T = ""
for s in S:
    i = alphabet.index(s)
    T += alphabet[(i + N) % 26]
print(T)

Submission status: Accepted

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

ALPHABET = range(ord('A'), ord('Z')+1)

def enc(k, hirabun):
    hira = list(hirabun.encode("ascii"))
    ango = hira.copy()
    for i, code in enumerate(hira):
        if code in ALPHABET:
            if code + k > 90:
                ango[i] = code + k - 26
            else:
                ango[i] = code + k
    angobun = bytes(ango).decode("ascii")
    return(angobun)

print(enc(N, S))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
ans = ''
for s in S:
    pos = ord(s)+N-65
    pos %= 26
    ans += chr(pos + 65)
print(ans)

Submission status: Accepted

Solution code:
import sys


def main():
    # input = sys.stdin.readline
    n = int(input())
    input_s = input()

    alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

    answer = ''

    for s in input_s:
        new_s = alphabet[alphabet.index(s)+n]
        answer += new_s

    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
s = input()
ans = ""
ord_a = ord("A")
f = [chr(ord_a + i) for i in range(26)]
for i in s:
  ans += f[(f.index(i) + n) % 26] 
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
ans = []
for s in S:
    ans.append(chr((ord(s) - 65 + N) % 26 + 65))

print(''.join(ans))

Submission status: Accepted

Solution code:
def main():
    tar = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    N = int(input())
    S = input()
    ans = ""
    for s in S:
        ans = ans + tar[(tar.index(s) + N) % 26]
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

N = int(input())
S = input()
S = S.lower()
enc = ""

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

print(enc.upper())

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = count = 0

n=int(input())
s=list(input())
S = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
m=len(S)
for i in range(len(s)):
    tmp=S.index(s[i])
    tmp=(tmp+n)%m
    s[i]=S[tmp]
print(*s,sep="")

Submission status: Accepted

Solution code:
n = int(input())
s = input()
l = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
for i in range(len(s)):
    for j in range(len(l)):
        if s[i] == l[j]:
            print(l[(j+n)%26], end="")
            break
print()

Submission status: Accepted

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=input()
t=""
for u in s:
  t+=a[(a.index(u)+n)%26]

print(t)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
ordA = ord('A')
ans = ''.join(list(map(lambda x: chr(ordA+(ord(x)-ordA+N)%26), S)))
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
ans = []
for c in S:
    x = (ord(c)-ord('A')+N) % 26 + ord('A')
    ans.append(chr(x))
print(''.join(ans))

Submission status: Accepted

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

outputs = []
for char in s:
    before = ord(char) - ord('A')
    after = (before + n) % 26
    outputs.append(chr(after + ord('A')))

print(''.join(outputs))

Submission status: Accepted

Solution code:
alph = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
n = int(input())
moji = input()
ans = ''
for i in range(len(moji)):
    idx = alph.index(moji[i]) + n
    if idx >= len(alph):
        idx -= len(alph)
    ans += alph[idx]

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
lets = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
outS = ''
for s in S:
  outS += lets[lets.find(s)+N]
print(outS)

Submission status: Accepted

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


def main():
    N = int(input())
    S = input().strip()
    import string
    a = string.ascii_uppercase
    a = a*2
    s = ""
    for c in S:
        s = s + a[a.index(c)+N]
    print(s)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'


def main():
    dic = {c:i for i, c in enumerate(alpha)}
    n = int(input())
    s = input()
    print(''.join([alpha[(dic[c]+n)%26] for c in s]))


if __name__ == '__main__':
    main()

Submission status: Accepted

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


for i in range(len(s)):
    x = ord(s[i])
    x += n
    if x > 90:
        x -= 26
    s[i] = chr(x)
print(''.join(s))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
M = len(S)
T = ''
for i in range(M):
    o = ord(S[i])
    o = (o+N-ord('A'))%26+ord('A')
    T = T +chr(o)
print(T)

Submission status: Accepted

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
S = (stdin.readline().rstrip())
al = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"*3

ans = ""
for i in S:
    ans += al[al.index(i)+N]
print(ans)

Submission status: Accepted

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

enc = ""

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

print(enc)

Submission status: Accepted

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

return_str = ""
for char in S:
  num = ord(char)+N
  if num > ord("Z"):
    num -= ord("Z")-ord("A")+1
  return_str += chr(num)
print(return_str)

Submission status: Accepted

Solution code:
# coding: utf-8
def main():
    l = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    n = int(input())
    S = input()
    print_line = []
    for s in S:
        print_line.append(l[(l.index(s)+n)%26])
    print(''.join(print_line))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
s=input()
a='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
b=''
for x in s:
  b+=a[(a.index(x)+n)%len(a)]
print(b)

Submission status: Accepted

Solution code:

def examB():
    N = I()
    S = SI()
    lim = ord("Z")
    ans = ""
    for s in S:
        cur = ord(s)+N
        if cur>lim:
            cur -=26
        ans += chr(cur)
    print(ans)
    return

def examC():
    return

def examD():
    return

def examE():
    return

def examF():
    return

import sys,copy,bisect,itertools
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()

Submission status: Accepted

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

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

print(''.join(x for x in s))

Submission status: Accepted

Solution code:
n = int(input())
strings = input()
letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

new_strings = ''
for s in strings:
    index = letters.index(s)
    added_index = index + n
    new_index = added_index % 26
    new_s = letters[new_index]
    new_strings += new_s

print(new_strings)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

ret = ''
for ss in s:
    ret = ret + ab[(ab.index(ss) + n) % 26]
print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(len(s)):
    c = s[i]
    co = ord(c)

    no = ord(c) + n
    if no > ord('Z'):
        no = no -  26
    s[i] = chr(no)
print("".join(s))

Submission status: Accepted

Solution code:
def main():
    k = int(input())
    s = input()
    A = []
    for c in s:
        val = ord(c) - ord('A')
        val = (val + k) % 26
        A.append(chr(val + ord('A')))
    print(''.join(A))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# ABC146b


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)

    # map(int,input().split())
    alphabet = list('abcdefghijklmnopqrstuvwxyz'.upper())
    # print('abcdefghijklmnopqrstuvwxyz'.upper().index('A'))
    n = int(input())
    s = input()[:-1]
    # print(alphabet)
    for i in s:
        #print(i, alphabet.index(i))
        print(alphabet[(alphabet.index(i)+n) % 26], end='')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

N = int(input())
S = input().strip()

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

ans = [0] * len(S)

for i, s in enumerate(S):
    ans[i] = D[D.index(s) + N]

print(''.join(ans))

Submission status: Accepted

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=input()
ANS=""
for i in range(len(S)):
    for j in range(26):
        if S[i]==A[j]:
            ANS+=A[(j+N)%26]
print(ANS)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def MI() : return map(int, input().split())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def chkprint(*args) : names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}; print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

N = I()
S = input()

alp = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]

for s in S:
    print(alp[(alp.index(s) + N) % 26], end="")

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1000000000)
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
mlmis = lambda: [-int(x) for x in input().split()]
INF = float('inf')
#

def main():
    N = ii()
    S = input()
    for s in S:
        p = ord(s) - ord('A')
        p += N
        p %= 26
        print(chr(p+ord('A')), end='')

main()

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return "".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

n = onem()

s = list(input())

k = []

for i in range(len(s)):
    kkk = ord(s[i])
    ppp = kkk+n
    if ppp >= 91:
        ppp = ppp - 91
        ppp = 65 + ppp
    k.append(chr(ppp))
print(jo(k))