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:
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']
y = [0]*len(s)
x = ""

for i in range(len(s)):
    for j in range(26):
        if s[i] == a[j]:
            d = (j+n)%26
            y[i] = a[d]

for k in range(len(s)):
    x = x + y[k]

print(x)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
a=''
for c in s:
    o=ord(c)+n
    if o>90:
        o-=26
    a+=chr(o)
print(a)

Submission status: Accepted

Solution code:
n=int(input())
s=list(input())
l=[chr(ord('A') + i) for i in range(26)]
x=[]
for i in range(int(len(s))):
  if l.index(s[i])+n>25:
    x.append(l[l.index(s[i])+n-26])
  else:
    x.append(l[l.index(s[i])+n])
print("".join(x))

Submission status: Accepted

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

ans = ""
for i in s:
    m = (ord(i) - ord('A') + n) % 26
    ans += chr(m + ord('A'))
print(ans)

Submission status: Accepted

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

L = list(S)
l= len(S)
for _ in range(N):
    for i in range(l):
        if L[i] == "Z":
            L[i] = "A"
        else:
            L[i] = (chr(ord(L[i]) + 1))
ans = "".join(L)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
res = ''
abc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(s)):
  res += abc[abc.index(s[i]) + n]
print(res)

Submission status: Accepted

Solution code:
# ABC146B
n = int(input())
s = input()
ss = ""
A = str("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
for i in range(len(s)):
    A_index = A.find(s[i])
    new_index = A_index + n
    ss = ss + str(A[new_index % 26])
print(str(ss))

Submission status: Accepted

Solution code:
l = []
for c in range(65, 91): 
        l.append(c)
x = int(input())
n = input()
for i in range(len(n)):
    character = ord(n[i])
    if character+x>90:
        print(chr(l[(character+x)%90-1]),end='')
    else:
        print(chr(character+x),end='')

Submission status: Accepted

Solution code:
#--ROT N

alphabet_1 = [chr(ord('A') + i) for i in range(26)]
alphabet_2 = [chr(ord('A') + i) for i in range(26)]

alphabet = alphabet_1 + alphabet_2

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

count = len(S)

ans = " "
for i in range(count):
  number = int(alphabet.index(S[i]))
  ans = ans + alphabet[number+N]

print(ans)

Submission status: Accepted

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

C = list(S)
cA = ord('A')  # 65
n = ord('Z') - ord('A') + 1  # 26
ans = map(lambda c : chr(cA + (ord(c) + N - cA) % n), C)
print(''.join(ans))

Submission status: Accepted

Solution code:
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']
n = input()
string_s = input()
n = int(n)
ans_s = ""

for s in string_s:
    index_s = alphabet.index(s)
    if index_s + n >= 26:
        ans_s = ans_s + alphabet[(index_s + n) - 26]
    else:
        ans_s = ans_s + alphabet[index_s + n]
print(ans_s)

Submission status: Accepted

Solution code:
A=[x for x in "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
N=int(input())
S=input()
s=[x for x in S]
ans=""
for i in range(len(S)):
  if A.index(S[i])+N<=25:
    ans+=A[A.index(S[i])+N]
  else:
    ans+=A[A.index(S[i])+N-26]
print(ans)

Submission status: Accepted

Solution code:
# ABC 146: B – ROT N
N = int(input())
S = input()
alphabets = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

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

Submission status: Accepted

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

S2 = []

for s in S:
    if (ord(s) + N) < 91:
        S2.append(chr(ord(s) + N))
    else:
        S2.append(chr(ord(s) + N - 26))

print(*S2, sep="")

Submission status: Accepted

Solution code:
import sys
from bisect import bisect_right as bsr
from collections import Counter as cnt
from collections import defaultdict as dd
from collections import deque
from fractions import gcd
from itertools import permutations as perm
from math import ceil, factorial, floor
from operator import itemgetter as ig

sys.setrecursionlimit(1000000)

# お約束
args = None
INF = float("inf")
MOD = int(1e9 + 7)


def input(*ps):
    if type(ps[0]) is list:
        return [input(*ps[0][:-1]) for _ in range(ps[0][-1])]
    elif len(ps) == 1:
        return ps[0](next(args))
    else:
        return [p(next(args)) for p in ps]


def yesno(v, yes="Yes", no="No", upper=False):
    if upper:
        print([yes.upper(), no.upper()][not v])
    else:
        print([yes, no][not v])


def main():
    """エントリーポイント"""
    N = input(int)
    S = input(str)
    a = ord("A")
    ans = ""
    for s in S:
        ans += chr((ord(s) - a + N) % 26 + a)
    print(ans)


if __name__ == '__main__':
    args = iter(sys.stdin.read().split())
    main()

Submission status: Accepted

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

offset = ord("A")

ans = ""
for c in s:
    temp = (ord(c) - offset + n) % 26 + offset
    ans += chr(temp)
print(ans)

Submission status: Accepted

Solution code:
times = int(input())
a = list(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"]
for i in range(len(a)):
  b = alphabet.index(a[i])+times
  if 25 < b:
    b = b-26
  a[i]=alphabet[b]
for i in range(len(a)):
  print(a[i],end="")

Submission status: Accepted

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

ALPHABETS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

L = ''

for c in S:
  i = ALPHABETS.index(c)
  L += ALPHABETS[(i + N) % 26]
  
print(L)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
letter='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
a=[0]*len(s)
for i in range(len(s)):
  
  u=letter.index(s[i])
  a[i]=letter[int(u)+n]
  
print(''.join(a))

Submission status: Accepted

Solution code:
n = int(input())
s = input()
S = len(s)
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"]
m = "ABCDEFGHIJKLMNOQPRSTUVWXYZ"
old_word = 0
new_word = 0
ans = []
#print(S)
#print(l[n])
#print(m[n])

for i in range(S):
    old_word = l.index(s[i])
    #print(old_word)
    new_word = old_word + n
    #print(new_word)
    if new_word > 25:
        new_word = new_word - 26
    ans.append(l[new_word])


#print(l.index("B"))
print("".join(ans))

Submission status: Accepted

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

ans_list = []

for s in S:
    new_ord = ord(s) + N
    if new_ord <= 90:
        ans_list.append(chr(new_ord))
    else:
        ans_list.append(chr(new_ord - 26))

ans = ''.join(ans_list)

print(ans)

Submission status: Accepted

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

for i in range(len(S)):
  if ord(S[i]) + N > 90:
    res += chr(ord(S[i]) + N - 26)
  else:
    res += chr(ord(S[i]) + N)
    
print(res)

Submission status: Accepted

Solution code:
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']
N=int(input())
S=input()
st=""
for s in S:
    index=alpha.index(s)
    if N+index>=len(alpha)-1:
        st = st + alpha[N + index-len(alpha)]
    else:

        st=st+alpha[N+index]
print(st)

Submission status: Accepted

Solution code:
N = int(input())
S = [i for i in 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 c in S:
    cnt = alpha.index(c)+N
    if cnt > 25:
        cnt=cnt-26
    c = alpha[cnt]
    ans+=c
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

s = input()

ans = []

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

Submission status: Accepted

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

for i in range(len(s)):
    ans += alph[(alph.find(s[i]) + 1 + n) % len(alph) - 1]

print(ans)

Submission status: Accepted

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

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

	ans += chr(num)

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
ans = []
for s in S:
  new_s = ord(s)+N
  if new_s >= 91:
    new_s -= 26
  ans.append(chr(new_s))
print(''.join(ans))

Submission status: Accepted

Solution code:
N=int(input())
alphabets='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
S=input()
def convert(s): 
  
    # initialization of string to "" 
    new = "" 
  
    # traverse in the string  
    for x in s: 
        new += x  
  
    # return string  
    return new 
ans=[]
for i in range(0,len(S)):
  ans.append(S[i])
ans2=[]
for i in ans:
  for j in range(0,26):
    if alphabets[j]==i:
      ans2.append(alphabets[(j+N)%26])
ans=convert(ans2)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
icase=0
if icase==0:
    n=int(input())
    s=list(input())
    t=""
    for ss in s:
        i=(ord(ss)+n-65)%26+65
        t=t+chr(i)
    print(t)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
di = {}
d = {}
for i in range(len(a)):
    di[i] = a[i]
    d[a[i]] = i
ss = ''
for i in s:
    k = d[i] + n
    k %= 26
    ss += di[k]
print(ss)

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 = list(input())

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

print(*s, sep='')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
s = list(s)
a = ''
for i in range(len(s)):
    if 'A' <= chr(ord(s[i]) + n) and chr(ord(s[i]) + n) <= 'Z':
        s[i] = chr(ord(s[i]) + n)
    else:
        s[i] = chr(ord('A') + (ord(s[i]) + n) % (ord('Z') + 1))
    a += s[i]
print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
class RotN:
    def __init__(self):
        self.alphabet = [a for a in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ']

    def calculate(self, N, S):
        result_list =[]
        for s in S:
            num = self.alphabet.index(s)
            #  アルファベットがZより大きくなる場合
            if num + N > 25:
                tmp = 25 - (num + N)
                result_list.append(self.alphabet[abs(tmp)-1])
            #  アルファベットがZより大きくならない場合
            else:
                tmp = num + N
                result_list.append(self.alphabet[tmp]) 
        return result_list

if __name__ == '__main__':
    N = int(input())
    S = [s for s in input()]
    rn = RotN()
    result_list = rn.calculate(N, S)
    result = ''
    for x in result_list:
        result += x
    print(result)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    S = list(input())
    alpha = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
    for i in range(len(S)):
        idx = alpha.index(S[i])
        idx += N
        if idx > len(alpha) - 1:
            idx -= len(alpha)
        S[i] = alpha[idx]
    print("".join(S))
main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

new_s = []
for c in S:
    new_s.append(chr((ord(c) - ord("A") + N) % 26 + ord("A")))

print("".join(new_s))

Submission status: Accepted

Solution code:
def rot_n(s, n):
    tmp = ord(s) + n
    if tmp > 90:
        tmp -= 26
    return chr(tmp)
N = int(input())
S = input()
for i in range(len(S)):
    print(rot_n(S[i], N), end='')
print('')

Submission status: Accepted

Solution code:
A = int(input())
listB = list(input())
f_l = ""
listA = {"A":1,"B":2,"C":3,"D":4,"E":5,"F":6,"G":7,"H":8,"I":9,"J":10,"K":11,"L":12,"M":13,"N":14,"O":15,"P":16,"Q":17,"R":18,"S":19,"T":20,"U":21,"V":22,"W":23,"X":24,"Y":25,"Z":26}
listC = {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"}
for i in listB:
    B = listA[i]
    B += A
    if B > 26:
        B -= 26
    f_l += listC[B]
print(f_l)

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())
string = str(input())
res = ''
for i in range(len(string)):
	temp = ''
	# print(ord(string[i])+N)
	x = ord(string[i])-ord('A')
	x = (x+N)%26
	temp = chr(x+ord('A'))
	res += temp
print(''.join(res))

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7


def main():
  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']
  B = A[N:] + A[:N]
  D = {}
  for a, b in zip(A,B):
    D[a] = b
  ans = ''
  for i in range(len(S)):
    ans += D[S[i]]
  print(ans)
  
  
if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
n = int(input()) # 入力が1つ
# map(int, input().split()) # 入力が複数
# [int(i) for i in input().split()] # 配列で数字
s = input()

ans = ''
for i in s:
    t = ord(i) + n
    if t > ord('Z'):
        t = ord('A') + (t - ord('Z')) - 1
    ans += chr(t)
print(ans)

Submission status: Accepted

Solution code:
from functools import reduce, partial
n = int(input())
s = input()

def f(n, c):
  a = ord('A')
  x = a + (ord(c) - a + n) % 26
  return chr(x)

f = partial(f, n)

s = reduce(lambda x,y: x + y, map(f, s))
print(s)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
s = list(S)
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",
       "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 c in s:
    print(alp[alp.index(c) + N], end="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import fractions
import sys
import itertools
import numpy as np
#入力:N(int:整数)
def input1():
	return int(input())

#入力:N,M(int:整数)
def input2():
	return map(int,input().split())

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))


N=input1()
S=list(str(input()))
base=ord("A")
for i in range(len(S)):
	S[i]=chr(base+(ord(S[i])-ord("A")+N)%26)
print("".join(S))

Submission status: Accepted

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

#https://atcoder.jp/contests/abc155/tasks/abc155_b
plus = int(input())
a = input()

answer = ""
for i in a:
    answer += chr(ord("A") + (ord(i) + plus - ord("A")) % 26)
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for s in range(len(S)):
    ans+=W[W.index(S[s])+N]
print(ans)

Submission status: Accepted

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


def incre(n, i):
    if n > 26:
        n - 26 * (n // 26)

    d = ord(i) + n
    if d > 90:
        d -= 26

    return chr(d)


for i in S:
    text += incre(N, i)

print(text)

Submission status: Accepted

Solution code:
N=int(input())
S=str(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']
d=[]
for i in range(len(S)):
  a=ALF.index(S[i])
  if N+a > 25:
    d.append(ALF[N+a-26])
  else:
    d.append(ALF[N+a])

print("".join(d))

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    s = 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"]
    res = ""
    for i in s:
        idx = alphabet.index(i)
        target_idx = idx + n
        if target_idx > 25:
            target_idx -= 26
        res += alphabet[target_idx]
    print(res)
if __name__ == "__main__":
    main()

Submission status: Accepted

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

ans = []

for i in S:
    ord_s = ord(i)
    if ord_s + N > 90:
        ans.append(chr(65 + ((ord_s + N)) - 91))
    else:
        ans.append(chr(ord_s + N))


print(''.join(ans))

Submission status: Accepted

Solution code:
n=int(input())
s=input()
a=[ord(c) for c in s]

l=len(a)

for i in range(l):
  a[i]=a[i]+n
  if a[i]>90:
    a[i]=a[i]-26
a=[chr(c) for c in a]

print("".join(a))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import numpy as np


def solve(N: int, S: str):
    ans = []
    for c in list(S):
        o = ord(c)+N
        o -= 26 if o>90 else 0
        ans.append(chr(o))

    print("".join(ans))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, S)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    n=int(input())
    s=input()
    sum=''
    model='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
    m=list(model)
    for i in range(len(s)):
        now=m.index(s[i])
        sum=sum+m[now+n]
    print(sum)


if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
m=["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)):
    index=m.index(s[i])
    if index+N>=26:
        ans.append(m[index+N-26])
    else:
        ans.append(m[index+N])
print(*ans, sep='')

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
ans = []
for i in range(len(s)):
  if (ord(s[i])+n)<=ord('Z'):
    ans.append(chr(ord(s[i])+n))
  else:
    ans.append(chr(ord(s[i])+n-26))
print(''.join(ans))

Submission status: Accepted

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

rot = []
for i in s:
  c = b.find(i)
  d = int(c) + n
  if d >= 26:
    d -= 26
  rot.append(b[d])
r = ''.join(rot)
print(r)

Submission status: Accepted

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

for i in range(len(s)):
  tmp=ord(s[i])
  tmp+=n

  if tmp>90:
    tmp=(tmp%90)+64
  print(chr(tmp),end="")

print()

Submission status: Accepted

Solution code:
N = int(input())
S = list(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"]

for index_i, i in enumerate(S):
    for index_j, j in enumerate(alpha):
        if i == j:
            if index_j + N > len(alpha) - 1:
                index_j = index_j + N - (len(alpha) - 1)
                index_j = index_j - 1
                S[index_i] = alpha[index_j]
            else:
                S[index_i] = alpha[index_j+N]
        else:continue

print("".join(S))

Submission status: Accepted

Solution code:
n = int(input())
s = str(input())
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
rot = []
for i in s:
  pos = alphabet.find(i)
  pos = int(pos) + n
  if pos >= 26:
    pos = int(pos) - 26
  rot.append(alphabet[pos])
strout = "".join(rot)
print(strout)

Submission status: Accepted

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

for s in S:
    o = (ord(s) - ord("A") + N) % 26 + ord("A")
    c = chr(o)
    print(c, end="")
print("")

Submission status: Accepted

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

#65A ~ 90Z
w = ''

for a in S:
    uni = ord(a) + N
    if uni > 90:
        uni -= 26
    w += chr(uni)

print(w)

Submission status: Accepted

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

print(t)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
alp = [chr(ord('A') + i) for i in range(26)]
res = ''
for si in s:
    index = 0
    for i in range(len(alp)):
        if si == alp[i]:
            index = i
    res += alp[(index + n) % len(alp)]
print(res)

Submission status: Accepted

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

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

  if S[i] > 90:
    S[i] = S[i] - 26
    S[i] = chr(S[i])
  else:
    S[i] = chr(S[i])
  
  
ans = ''.join(S)
print(ans)

Submission status: Accepted

Solution code:
nim = int(input())

data = input()

result = ""

for i in data: result+=chr(65+(ord(i)-65+nim)%26)
print(result)

Submission status: Accepted

Solution code:
a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S = input()
 
for i in S:
    b = a.index(i) + N
    if b <= 25:
        print(a[b], end="")
    else:
        print(a[b-26], end="")

Submission status: Accepted

Solution code:
n = int(input())
res = []
for i in input():
    a = ord(i) + n
    if a > 90:
        res.append(chr(a % 90 + 64))
    else:
        res.append(chr(a))
print("".join(res))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

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

ans = []
for c in S:
    hoge = ((ord(c) - ord("A") + N) % 26) + ord("A")
    ans.append(chr(hoge))

print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
N=int(input())
S=list(input())
c=N%26

Sdash=[]
for e in S:
    if l.index(e)+c>=26:
        Sdash.append(l[c-(26-l.index(e))])
    else:
        Sdash.append(l[l.index(e)+c])
print("".join(Sdash))

Submission status: Accepted

Solution code:
n = int(input())
s = 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"]
#print(alphabet.index(s[0]))

for items in s:
    if alphabet.index(items) + n >= len(alphabet):
        items = alphabet[alphabet.index(items) + n - 26]
        print(items,end = "")
    else:
        items = alphabet[alphabet.index(items) + n]
        print(items,end = "")
print()

Submission status: Accepted

Solution code:
import itertools
##print(ord("A"))
n = int(input())
s = list(input())
t =[]
u = []
for i in range(len(s)):

    t.append(ord(s[i])+n)
#print(t)
for j in range(len(t)):
    if t[j] > 90:
        t[j] = t[j]%90+64


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

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
n=int(input())
s=input().rstrip()
for i in s:
    x=ord(i)
    y=x+n
    if y>90:
        y-=26
    z=chr(y)
    print(z,end='')

Submission status: Accepted

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

Submission status: Accepted

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

alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
alpha_num = len(alphabet)

ans = ''
for i in s:
    ans += alphabet[(alphabet.index(i)+n) % alpha_num]

print(ans)

Submission status: Accepted

Solution code:
ab = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
n = int(input())
s = input()
l = ''
# 何もじめか当てる
for S in s:
  i = 0
  for w in ab:
    if S == w:
      l += ab[i+n]
      break
    i += 1
# １文字ずつ変えていく
print(l)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))


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

for i in range(len(s)):
    s[i] = ascii_uppercase2[ascii_uppercase2.index(s[i]) + n]
p2E(s)

Submission status: Accepted

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

alpha = ord('Z') - ord('A') + 1
result = []
for s in S:
    x = ord(s) + N
    if x > ord('Z'):
        x -= alpha
    result.append(chr(x))
print(''.join(result))

Submission status: Accepted

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

for str in s:
    if ord(str)+n > ord("Z"):
        print(chr(ord(str)+n-26), end="")
    else:
        print(chr(ord(str)+n), end ="")

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby
    #from itertools import product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    n = int(input())
    s = input().rstrip()
    alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' #26
    
    res = []
    for i in s:
        res.append(alphabet[(alphabet.index(i)+n)%26])
    print(''.join(map(str, res)))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans = ''
for i in s:
    c = i
    for j in range(n):
        if c == 'Z':
            c = 'A'
        else:
            c = chr(ord(c) + 1)
    ans = ans + c

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
n = int(input())
s = input()
ans = ''
for x in s:
    ans += alpha[(alpha.find(x) + n) % 26]
print(ans)

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby
    #from itertools import product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    alphabet = 'abcdefghijklmnopqrstuvwxyz' #26
    n = int(input())
    s = input().rstrip()
    a = alphabet.upper()
    
    res = []
    for i in s:
        res.append(a.index(i))
    a = a*2
    ans = ''
    for i in res:
        ans += a[i+n]
    print(ans)




if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

# 改行またはスペース区切りの入力をすべて読み込んでイテレータを返します。
def get_all_int():
    return map(int, open(0).read().split())

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

n = int(input())
s = input()
ord_a = ord("A")
ans = ""
for c in s:
    i = (ord(c) - ord_a + n)%26
    ans += chr(ord_a + i)

print(ans)

Submission status: Accepted

Solution code:
A = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
n = int(input())
S = input()

ANS = []*n
for i in range(len(S)):
    x = A.index(S[i])
    ANS.append(A[n+x])
for i in range(len(ANS)):
    print(ANS[i], end = "")

Submission status: Accepted

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

m = len(s)

for i in range(m):
	if ord(s[i])+n-65<26:
		s[i]=chr(ord(s[i])+n)
	else:
		s[i]=chr(ord(s[i])+n-26)
"".join(s)
print("".join(s))

Submission status: Accepted

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