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 sys
import codecs
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

def main():
    N=int(input())
    S=list(input())
    ans=''
    for a in S:
        ans+=chr(ord(a)+N) if ord(a)+N<=90 else chr(ord(a)+N-26)
    print(ans)
    

if __name__ == '__main__':
    main()

Submission status: Accepted

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


a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ""
for w in s:
    if a.index(w)+n <= 25:
        ans += a[a.index(w) + n]
    else:
        ans += a[a.index(w) + n - 26]

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
a = []


for i in range(len(s)):
    if ord(s[i])+n > 90:
        a.append(chr(ord(s[i])+n-26))
    else:
        a.append(chr(ord(s[i])+n))

for j in range(len(s)):
    print(a[j], end="")

Submission status: Accepted

Solution code:
alp='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
n=int(input())
s=input()
num=[]
for i in range(len(s)):
    num.append(alp.index(s[i]))
import numpy as np
num=np.array(num)
num=(num+n)%26
ans=''
for i in num:
    ans+=alp[i]
    
print(ans)

Submission status: Accepted

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

LETTERS = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
LETTERS_dict = {}
for i in range(26):
    LETTERS_dict[LETTERS[i]] = i
ans = ""
for s in S:
    ans = ans + LETTERS[(LETTERS_dict[s]+N)%26]
print(ans)

Submission status: Accepted

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

num2alpha = lambda c: chr(c+64)
alpha2num = lambda c: ord(c) - ord('A') + 1

ans = []

for s in S:
    num = alpha2num(s)
    new = num + n
    if new >= 27:
        new -= 26
    ans.append(num2alpha(new))

print(''.join(ans))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
lens = len(S)
ans = ''
for i in range(lens):
    ind = alpha.index(S[i])
    next = ind + N
    if next >= 26:
        next -= 26
    ans += alpha[next]
print(ans)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    S = input()
    al = [chr(i) for i in range(65, 65+26)]
    ans = ""
    for i in range(len(S)):
        let = S[i]
        ind = al.index(let) + N
        ind = ind % 26
        ans += al[ind]
    print(ans)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
s_ = input()
l= len(s_)
s = []

for i in range(l):
    s.append(str.upper(chr((ord(str.lower(s_[i]))-97+n)%26+97)))
    
print(''.join(s))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
ans = ""
for i in S:
    tmp = ord(i)
    tmp += N
    if(tmp>90):
        tmp -= 26
    ans += chr(tmp)
print(ans)

Submission status: Accepted

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"]
n=int(input())
s=input()
for i in list(s):
  print(l[(l.index(i)+n)%26],end="")

Submission status: Accepted

Solution code:
n=int(input())
s=input()
ans=""
alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
lists=list(alpha)

listss=[0 for i in range(26)]
for i in range(26):
    j=i+n
    if j>=26:
        j-=26
    listss[i]=lists[j]
for i in range(len(s)):
    for j in range(26):
      if lists[j]==s[i]:
        
      	ans+=listss[j]
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = str(input())
a = str("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
k = len(s)
ans = str("")
for i in range(k):
    for j in range(26):
        if s[i] == a[j]:
            ans += a[j+n]
print(ans)

Submission status: Accepted

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

alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

ans = ''
for s in S:
    pos = alpha.find(s)+N
    ans += alpha[pos%26]
print(ans)

Submission status: Accepted

Solution code:
def shift(char, i):
    c_ord = ord(char)
    return chr(65 + (c_ord - 65 + i) % 26)


i = int(input())
print("".join(map(lambda x: shift(x, i), input())))

Submission status: Accepted

Solution code:

# -*- coding: utf-8 -*-
 
def _rotx(c,x):
    if 'A' <= c and c <= 'Z':
        # 13 文字分ずらす
        return chr((ord(c) - ord('A') + x) % 26 + ord('A'))
    return c

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

n = int(input())
s = str(input())
print(rotx(s,n))

Submission status: Accepted

Solution code:
n = int(input())
s = input()
alph=[chr(ord('A') + i) for i in range(26)]
ans = []
for i in range(len(s)):
    alph_idx = alph.index(s[i]) + n
    if alph_idx >= 26:
        alph_idx -= 26
    ans.append(alph[alph_idx])
print(''.join(ans))

Submission status: Accepted

Solution code:
def main():
    # input
    n = int(input())
    s = list(input())

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
N=int(input())
S=input()
ans=""
for c in S:
  ans+=alpha[alpha.find(c)+N]
print(ans)

Submission status: Accepted

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',"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)):
    ans+=l[l.index(s[i])+n]
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=list(input())
b=[chr(i) for i in range(65, 65+26)]
#print(b)
a= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(s)):
    for j in range(len(b)):
        if s[i]==b[j]:
            s[i]=b[(j+n)%26]
            break
print(''.join(s))

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
n = len(S)
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in range(n):
    id = alphabet.index(S[i])
    if id + N <= 25:
        S[i] = alphabet[id+N]
    else:

        S[i] = alphabet[(id+N)-26]

print("".join(S))

Submission status: Accepted

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

for i in range(len(s)):
	num = int(ord(s[i])+n)
	if num > 90:
		num -= 26
	print(chr(num),end="")

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()

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

Submission status: Accepted

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

for i in range(len(S)):
    current_i = a.index(S[i])
    next_i = (current_i + N) % 26
    S[i] = a[next_i]

print(''.join(S))

Submission status: Accepted

Solution code:
alphabets=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N=int(input())
s=list(input())

for i in range(len(s)):
    idx=alphabets.index(s[i])
    n=(N+idx)%26
    s[i]=alphabets[n]

print("".join(s))

Submission status: Accepted

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

def solve():
    N = int(input())
    S = input()
    d = {chr(65+s):chr(65+(s+N)%26) for s in range(26)}
    table = str.maketrans(d)
    res = S.translate(table)
    return res

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

Submission status: Accepted

Solution code:
n=int(input())
s=input()
words="ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
add=[]
for i in s:
    add.append(words.index(i)+n)

ans=""
for i in add:
    ans +=words[i]
print(ans)

Submission status: Accepted

Solution code:
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']*2
n = int(input())
s = input()
ans = ''
for i in s:
    c = ab.index(i)+n
    ans += ab[c]
print(ans)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

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

ans = []
Aord, Zord = 65, 90
for si in S:
	iord = ord(si)+N
	if iord>90: iord -= 26
	ans.append(chr(iord))

print(*ans,sep='')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
S = list(input())[: -1]
a = ord("A")
z = ord("Z")
#print(S)

for i in range(len(S)):
  t = ord(S[i]) + N
  if t > z:
    t = t % z + a - 1
  S[i] = chr(t)
print("".join(S))

Submission status: Accepted

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


M = 26


def conv_char(n, c):
    return chr(ord('A') + (ord(c) - ord('A') + n) % M)


def convert(n, s):
    return "".join(conv_char(n, c) for c in s)


def main():
    n = int(input())
    s = input()
    t = convert(n, s)
    print(t)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
s = list(input())

alphabet = {c:i for i, c in enumerate(list("ABCDEFGHIJKLMNOPQRSTUVWXYZ"))}
ialphabet = {i:c for i, c in enumerate(list("ABCDEFGHIJKLMNOPQRSTUVWXYZ"))}
rst = ''

for c in s:
    idx = alphabet[c]
    new_idx = (idx + n) % 26
    rst += ialphabet[new_idx]

print(rst)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
l=[chr(i) for i in range(65, 65+26)]
ln=[chr(65+i%26) for i in range(n, n+26)]
mydict={}
for i in range(26):
    mydict[l[i]]=ln[i]
print(s.translate(str.maketrans(mydict)))

Submission status: Accepted

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

def f(n):
    m = n + N
    if m > 90:
        m -= 26
    return chr(m)

dic = {chr(n):f(n) for n in range(65,91)}
ans = []
for char in S:
    ans.append(dic[char])
print(''.join(ans))

Submission status: Accepted

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

def main():
    N = int(input())
    S = input().strip()
    ALF = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"

    Ans = ""
    for Si in S:
        index = ord(Si)-ord("A") + N
        Ans += ALF[index]

    print(Ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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 i in range(len(S)):
    s=S[i]
    SS[i]=A[(A.index(s)+N)%26]
for j in range(len(S)):
    print(SS[j],end="")

Submission status: Accepted

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

# 暗号化した文字列の結果を格納                                                 
result = ""
for c in s:
    # 暗号化する処理                                                           
    if ord('a') <= ord(c) <= ord('z') :
        result = result + chr(abs(((ord(c) +n - ord('a')) % 26)) + ord('a'))
    else :
        result = result + chr(abs(((ord(c) + n - ord('A')) % 26)) + ord('A'))
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N = int(input())
s = input()
base = ord("A")

print("".join([chr(base+((ord(c)-base+N)%26)) for c in s]))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, S):
    ans = 0
    a = []
    for c in S:
        a.append(chr(((ord(c) - ord('A')) + N) % 26 + ord('A')))
    return ''.join(a)


def main():
    N = read_int()
    S = read_str()
    print(slv(N, S))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

def readInts():
  return [int(s) for s in input().split(" ")]

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

def main():
  N = readInts()[0]
  S = input()

  ans = ""
  for c in S:
    ans += char(c, N)
  print(ans)

if __name__ == "__main__":
  main()

Submission status: Accepted

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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

N = INT()
S = input()

ans = []
for s in S:
    t = ord(s) + N
    if t > 90:
        t -= 26
    ans.append(chr(t))
print(''.join(ans))

Submission status: Accepted

Solution code:
N=int(input())
S=list(input())
alphabets=list(str("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"))
a=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
narabikae=alphabets[N:N+26]
print("".join([narabikae[a.index(thing)] for thing in S]))

Submission status: Accepted

Solution code:
n = int(input())
S = list(input())
C = []
a = 65
z = 90

for s in S:
	sss = ord(s)+n
	if sss > 90:
		sss = sss-26
	C.append(sss)

ans = []
[ans.append(chr(c)) for c in C]
print("".join(ans))

Submission status: Accepted

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

print(*([abc[(abc.index(s)+N) % 26] for s in S]), sep='')

Submission status: Accepted

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

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

print(ret)

Submission status: Accepted

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

alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

print(S.translate(str.maketrans(alphabet, alphabet[N:] + alphabet[:N])))

Submission status: Accepted

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

ans = ''
for x in s:
    ans += chr(abs(((ord(x) + n - ord('A')) % 26)) + ord('A'))

print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)
INF = 10**30
import string

def main():
    n = int(input().strip())
    v = input().strip()
    newv = [0] * (len(v))
    al = string.ascii_uppercase
    for i, c in enumerate(v):
        newv[i] = al[(al.index(c) + n) % len(al)]
    print("".join(newv))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
S = input()
result = ''
for s in S:
    for i in range(N):
        s = chr(ord(s) + 1)
        if s == '[':
            s = 'A'
    result += s

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())


S = input()


S_new = ''

for c in S:
    ascii = ord(c)
    ascii_new = ascii + N

    if ascii_new > 90:
        ascii_new = ascii_new - 90 + 64


    S_new += chr(ascii_new)


print(S_new)

Submission status: Accepted

Solution code:
def enc(k,m):
    a = list(m.encode("ascii"))
    for i in range(0,len(a)):
        if ord('a') <= a[i] <= ord('z') - k:
            a[i] = a[i] + k
        elif ord('z') - k < a[i] <= ord('z'):
            a[i] = a[i] + k - (ord('z') - ord('a') + 1)
        elif ord('A') <= a[i] <= ord('Z') - k:
            a[i] = a[i] + k
        elif ord('Z') - k < a[i] <= ord('Z'):
            a[i] = a[i] + k - (ord('Z') - ord('A') + 1)
        else:
            pass
    b = bytes(a).decode("ascii")
    return b


N = int(input())
S = input()
print(enc(N,S))

Submission status: Accepted

Solution code:
n = int(input())
s = input()
ans = []
target = ["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:
  ans.append(target[(target.index(i)+n) % 26])
print(*ans,sep="")

Submission status: Accepted

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

for i in range(len(s)):
    idx = a.index(s[i])
    #print('idx:', idx)
    target = a[(idx + n)%26]
    #print('target:', target)
    ans += target

print(ans)

Submission status: Accepted

Solution code:
def getConverseCodes(S, n):
    converseCodes = ''
    for s in S:
        s = ord(s)
        if 65 <= s and s<= 90:
            s = s + n
            if s > 90:
                s = s - 26
        s = chr(s)
        converseCodes += s
    return converseCodes

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

print(getConverseCodes(S, N))

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
j = list()
for i in S:
    j.append(chr(((ord(i)-65)+N)%26+65))
print("".join(j))

Submission status: Accepted

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

N = int(input())
S = list(str(input()))
ans = []
for i in S:
    Y = alfa.index(i)
    Z = (Y + N) % 26
    ans.append(alfa[Z])
print(''.join(ans))

Submission status: Accepted

Solution code:
dic = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
N = int(input())
S = input().rstrip()
print("".join([dic[(dic.index(s) + N) % 26] for s in S]))

Submission status: Accepted

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

d = {1:'A',2:'B',3:'C',4:'D',5:'E',6:'F',7:'G',8:'H',9:'I',10:'J',11:'K',12:'L',13:'M',14:'N',15:'O',16:'P',17:'Q',18:'R',19:'S',20:'T',21:'U',22:'V',23:'W',24:'X',25:'Y',26:'Z'}

def get(d, val):
    keys = [k for k, v in d.items() if v == val]
    if keys:
        return keys[0]
    return None

ans = ''

for x in s:
    if n + get(d,x) >=27:
        ans = ans + d[n+get(d,x)-26]
    else:
        ans = ans + d[n+get(d,x)]

print(ans)

Submission status: Accepted

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

ans = ""

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

    if 65 <= s & s <= 90:
        s = s + N
        if s > 90:
            s = s - 26
    
    elif 97 <= s & s <= 122:
        s = s + 13
        if s > 122:
            s = s - 26
    
    ans += chr(s)

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)

alph = {}
index = {}
for i, a in enumerate("ABCDEFGHIJKLMNOPQRSTUVWXYZ"):
    alph[a] = i
    index[i] = a


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

ans = ""
for s in S:
    ans += index[(alph[s] + N) % 26]
print(ans)

Submission status: Accepted

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

l = len(list(s))
res = ""

for i in range(l):
    a = ord(s[i])
    if a+n <= 90:
        res += chr(a+n)
    else:
        res += chr(a+n-26)
    
print(res)

Submission status: Accepted

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

for i, Si in enumerate(S):
    ord_ans = ord(Si) + N
    if ord_ans > ord('Z'):
        ord_ans = ord('A') + (ord_ans - ord('Z') - 1)
    S[i] = chr(ord_ans)

print(''.join(S))

Submission status: Accepted

Solution code:
n=int(input())
s=list(str(input()))
m=len(s)
t=''
l='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(m):
    c=l.find(str(s[i]))
    if c+n>=26:
        t+=l[c+n-26]
    else:
        t+=l[c+n]
print(t)

Submission status: Accepted

Solution code:
n=int(input())
#a,b=map(int,input().split())
#c=list(map(int,input().split()))
#print(n,a,b,c)
s=list(input())
t=[]
ll=['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:
  tmp=ll.index(i)
  t.append(ll[(tmp+n)%26])
#print(s)
print("".join(t))

Submission status: Accepted

Solution code:
N = int(input())
a = input()
t = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
s = []
for i in a:
  s.append(t[(t.index(i)+N)%len(t)])
  
for i in s:
  print(i,end="")

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(S))

Submission status: Accepted

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

for w in S:
    code = ord(w) + N
    if code > 90:
        code -= 26
    print(chr(code), end='')

Submission status: Accepted

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

def rot(S, N):
  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)
  enc = enc.upper()
  return enc

print(rot(S, N))

Submission status: Accepted

Solution code:
n = int(input())
s = list(map(str,input()))

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

print("".join(s))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N=int(input())
S=list(input())

for i in range(len(S)):
    temp=ord(S[i])
    temp+=N
    if temp>=(65+26):
        temp-=26
    S[i]=chr(temp)

print("".join(S))

Submission status: Accepted

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

def change(s):
    num = ord(s)-ord('A')
    num = (num+N)%26+65
    print(chr(num), end='')
for i in S:
    change(i)

Submission status: Accepted

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

output = ''
for s in S:
    i = ord(s)
    i = i + N
    if (i > 90):
        j = i % 90
        i = 64 + j
    output += chr(i)

print(output)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
al = [chr(i) for i in range(65, 65+26)] + [chr(i) for i in range(65, 65+26)]
ans = ''
for i in s:
    ans += al[al.index(i)+n]
print(ans)

Submission status: Accepted

Solution code:
a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ4'

n = int(input())
s = input()
r = ''

for i in s:
	r += a[(a.index(i) + n) % 26]

print(r)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

alpha2num = lambda c: ord(c) - ord('A') + 1
num2alpha = lambda c: chr(c+64)

ans = ""
for i in s:
  num = alpha2num(i)+n
  if num > 26:
    num -= 26
  ans += num2alpha(num)
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
s = stdin.readline().rstrip()

S = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'*2

sn = ""

for i in s:
    sn += S[S.index(i)+n]

print(sn)

Submission status: Accepted

Solution code:
N = int(input())
S = list(map(str, input()))

for s in S:
	if ord(s) + N > 90:
		print(chr(int(ord(s)) + N - 26), end = "")
	else:
		print(chr(int(ord(s)) + N), end = "")

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
a = ord("A")

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

moji = ""

for i in range(len(s)):
	s[i] =chr(s[i]+a)

	moji +=s[i]
print(moji)

Submission status: Accepted

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

c=["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)):
    for j in range(len(c)):
        if s[i]==c[j]:
            ans+=c[(j+n)%len(c)]
print(ans)

Submission status: Accepted

Solution code:
N = int(input().strip())
S = input().strip()
ans = ""
head = ord("A")
for s in S:
    ans += chr(((ord(s) - head) + N ) % 26 + head)
    #print(chr(((ord(s) - head) + N ) % 26 + head))
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input().strip()
x = ""
for i in range(len(S)):
    a = ord(S[i])+N
    if a<=90:
        x += chr(a)
    else:
        x += chr(a-26)
print(x)

Submission status: Accepted

Solution code:
def main():
    import string
    uc=string.ascii_uppercase
    a={uc[i]:i for i in range(26)}
    uc=uc+uc
    n=int(input())
    s=input()
    t=""
    for i in s:
        t+=uc[a[i]+n]
    print(t)
main()

Submission status: Accepted

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

for i in range(len(s)):
    nex = ord(s[i:i+1])+n
    if nex <= 90:   
        ans += chr(nex)
    else:
        ans += chr(65+nex-91)

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
data = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
res = ""
for i in range(0,len(S)):
    ind = data.index(S[i])+N
    ind = ind%len(data)
    res += data[ind]
print(res)

Submission status: Accepted

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

ans=""
for i in s:
    m=ord(i)+n
    if m>90:
        m-=90
        m+=64
    ans+=chr(m)
print(ans)

Submission status: Accepted

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

alf = [
    '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 s in S:
    ans += alf[(alf.index(s) + N) % 26]

print(ans)

Submission status: Accepted

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

abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in S:
    print(abc[abc.find(i)+N],end="")

Submission status: Accepted

Solution code:
N = int(input())
S = 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 i in range(len(S)):
    id = lis.index(S[i])
    id += N
    id = id%26
    print(lis[id],end="")

Submission status: Accepted

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

alpha = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ') * 2
ans = ''

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

print(ans)

Submission status: Accepted

Solution code:
def _rotN(c,N):
    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

N=int(input())
S=str(input())
print(''.join((_rotN(c,N) for c in S)))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
AB = [chr(ord('A') + i) for i in range(26)]
R = ""

for i in range(len(S)):
    for j in range(26):
        if S[i] == AB[j]:
            m = j
    m = m + N
    if m >= 26:
        m = m - 26
    R = R + AB[m]
print(R)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
output = ""
for i in range(len(S)):
    StoN = ord(S[i])
    StoN += N
    if(StoN >= 91):
        StoN -= 26
    output += chr(StoN)

print(output)

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
import string
A = list(string.ascii_uppercase + string.ascii_uppercase)
for i in range(len(S)):
    for l in range(1000):
        if S[i] == A[l]:
            S[i] = A[l+N]
            break
print("".join(S))

Submission status: Accepted

Solution code:
n = int(input())
s = input()
a2n = lambda c: ord(c) - ord("A") + 1
n2a = lambda c: chr(c + 64)
r = []
for c in s:
    nc = a2n(c) + n
    if nc > 26:
        nc -= 26
    r.append(n2a(nc))
print("".join(r))

Submission status: Accepted

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

a_list = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

result = []
for i in S:
    num = a_list.index(i)
    result.append(a_list[(num+N)%26])

print(''.join(result))

Submission status: Accepted

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

Submission status: Accepted

Solution code:

alp = list('ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ')
N = int(input())
S = list(input())

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

Submission status: Accepted

Solution code:
import unittest
import string


class TestB(unittest.TestCase):
    def test_1(self):
        self.assertEqual(think(2, 'ABCXYZ'), 'CDEZAB')

    def test_2(self):
        self.assertEqual(think(0, 'ABCXYZ'), 'ABCXYZ')

    def test_3(self):
        self.assertEqual(think(13, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'), 'NOPQRSTUVWXYZABCDEFGHIJKLM')


def solve():
    n, s = read()
    result = think(n, s)
    write(result)


def read():
    n = read_int(1)[0]
    s = read_line()
    return n, s


def read_int(n):
    return read_type(int, n)


def read_float(n):
    return read_type(float, n)


def read_type(t, n):
    return list(map(lambda x: t(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(n, s):
    result = ''
    d = string.ascii_uppercase
    for c in s:
        index = d.index(c)
        new_index = (index + n) % len(d)
        result += d[new_index]
    return result


def write(result):
    print(result)


if __name__ == '__main__':
    # unittest.main()
    solve()

Submission status: Accepted

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

T = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

A = []
for c in S:
    A.append(T[T.index(c) + N])

print(''.join(A))

Submission status: Accepted

Solution code:
n=int(input())
c="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
s=[c[(c.index(i)+n)%26] for i in list(input())]

print("".join(s))

Submission status: Accepted

Solution code:
def main():
    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"]
    ans = ""
    for i in list(s):
        ans = ans + l[(l.index(i)+n)%26]
    print(ans)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

N=int(input())
S=input()
ans=""

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

Submission status: Accepted

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

moji = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
snum = ""
for s in S:
    snum += str(moji[(moji.index(s) + N) % len(moji)])
print(snum)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
T = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
TT = {}
for i,t in enumerate(T):
  i+=N
  TT[t] = T[i%26]

ss = []
for s in S:
  ss.append(TT[s])
print("".join(ss))