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

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

Submission status: Accepted

Solution code:
N=int(input())
S=input()
temp=[]
for x in range(2):
    for i in range(65,91):
        temp.append(chr(i))

ans=""
for i in range(len(S)):
    ans+=temp[ord(S[i])-65+N]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
n = int(input())
s = input()
for x in s:
  print(alphabet[(alphabet.index(x)+n)%26], end="")
print()

Submission status: Accepted

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

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

print(a)

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)):
  for j in range(len(a)):
    if s[i]==a[j]:
      if j+n<26:
        s[i]=a[j+n]
      else:
        s[i]=a[j+n-26]
      break

print(''.join(s))

Submission status: Accepted

Solution code:
n=int(input())
s=input()
alpha=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]

out=[]
for i in range(len(s)):
    out.append(alpha[(alpha.index(s[i])+n)%26])

print("".join(out))

Submission status: Accepted

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

alphabet = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
new = []
for i in range(len(S)):
    idx = alphabet.index(S[i])
    character = alphabet[(idx + N) % 26]
    new.append(character)

print("".join(new))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
S=input()
C=[]
for i in S:
    if ord(i)+N>90:
        C.append(chr(ord(i)+N-26))
    else:
        C.append(chr(ord(i)+N))
print(*C,sep='')

Submission status: Accepted

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

# 秘密鍵
KEY = n
plain = ""
for char in list(ENC):
    ASCII = ord(char)
    num = ASCII - 65
    num = (num + KEY) % 26
    ASCII = num + 65
    plain += chr(ASCII)

print(plain)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - ROT N
# https://atcoder.jp/contests/abc146/tasks/abc146_b

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

tmp = ""

for s in S:
    unicode_point = ord(s) + N

    if unicode_point > 90:
        unicode_point = 64 + (unicode_point - 90)

    tmp += chr(unicode_point)

print(tmp)

Submission status: Accepted

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

alf = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")

ans = []
for s in list(s):
  ans.append( alf[ alf.index(s) + n ] )

print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def main():
    N = int(input())
    S = input().rstrip()
    ans = []
    for c in S:
        code = ord(c) + N
        if code > 90:code = 65 + (code-91)
        ans.append(chr(code))
    print("".join(ans))
if __name__ == "__main__":
    main()

Submission status: Accepted

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

al = [chr(ord('A') + i) for i in range(26)]
ans = ''

for ch in s:
    idx = (ord(ch)+n-ord('A'))%26
    ans += al[idx]
    
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
alp = []
for i in range(26):
    alp.append(chr(ord("A") + i))
for i in range(len(s)):
    x = alp.index(s[i])
    x = (x + n) % 26
    print(alp[x],end="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
o=int(input())
s=list(input())
r=""
for ii in s:
  a=ord(ii)+o
  if a>ord("Z"):
    a+=ord("A")-1-ord("Z")
  r=r+chr(a)
print(r)

Submission status: Accepted

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

ans = ""
#print(ord("A")) 65
#print(ord("Z")) 90

for i in s:
    temp = ord(i)
    #print(temp)
    if int(ord(i)) + n > 90:
        temp = int(temp) -90 + 64
        temp = chr(temp+n)
        ans = ans + temp
    else:
        temp = chr(temp+n)
        ans = ans + temp


print(ans)

Submission status: Accepted

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

result = ''
for i in range(0,len(S)):
  num = ord(S[i])
  if num + N > 90:
    p = num + N - 90 + 64
  else:
    p = num + N
  new = chr(p)
  result += new

print(result)

Submission status: Accepted

Solution code:
N = int(input())
words  = input()
lis = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
result = [""]*len(words)
for i in range(len(words)):
    k = lis.find(words[i])
    if k+N >=len(lis):
        tmp = k+N -len(lis)
    else:
        tmp = k+N
    result[i] = lis[tmp]
print("".join(result))

Submission status: Accepted

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

ans = ''
for c in s:
    rot = ord(c) + n
    if rot > 90:
        rot -= 26

    ans = ans + chr(rot)

print(ans)

Submission status: Accepted

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

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


base_a = ord("A")

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

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits, ascii_letters
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
import numpy as np
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
S = input()
ans = [ascii_uppercase[(ascii_uppercase.index(S[i])+N)%26] for i in range(len(S))]
#print(ans)
print(*ans, sep="")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits, ascii_letters
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
import numpy as np
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
S = input()
ans = []

for s in S:
	ans.append(ascii_uppercase[(ascii_uppercase.index(s)+N)%26])

print(*ans, sep="")

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
import numpy as np
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
S = input()

A = [chr(65+(ord(S[i])-65 + N)%26) for i in range(len(S))]

print(*A, sep="")

Submission status: Accepted

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

import fractions
import copy
import bisect
import math
import numpy as np
import itertools
from itertools import combinations_with_replacement
#import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
from operator import itemgetter
from sys import stdin
#input = sys.stdin.readline#こっちの方が入力が早いが使える時に使っていこう
from operator import mul
from functools import reduce
from collections import Counter
#from collections import deque

#input = stdin.readline


j=0
k=0
n=3
r=1
a=[0]
#n=int(input())
#r=int(input())
#print(M)
#A=int(input())
#B=int(input())
#print(N)
"1行1つの整数を入力を取得し、整数と取得する"


#number_list=list(map(int, input().split(" ")))#数字の時
#print(number_list)
"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
#メモ
for i in number_list:#こっちの方がrage使うより早いらしい
    print(number_list[i-1])#

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''
x=[]
y=[]
for i in range(N):
    x1, y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''

'''
mixlist=[]
for i in range(N):
    a,b=input().split()
    mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ，今回はリスト一つで処理している"
'''

'''
#array=[input().split()for i in range(N)]
#print(type(array[0][0]))
#print(array)
"正方行列にstr型の値を入力"
'''

#brray=[list(map(int, input().split(" ")))for i in range(N)]
#print(type(brray[0][0]))
#print(brray)
'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"
#以下に別解を記載
#N, M = [int(i) for i in input().split()]
'''
table = [[int(i) for i in input().split()] for m in range(m)]

print(type(N))
print(N)
print(type(M))
print(M)

print(type(table))
print(table)
'''




#s=input()
#a=[int(i) for i in s]
#print(a[0])
#print([a])
#単数値．桁ごとに分割したい．入力と出力は以下の通り
#イメージとして1桁ごとにリストに値を入れているかんじ
#intを取ると文字列分解に使える
'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''




'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''



'''
A, B, C=stdin.readline().rstrip().split()#str style 何個でもいけることが多い
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''


#a= stdin.readline().rstrip()
#print(a.upper())
"aという変数に入っているものを大文字にして出力"


#a,b=map(int, input().split())  #int style 複数数値入力　「A B」みたいなスペース空いた入力のとき

#なんかうまく入力されるけど
#a=[[int(i) for i in 1.strip()]for 1 in sys.stdin]
#a = [[int(c) for c in l.strip()] for l in sys.stdin]]
#print(a)
#複数行の数値を入力して正方行列を作成


##############################################################################################
##############################################################################################
#under this line explains example calculation



'''
コンビネーションの組み合わせの中身を出力する形式
for i in itertools.combinations(brray, 2)
combinationsをpermutationsにすれば順列になる
今回なら(abc133B)
入力
1 2
5 5
-2 8
出力
[[1, 2], [5, 5], [-2, 8]]
もちろん一次元リストでも使えるし
何よりiもリストのように使えるので便利
'''

#nCr combination
'''
def cmb(n,r):
    #When n < r , this function isn't valid
    r= min(n-r,r)
    #print(n,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n-r, -1))
    #flochart mul(n,n-1)=x
    #next     mul(x,n-2)........(n-r+1,n-r)
    #mul read a,b and returns a*b

    under = reduce(mul, range(1, r+1))
    #print(over, under)
    #reduce is applied mul(1,2)=2
    #next   mul(2,3)=6
    #next   mul(6,4)=4.........last(r!,r+1)=r+1!

    return over // under
    #// is integer divide
    #calc example 5C2
    #over=5*4*3
    #under=3*2*1
a = cmb(n, r)
#print(a)
'''

'''
import itertools
from itertools import combinations_with_replacement

combinationについて
以下の違いを意識しよう
combinations() p, r 長さrのタプル列、ソートされた順で重複なし

combinations_with_replacement() p, r 長さrのタプル列、ソートされた順で重複あり


使用例 　　　　　　　　　　　                  出力　　
combinations('ABCD', 2)　　　　　　　　　　　　AB AC AD BC BD CD

combinations_with_replacement('ABCD', 2)　　 AA AB AC AD BB BC BD CC CD DD
'''



'''
#集計
#example
#a=[2,2,2,3,4,3,1,2,1,3,1,2,1,2,2,1,2,1]
#a=Counter(a)
for i in a.most_common(n):print(i)
#most_common()メソッドは、出現回数が多い要素順にCounterオブジェクトを並び替えます。
#引数にint型の数字nを設定した場合は、出現回数が高い上位ｎ個の要素を返します。
#何も設定しなければ、コンテナ型にあるすべての要素を出現回数の順番に並び替えたタプル型オブジェクトを返します。
#out put
#(2, 8)
 #(1, 6)
#(3, 3)
#(4, 1)
'''


#二部探索(binary search)
#A = [1, 2, 3, 3, 3, 4, 4, 6, 6, 6, 6]
#print(A)
#index = bisect.bisect_left(A, 5) # 7 最も左(前)の挿入箇所が返ってきている
#A.insert(index, 5)
#print(index)
#print(A)
'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''

'''
素数の判定
'''


def is_prime(n):
    if n == 1: return False

    for k in range(2, int(np.sqrt(n)) + 1):
        #sqrt(n)+1以上は考えて約数はないので却下
        if n % k == 0:
            return False
            #割り切れたらFalse
    return True


'''
npのmaxとmaximumの違い
xs = np.array([1, -2, 3])
np.max(xs, 0)
この出力は3となります．[1, -2, 3]と0の4つの数字のうち，最も大きい値を出力します．

一方で，[max(1, 0), max(-2, 0), max(3, 0)]を出力したい時があります．
その時は，numpyのmaximum関数を用います．

xs = np.array([1, -2, 3])
np.maximum(xs, 0)  # [1, 0, 3]

'''

def factorial(x, mod=10**9+7):
    # x!
    # 階乗
    # ex) factorial(5) = 120
    tmp = 1
    for i in range(1, x+1):
        tmp = (tmp * i) % mod
    return tmp
    '''
    Basically, when you do a**d % n, you actually have to calculate a**d, which could be quite large.
    But there are ways of computing a**d % n without having to compute a**d itself, and that is what pow does.
    '''


########################################################################
########################################################################
#b2=a[:]  #1次元のときはコピーはこれで良い
#print(b2)

#a= [[0]*3 for i in range(5)] #2次元配列はこう準備、[[0]*3]*5だとだめ
#b3=copy.deepcopy(a)  #2次元配列はこうコピーする
#print(b3)

def main():
    n=3
    steps=0
    state=0
    w=1
    j=0
    k=0
    n=int(input())
    s=input()
    ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    #a,b=input().split(" ")#a,bがともに文字列のとき
    #a,b=map(int, input().split(" "))
    #mapでとってもstrで変換すればappend可能
    #nl=list(map(int, input().split(" ")))#数字の時
    #s=input()
    a=[i for i in ascii_uppercase]#int取るとstrでも行ける
    b=[i for i in s]#int取るとstrでも行ける
    c=[]
    a.insert(0, 'Z')
    #print(a)
    for i in range(len(b)):
        x=a.index(b[i])
        c.append(a[(x+n)%26])
    print(''.join(c))
    #print(a)
    #brray=[list(map(int, input().split(" ")))for i in range(N)
    #print(brray)


    for i in range(1,n+1,2):#これで1個飛ばしループになる
     pass
     #print(i)

    l = ['aaa', 'bbb', 'ccc']

    #s = ''.join(l)
    #print(s)
    # aaabbbccc

    #if state in known_states and not flag: # state => 2 steps => 5
        #こうやってある要素がリストの中にあるか探すのか
    #print(f'steps: {steps}, state: {state}')
    #こう書いてあるとデバックしやすい

    #dp= [[0]*3 for i in range(5)]#列　行
    #dp用の0の入ったやつ
    #dp= [[0]*(w+1) for i in range(n+1)]#0からwまでのw+1回計算するから
    #print(dp)＃初期条件が入る分計算回数+1列分必要(この場合は判断すべきものの数)
    DP = np.zeros(w+1, dtype=int)#これでも一次元リストが作れる
    exdp=np.zeros((3,4)) # ３×４の２次元配列を生成。2次元ならこう
    #dtypeは指定しないとfloatになる
    #for i in range(n):#ちょっとした入力に便利
    #    a, b = map(int, input().split())
        #dp[i][0] += [a]
        #これだとintとlistをつなぐことになって不適
    #    dp[i] += [a]
    #    dp[i] += [b]
        #これはうまくいく
        #やり方はいろいろあるということ
    #print(dp)


    #brray=[list(map(int, input().split(" ")))for i in range(N)
    #print(brray)



    '''
    入力
    1234
    出力
    [1, 2, 3, 4]
    '''
    pin_l=["x" for i in range(10)]#内包表記に慣れろ
    #print(pin_l)

    ls = ["a", "b", "c", "d", "e"]


    #print(ls[2:5])
    #スライスでの取得

    #print(ls[:-3])
    #一番左端から右から3番目より左まで取得

    #print(ls[:4:2])
    #スライスで1個飛ばしで取得
    #ないときは左端スタート
    #始点のインデックス番号 : 終点のインデックス番号 : スキップする数+1
    #print(ls[::2])
    '''
    lsというリストの場合に、1つ飛びの値を取得したい場合には
    ls[::2]
    のようにします。こうすると、
    ["a", "c", "d"]と出力される
    '''

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

ans = ''
for s in S:
    nc = ord(s) + N
    if nc > ord('Z'):
        nc = nc - 26
    ans += chr(nc)
print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = str(input())
ans = []
lst = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']

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

Submission status: Accepted

Solution code:
import math
import time
from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
n=int(input())
s=input()
ans=''
for i in s:
    ans+=chr(((ord(i)-65+n)%26)+65)
print(ans)

Submission status: Accepted

Solution code:
MOD =26

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

for i in range(0,len(S),1):
    S[i] = (ord(S[i])+N -65)%MOD + 65
print("".join(list(map(chr,S))))

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] = chr(s[i]-26)
    else:
        s[i] = chr(s[i])
 
print("".join(s))

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

print("".join(s))

Submission status: Accepted

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

for i in range(len(s)):
    k = ord(s[i]) + n
    if(k> 90):
        c = k - 90
        k = 64 + c

    print(chr(k),end = "")

Submission status: Accepted

Solution code:
n = int(input())

s = input()

alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"



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

Submission status: Accepted

Solution code:
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
num2alp = {}
alp2num = {}
for i, a in enumerate(alphabet):
  num2alp[i] = a
  alp2num[a] = i
  
n = int(input())
sss = input()

out = ''
for s in sss:
  num = alp2num[s]
  num = (num + n) % 26
  s = num2alp[num]
  out += s
  
print(out)

Submission status: Accepted

Solution code:
n = int(input())
S = input()
t = ''
for s in S:
    if ord(s) + n > 90:
        t += chr(ord(s) + n - 26)
    else:
        t += chr(ord(s) + n)
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)):
  c = (A.index(S[i])+N)%26
  S[i] = A[c]
print("".join(S))

Submission status: Accepted

Solution code:
def main():
    N  = int(input())
    S  = input()
    print(rot_n(S,N))


def rot_n(s, n):
    answer = ''
    for letter in s:
        answer += chr(ord('A') + (ord(letter)-ord('A')+n) % 26)

    return answer

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
s = input()
st = ''
t = 0 

for i in s:
  if ord(i)+n >= 91:
    t = 64+ord(i)+n-90
    st += chr(t)
  else:
    t = ord(i) + n
    st += chr(t)
    
print(st)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
S = ''
list = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']*2
 
for i in s:
  S += list[list.index(i) + n]
  
print(S)

Submission status: Accepted

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

ans = ""

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

print(ans)

Submission status: Accepted

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

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

print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

# check
if N > 0:
    ord_z = ord("Z")
    ord_a = ord("A")

    op = ""

    for i, s in enumerate(S):
        ord_s = ord(s) + N

        # Zの次はAになる
        if ord_s > ord_z:
            rem = ord_s % ord_z - 1
            ord_s = ord_a + rem

        chr_s = chr(ord_s)
        op += chr_s

    print(op)
else:
    print(S)

Submission status: Accepted

Solution code:
#!/usr/bin/python3

import sys

def input():
    return sys.stdin.readline().rstrip('\n')

N = int(input())
S = input()
#D = list(map(int, input().split()))

alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

# ord and chr
asciiA = ord('A')

def ord_rel_a(c):
    return ord(c) - asciiA

def chr_rel_a(i):
    j = i + asciiA
    return chr(j)

iZ = ord_rel_a('Z')

Shift = ""

for c in S:
    i = ord_rel_a(c)
    j = (i + N) % (iZ+1)
    Shift += chr_rel_a(j)

print(Shift)

Submission status: Accepted

Solution code:

n = int(input())
s = input()
strS = []
for i in range(len(s)):
    charnum = ord(s[i])
    if charnum+n > 90:
        charnum = 64 + (charnum+n - 90) 
    else:
        charnum += n
#    print(charnum)
    strS.append(chr(charnum))
ans = "".join(strS)
print(ans)

Submission status: Accepted

Solution code:
import string
n = int(input())
a = input()
fin = []
lst = [i for i in string.ascii_uppercase]

for j in a:
    num = lst.index(j)
    ser = (num + n) % 26
    fin.append(lst[ser])

print("".join(fin))

Submission status: Accepted

Solution code:
n = int(input())
s = input()
alphabet = [chr(i) for i in range(ord('A'), ord('Z')+1)]
encode = alphabet[n:] + alphabet[:n]
text = ""
for c in s:
    text = text + encode[alphabet.index(c)]
print(text)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
alphabet = [chr(i) for i in range(ord('A'), ord('Z')+1)]
encode = alphabet[n:] + alphabet[:n]
text = ""
for c in s:
    text = text + encode[alphabet.index(c)]
print(text)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
alphabet = [chr(i) for i in range(ord('A'), ord('Z')+1)]
encode = alphabet[n:] + alphabet[:n]
text = []
for c in s:
    text.append(encode[alphabet.index(c)])
print(''.join(text))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
ans =""
for i in S:
    s_int = ord(i)+N
    if s_int>90:
        s_int=65+(s_int%91)
    ans+=chr(s_int)
print(ans)

Submission status: Accepted

Solution code:
a = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","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()

x = list(s)

for i in range(0,len(s)):
  for j in range(0,len(a)):
    if(x[i] == a[j]):
      t = j
      x[i] = a[t+n]
      break
b = ''.join(x)
print(b)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import string
N = int(input())
C = list(input())
L = list(string.ascii_uppercase)
count = 0
for i in C:
    for j in L:
        if i == j:
            break
        count += 1
    if count + N <= 25:
        print(L[count+N], end='')
    else:
        print(L[count+N-26], end='')
    count = 0

Submission status: Accepted

Solution code:
def shift(c, n):
    index = ord(c) - ord('A')
    index += n
    index %= 26
    return chr(index + ord('A'))


N = int(input())
S = input()
print(''.join([shift(c, N) for c in S]))

Submission status: Accepted

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

def alpha(a):
    return ord(a)-65

def enum(i):
    return chr(i+65)

list = [enum((alpha(s)+N)%26) for s in list(S)]

print("".join(list))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
ans=''
for ss in s:
  if ord(ss)+n<=ord('Z'):
    ss=chr(ord(ss)+n)
  else:
    ss=chr(ord(ss)+n-26)
  ans+=ss
print(ans)

Submission status: Accepted

Solution code:
import fileinput

n = int(input())


def slip(c):
    return chr(((ord(c) - 65 + n) % 26) + 65)


s = list(input())

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

print("".join(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
s=list(input())
a=[]
for i in range(len(s)):
  if ord(s[i])+n<=90:
    a.append(chr(ord(s[i])+n))
  elif ord(s[i])+n>90:
    a.append(chr(ord(s[i])+n-26))
  
    """
for k in range(len(s)):
  if ord(a[k])>90:
    s[k]=chr(ord(a[k])-90+64)
    """
b=''
for j in range(len(a)):
  b+=a[j]
print(b)

Submission status: Accepted

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

for i in range(len(S)):
  l.append(S[i])

for i in range(len(l)):
  if ord(l[i]) + N > 90:
    l[i] = chr(ord(l[i]) + N - 26)
  else:
    l[i] = chr(ord(l[i]) + N)
ans = ''.join(l)
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
li = []
for i in range(26):
    li.append(chr(ord('A')+i))
ans = ""
for st in s:
    ind = (li.index(st) + n) % 26
    ans += li[ind]
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
ans = ''
alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(s)):
    ans += alpha[alpha.find(s[i])+n]
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
A = list('ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ')
NS = []
for i in range(len(S)):
    NS.append(A[A.index(S[i])+N])
print(''.join(NS))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
n=int(input())
s=input()
x=list()
for i in range(len(s)):
    x=x+[a[ord(s[i])-65+n]]
print("".join(x))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
S = input()
new_S = ''
alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

for d in range(len(S)):
    for p in alp:
        if S[d] == p:
            i = int(alp.index(p))
            i = i + n
            if i >= 26:
                i = i - 26
            new_S += alp[i]
print(new_S)

Submission status: Accepted

Solution code:
def convert(S,N):
    i = ord(S)
    if (i + N > 90):
        c_i = i + N - 26
    else:
        c_i = i + N 
    return c_i

def main():
    N = int(input())
    S = input()
    s = ' '
    for i in range(len(S)):
        s += chr(convert(S[i],N))
    print(s[1:])
    return 0
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

for i in s:
    a=ord(i)+n
    if a>90:
        a-=26
    res+=chr(a)

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

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

import string


def main():
    N = int(input())
    s = input().rstrip()
    a = string.ascii_uppercase
    b = (a*2)[N:N+27]
    b = {i:j for i, j in zip(a, b)}
    b = str.maketrans(b)
    print(s.translate(b))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
alpha_dict = {}
id_dict = {}
for i,c in enumerate(range(ord('A'),ord('Z')+1)):
  alpha_dict[chr(c)] = i + 1
  id_dict[i+1] = chr(c)

N = int(input())
S = list(input())
T = []
for s in S:
  n = alpha_dict[s]
  n += N
  if n > 26:
    n -= 26
  T += [id_dict[n]]
print("".join(T))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

s = list(input())

al = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")

ans = []

for i in s:
    ans.append(al[al.index(i)+n])
    
for i in ans:
    print(i,end = "")