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 = list(input())
chars = map(lambda c: chr((ord(c) - ord('A') + N) % 26 + ord('A')), S)
print(''.join(chars))

Submission status: Accepted

Solution code:
N=int(input())
S=str(input())
s=len(S)
A=[chr(i) for i in range(65, 65+26)]
ans=''

for i in range(s):
    ind=A.index(S[i])
    ans+=A[(ind+N)%26]

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
alphabet=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
ans=[]
for i in s:
    new=(alphabet.index(i)+n)%26
    ans.append(alphabet[new])
print("".join(ans))

Submission status: Accepted

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

ans = []
for ch in s:
  if ord(ch)+n > ord('Z'):
    ans.append(chr(ord(ch)+n-26))
  else:
    ans.append(chr(ord(ch)+n))
    
ans = ''.join(ans)
print(ans)

Submission status: Accepted

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

anc = []
for i in s:
    print(chr((ord(i)-ord('A')+n)%26+ord('A')), end='')

Submission status: Accepted

Solution code:
bet = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
n = int(input())
s = list(input())
new = ''

for name in s:
  x = bet.index(name)
  new += bet[x+n] if x+n < 26 else bet[x+n-26]

print(new)

Submission status: Accepted

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

result = ''

for i in range(len(S)):
    char = S[i]
    ord_char = ord(char)
    ord_char += N
    if ord_char > 90:
        ord_char -= 26
    chr_char = chr(ord_char)
    result = result + chr_char

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
t = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
u = [0] * len(s)
for i in range(len(s)):
    idx = 0
    for j in range(26):
        if s[i] == t[j]:
            idx = j
            break
    u[i] = t[j + n]
print(*u, sep="")

Submission status: Accepted

Solution code:
# 初期入力
N = int(input())
S = input()

#
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase_2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

#Sの文字をN右にずらす
kotae =""
for i in S:
    x = ascii_uppercase_2.index(i)
    kotae +=ascii_uppercase_2[x+N]
print(kotae)

Submission status: Accepted

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

a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

ans = ''
for l in s:
    ans += a[a.find(l) + n - 26]

print(ans)

Submission status: Accepted

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

ans = [""]*len(s)
for i in range(len(s)):
    x = ord(s[i]) + n
    if x > 90:
        x = x - 90 + 64
    ans[i] = chr(x)

print("".join(ans))

Submission status: Accepted

Solution code:
dic={"A":0,"B":1,"C":2,"D":3,"E":4,
     "F":5,"G":6,"H":7,"I":8,"J":9,
     "K":10,"L":11,"M":12,"N":13,"O":14,
     "P":15,"Q":16,"R":17,"S":18,"T":19,
     "U":20,"V":21,"W":22,"X":23,"Y":24,"Z":25}
gyak={0:"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"}
#あとで開業なくす
N=int(input())
S=input()
M=""
for i in range(len(S)):
  M+=gyak[(dic[S[i]]+N)%26]
print(M)

Submission status: Accepted

Solution code:
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"]
dic = {"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}

n = int(input())
s = input()
ans = ""
for i in range(len(s)):
  ans += ls[(dic[s[i]]+n-1) % 26]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
ans = ''
for i in range(len(S)):
    if ord(S[i])+N <= ord('Z'):
        ans += chr(ord(S[i])+N)
    else:
        ans +=chr(ord(S[i])+N-26)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ''
for i in range(len(S)):
    for j in range(len(A)):
        if S[i] == A[j]:
            ans += A[j+N]
            break
print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
z = ord("Z")
for i in range(len(S)):
    if ord(S[i])+ N > z:
        S[i] = chr(ord(S[i])+N-26)
    else:
        S[i] = chr(ord(S[i])+N)
print("".join(S))

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
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 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 PL(L) : print(*L, sep="\n")

N = I()
S = input()

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
word = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ''
for i in S:
    k = word.index(i)
    if k+N > 25:
        ans+=word[k+N-26]
    else:
        ans+=word[k+N]
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
alp = [chr(ord('A') + i) for i in range(26)]
ans = []
for a in s:
    i = (alp.index(a) + n) % 26
    ans.append(alp[i])
print(''.join(ans))

Submission status: Accepted

Solution code:
ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
N, S = int(input()), input()
newline = ""
for s in S:
  idx = (ALPHABET.index(s) + N) % 26
  newline += ALPHABET[idx]
print(newline)

Submission status: Accepted

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

ans = ''

for s in S:
    if N + ord(s) > 90:
        ans += chr(ord(s) + N - 26)
    else:
        ans += chr(ord(s) + N)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(*[chr(((ord(s) - ord('A')) + N) % 26 + ord('A')) for s in S], sep='')

Submission status: Accepted

Solution code:
n = int(input())
s = input().rstrip()
cs = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ''
for c in s:
    ans += cs[(cs.index(c) + n) % 26]
print(ans)

Submission status: Accepted

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

def foo(alphabet, n):
    NUM_OF_ALPHABETS = 26
    diff = ord(alphabet) - ord('A')
    index = (diff + n) % NUM_OF_ALPHABETS
    result = chr(ord('A') + index)

    return result


def calculate(str, n):
    calculated = ''.join([foo(alphabet, n) for alphabet in str])

    return calculated

answer = calculate(S, N)

print(answer)

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(map(str,S)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
L = [chr(i) for i in range(65, 65+26)]
H = ""
for i in range(len(S)):
  x = S[i]
  for j in range(26):
    if x == L[j]:
      H = H + L[(j+N)%26]
      break
print(H)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = input()
chr_a = 0
ans = ''
for i in range(len(b)):
    if ord(b[i]) + a <= 90:
        chr_a = ord(b[i]) + a
    else:
        chr_a = ord(b[i]) + a -26
    ans += chr(chr_a)
print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from collections import Counter, deque

import numpy as np


INF = float('inf')


def ctoi(char):
    return ord(char) - ord('A')


def itoc(number):
    return chr(number + ord('A'))


def main():
    N = int(input())
    S = list(input().rstrip())
    S_list = np.array([ctoi(c) for c in S])
    S_list += N
    ans = [itoc(num % 26) for num in S_list]
    print(''.join(ans))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans = []
for i in S:
    s = int(ord(i)) + N
    if s > 90:
        ans.append(chr(s % 91 + 65))
    else:
        ans.append(chr(s % 65 + 65))

print(''.join(ans))

Submission status: Accepted

Solution code:
#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
  
def main():
  n = int(input())
  s = input()
  slen = len(s)
  new = ""
  for i in range(slen): # A ~ Z : 65 ~ 90
    if 65 <= ord(s[i]) + n <= 90:
      new += chr(ord(s[i])+n)
    else:
      new += chr(ord(s[i]) + n - 26)
  print(*new,sep="")
if __name__ == '__main__':
  main()

Submission status: Accepted

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


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

sli = [ord(c) for c in S]
sli_mod = [n + N for n in sli]

for i, s in enumerate(sli_mod):
    if s > ord('Z'):
        sli_mod[i] -= 26

# print(sli_mod)
final = [chr(c) for c in sli_mod]
out = "".join(final)
print(out)

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

n = int(readline())
s = input()
ans = ['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']
memo = ''
for i in range(len(s)):
    memo += ans[ans.index(s[i]) + n]
print(memo)

Submission status: Accepted

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

Submission status: Accepted

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

import sys
# import math
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import product                # product(iter, repeat=n)
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from fractions import gcd                    # for Python3.4.3


def main():
    mod = 10000007                  # 10^9+7
    inf = float('inf')
    input = sys.stdin.readline      # 改行文字が残ることに注意
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def ii():  return int(input())
    def mi():  return map(int, input().rstrip().split())
    def lmi(): return list(map(int, input().rstrip().split()))
    def li():  return list(input().rstrip())
    
    
    n = ii()
    s = input().rstrip()
    print("".join(list(map(chr, map(lambda x: x+n if x+n<=ord('Z') else ord('A')+(n-1)-(ord('Z')-x), (map(ord, s)))))))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N=int(input())
S=list(input())
i=0
ans=''
while i<len(S):
    ans+=chr([ord(S[i])+N,ord(S[i])+N-26][ord(S[i])+N>90])
    i+=1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ls = list(map(str,input()))
r = len(ls)
for i in range(r):
    if ord(ls[i]) + n <= 90:
        ls[i] = chr(ord(ls[i]) + n)
    else:
        ls[i] = chr((ord(ls[i]) + n)%90+64)
a = "".join(ls)
print(a)

Submission status: Accepted

Solution code:
alphala=[chr(i) for i in range(65, 65+26)]
n=int(input())
s=input()
for i in range(len(s)):
    alpha=s[i:i+1]
    for i in range(len(alphala)):
        if alphala[i]==alpha:
            print(alphala[(i+n)%26], end="")

Submission status: Accepted

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

Submission status: Accepted

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

s_out = ""
for i in range(len(s)):
    s_out += a[(a.index(s[i]) + n) % len(a)]

print(s_out)

Submission status: Accepted

Solution code:
N=int(input())
S=input()
A=[]
#65~90
for i in range(len(S)):
  A.append(chr((ord(S[i])-65+N)%26+65))
print("".join(A))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
list_ans = []

for i in S:
    tmp = ord(i)
    tmp += N
    if tmp > 90:
        tmp -= 90 - 64
    list_ans.append(chr(tmp))

ans = "".join(list_ans)
print(ans)

Submission status: Accepted

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

cip = ''
for i in range(len(s)):
    ASCII = ord(s[i])
    ASCII += n
    if ord('A') + 25 < ASCII:
        ASCII -= 26
    cip = cip + chr(ASCII)

print(cip)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    alp=list('ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ')
    n=INT()
    s=STR()
    ans=[]
    for i in s:
        ans.append(alp[alp.index(i)+n])
    print(*ans,sep='')
    
if __name__ == '__main__':
    do()

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
s = list(input())
ans = []
alpha = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')

for i in s:
    ans.append(alpha[(alpha.index(i)+n)%26])
print(''.join(ans))

Submission status: Accepted

Solution code:
#B
n = int(input())
s = input()
alphabet = [chr(i) for i in range(65,65+26)]
s_list = []
for i in s:
    s_list.append(i)

for j in range(len(s_list)):
    s_list[j] = alphabet[(alphabet.index(s_list[j])+ n) % 26]
print("".join(s_list))

Submission status: Accepted

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

A=""
c=0
for i in range(L):
  if ord(S[i])+N <91:
    A=A+ chr(ord(S[i])+N)
  else:
    A=A+ chr(ord(S[i])-26+N)
  
print(A)

Submission status: Accepted

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

ans=''

for i in S:
    af = ord(i) + N
    if af - 91 >= 0:
        af = af - 91 + 65
    
    ans = ans + chr(af)

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = list(input().encode("ascii"))

for i in range(len(s)):
    if s[i] + n <= 90:
        s[i] += n
    else:
        s[i] += n - 26
    s[i] = chr(s[i])    

print(''.join(s))

Submission status: Accepted

Solution code:
dic = list('abcdefghijklmnopqrstuvwxyz'.upper())
n = int(input())
s = input()

ans = ''
for s_ in s:
  ans += dic[(dic.index(s_) + n) % 26]
print(ans)

Submission status: Accepted

Solution code:
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
S = list(sr())
base = ord('A')
for i in range(len(S)):
    s = S[i]
    S[i] = chr(base + (ord(s) + N - base) % 26)

print(*S, sep='')

Submission status: Accepted

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

Submission status: Accepted

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

bs = S.encode('us-ascii')
print(bytes((b - 65 + N) % 26 + 65 for b in bs).decode('us-ascii'))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import string
A=string.ascii_uppercase
N=int(input())
S=list(input())
ans=S
for i in range(len(S)):
    a=A.index(S[i])
    a+=N
    if a>=26:a-=26
    ans[i]=A[a]
print("".join(ans))

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()
nl = len(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"]
s_ans = ""

for i in range(nl):
    newnumber = alp.index(s[i])+n
    if newnumber > 25:
        newnumber = newnumber - 26
    newi = alp[newnumber]
    s_ans += newi

print(s_ans)

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
numZ = ord('Z')

for i in range(len(S)):
    S[i] = chr((ord(S[i])+N)) if ord(S[i])+N<=numZ else chr((ord(S[i])+N)-26)

ans = ''
for i in range(len(S)):
    ans += S[i]

print(ans)

Submission status: Accepted

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

alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

ans = ''
for i in range(len(S)):
    ans += alphabet[(alphabet.index(S[i]) + N)%26]

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 > 90:
        tmp -= 26
    s[i] = chr(tmp)

print("".join(s))

Submission status: Accepted

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

Submission status: Accepted

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

## empty list ##
out = []

for i in S:
  ## make code num ##
  num = ord(i)
  num = num + N
  if num > 90:
    num = num - 26
  ## make list ##
  out.append(chr(num))

## output ##
out = "".join(out)
print(out)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def ABC146B(a):
    if a > 90:
        return a - 26
    else:
        return a
n = int(input())
s = input()
p = ''
for i in s:
    p += chr(ABC146B(ord(i)+n))
print(p)

Submission status: Accepted

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

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"]
 
ans = ""
for i in range(len(s)):
    num = (alphabet.index(s[i]) + n) % len(alphabet)
    ans += alphabet[num]
    
print(ans)

Submission status: Accepted

Solution code:
import sys
class alphabet: #Trueなら大文字
    def __init__(self, capitalize):
        self.num = dict()
        self.index = dict()
        self.abc = ["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"]
        if capitalize: 
            for i in range(26): self.abc[i] = self.abc[i].upper()
        for i, a in enumerate(self.abc):
            self.num[a] = i
            self.index[i] = a

def solve():
    input = sys.stdin.readline
    N = int(input())
    S = input().strip("\n")
    AB = alphabet(True)
    Ans = [None] * len(S)
    for i in range(len(S)):
        Ans[i] = AB.index[(AB.num[S[i]] + N) % 26]
    print("".join(map(str, Ans)))
    

    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

for i in s:
  x = ord(i) + n
  if x > 90:
      x = x - 26
  c = chr((x))
  ans = ans + c

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from string import ascii_uppercase as upper

n = int(input())
s = input()
t = ''
for i in range(len(s)):
    t += upper[(upper.find(s[i]) + n) % 26]
print(t)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    n = n % 26
    s = input()
    s_list = [d for d in s]
    new_s = ""
    new_ord_base = 64
    for i in s_list:
        new_ord = ord(i) + n
        if new_ord > 90:
            new_ord = new_ord % 90 + new_ord_base
        new_s += chr(new_ord)

    print(new_s)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n=int(input())
s=input()
worddic={0:"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"}
word=["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"]
nowindex=0
ans=""

for i in range(len(s)):
  nowindex=word.index(s[i])
  if nowindex+n<=25:
    ans+=worddic[nowindex+n]
  else:
    ans+=worddic[nowindex+n-26]
print(ans)

Submission status: Accepted

Solution code:
alp = [chr(ord("A")+i) for i in range(26)]
n = int(input())
s = input()

for i in range(len(s)):
    x = alp.index(s[i])
    if x + n >= 26:
        print(alp[x+n-26],end="")
    else:
        print(alp[x+n],end="")

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(len(str)):
    str[i]=chr((ord(str[i])+N-ord('A'))%26+ord('A'))

print(''.join(str))

Submission status: Accepted

Solution code:
ALPH='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

N=int(input())
S=str(input())
list_ans=[]

for i in range(len(S)):
    for j in range(26):
        if S[i]==ALPH[j]:
            list_ans.append(ALPH[j+N])
print(''.join(list_ans))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
new_S = []

for e in S:
    ascii = ord(e) + N
    if ascii > 90:
        ascii = ascii - 90 + 64
    new = chr(ascii)
    new_S.append(new)

ans = ''.join(new_S)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
L = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
A = ''
for i in S:
  X = L.index(i) + N
  while X >= 26:
    X -= 26
  A += L[X]
print(A)

Submission status: Accepted

Solution code:
List="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
n=int(input())
s=input()
ans=""
for i in range(len(s)):
  num=List.index(s[i])+n
  #print(num)
  if (num>25):
    num=num-26
  ans=ans+List[num]
print(ans)

Submission status: Accepted

Solution code:
#ABC146.B
N = int(input())
S = list(input())
alp = [chr(i)for i in range(65,91)]
L=[]
for i in range(len(S)):
    for m in range(len(alp)):
        if S[i]==alp[m]:
            if m + N <=25:
                L.append(alp[m+N])
            else:
                L.append(alp[m+N-26])
print(''.join(L))

Submission status: Accepted

Solution code:
import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
n = i()
s = s()
l = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
for i in range(len(s)):
    print(l[l.index(s[i])+n],end="")

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","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[i] = a[a.index(s[i]) + n]
print(*s, sep="")

Submission status: Accepted

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

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

Submission status: Accepted

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

#AA = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
#S.index(AA)
AA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans=''
for i in range(len(S)):
    x = AA.find(S[i])
    y = (x + N) % 26
    ans += AA[y]
print(ans)

Submission status: Accepted

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

alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = ""
for i in range(len(S)):
  idx = alphabet.find(S[i])
  idy = (idx + N) % 26
  ans += alphabet[idy]
  
print(ans)

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']
ans=''
for i in (S):
  num=a.index(i)+N
  if(num>25):
    num-=26
  ans+=a[num]
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# ASCII A-Z 65-90
N = int(input())
S = list(input())
out = ''
for i in S:
    if ord(i) + N > 90:
        out += chr(ord(i) + N - 26)
    else:
        out += chr(ord(i) + N)
print(out)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
for i in S:
  print(chr(65 + (ord(i) - 65 + N) % 26), end = '')

Submission status: Accepted

Solution code:
n = int(input())
s = input()
replace_list = []
a_ascii = ord("A")
for i in s:
    i_ascii = ord(i) + n
    x = i_ascii - a_ascii
    if x > 25:
        y = x - 26
        replace_i = chr(a_ascii + y)
        replace_list.append(replace_i)
    else:
        replace_i = chr(i_ascii)
        replace_list.append(replace_i)
print("".join(replace_list))

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
alphabet = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
s_position = []
ans = []
for i in range(len(s)):
    s_position.append(alphabet.index(s[i]))

#
for j in range(len(s)):
    if (s_position[j] + n) >= 26:
        ans.append(alphabet[s_position[j] + n - 26])
    else:
        ans.append(alphabet[s_position[j] + n])
print(''.join(ans))

Submission status: Accepted

Solution code:
n=int(input())
s=input()
num=len(s)
new=""
for i in range(num):
  a=ord(s[i])
  b=a+n
  if b>90:
    new+=chr(b-26)
  else:
    new+=chr(b)
print(new)

Submission status: Accepted

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


dic = {0:"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"}
n = int(input())
s = input()
for i in s:
    print(dic[(get_key_from_value(dic, i) + n) % 26], end = "")

Submission status: Accepted

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

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