Problem: 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`).

Submission attempts (in order):
# -*- 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

#w=input()
from operator import itemgetter
from sys import stdin

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つの整数を入力を取得し、整数と取得する"



#print(number_list)
"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

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








#print(type(brray[0][0]))
#print(brray)

"列数に関して自由度の高いint型の値を入力するタイプの行列"


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

#print(a[0])
#print([a])















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





#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





#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)
'''









#A = [1, 2, 3, 3, 3, 4, 4, 6, 6, 6, 6]
#print(A)

#A.insert(index, 5)
#print(index)
#print(A)





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

    for k in range(2, int(np.sqrt(n)) + 1):
        
        if n % k == 0:
            return False
            
    return True




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.
    '''


########################################################################
########################################################################

#print(b2)



#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=map(int, input().split(" "))
    
    
    #s=input()
    a=[i for i in ascii_uppercase]
    b=[i for i in s]
    c=[]
    a.insert(0, 'AAAAA')
    #print(a)
    for i in range(len(b)):
        x=a.index(b[i])
        c.append(a[(x+n)%26])
    print(''.join(c))
    #print(a)
    
    #print(brray)


    for i in range(1,n+1,2):
     pass
     #print(i)

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

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

    #if state in known_states and not flag: # state => 2 steps => 5
        
    #print(f'steps: {steps}, state: {state}')
    

    
    
    
    
    DP = np.zeros(w+1, dtype=int)
    exdp=np.zeros((3,4)) 
    
    
    #    a, b = map(int, input().split())
        #dp[i][0] += [a]
        
    #    dp[i] += [a]
    #    dp[i] += [b]
        
        
    #print(dp)


    
    #print(brray)



    
    pin_l=["x" for i in range(10)]
    #print(pin_l)

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


    #print(ls[2:5])
    

    #print(ls[:-3])
    

    #print(ls[:4:2])
    
    
    
    #print(ls[::2])
    

if __name__ == "__main__":
    main()


# -*- Coding: utf-8 -*-

n = int(input())
str = input()
alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
str_list=list(str)
alphabet_list=list(alphabet)
#print(str_list)

#Sprint(n%26)
i=0
j=0
if n==0:
    pass
else:
 for i in range(len(str)):
    for j in range(len(alphabet)):
        #print(str_list[i])
        
        if str_list[i]==alphabet_list[j]:
            #print(i)
            #print(j)
    #        if n%26+j > 26:
    
    #          break
             
             
    #        else:
        #        print(i)
        #        print(j)

                str_list[i]=alphabet_list[(n%26+j)%25]
                break
        else:
           pass
#print(str_list)
mojiretu=''.join(str_list)
print(mojiretu)


# -*- Coding: utf-8 -*-

n = int(input())
str = input()
alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
str_list=list(str)
alphabet_list=list(alphabet)
#print(str_list)

#Sprint(n%26)
i=0
j=0
if n==0:
    pass
else:
 for i in range(len(str)):
    for j in range(len(alphabet)):
        #print(str_list[i])
        
        if str_list[i]==alphabet_list[j]:
            #print(i)
            #print(j)
    #        if n%26+j > 26:
    
    #          break
             
             
    #        else:
        #        print(i)
        #        print(j)

                str_list[i]=alphabet_list[(n%26+j)%25]
                break
        else:
           pass
#print(str_list)
mojiretu=''.join(str_list)
print(mojiretu)


# -*- Coding: utf-8 -*-

n = int(input())
str = input()
alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
str_list=list(str)
alphabet_list=list(alphabet)
#print(str_list)

#Sprint(n%26)
i=0
j=0
if n==0:
    pass
else:
 for i in range(len(str)):
    for j in range(len(alphabet)):
        #print(str_list[i])
        
        if str_list[i]==alphabet_list[j]:
            #print(i)
            #print(j)
    #        if n%26+j > 26:
    
    #          break
             
             
    #        else:
        #        print(i)
        #        print(j)

                str_list[i]=alphabet_list[(n%26+j)%25-1]
                break
        else:
           pass
#print(str_list)
mojiretu=''.join(str_list)
print(mojiretu)


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

#w=input()
from operator import itemgetter
from sys import stdin

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つの整数を入力を取得し、整数と取得する"



#print(number_list)
"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

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








#print(type(brray[0][0]))
#print(brray)

"列数に関して自由度の高いint型の値を入力するタイプの行列"


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

#print(a[0])
#print([a])















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





#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





#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)
'''









#A = [1, 2, 3, 3, 3, 4, 4, 6, 6, 6, 6]
#print(A)

#A.insert(index, 5)
#print(index)
#print(A)





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

    for k in range(2, int(np.sqrt(n)) + 1):
        
        if n % k == 0:
            return False
            
    return True




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.
    '''


########################################################################
########################################################################

#print(b2)



#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=map(int, input().split(" "))
    
    
    #s=input()
    a=[i for i in ascii_uppercase]
    b=[i for i in s]
    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)
    
    #print(brray)


    for i in range(1,n+1,2):
     pass
     #print(i)

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

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

    #if state in known_states and not flag: # state => 2 steps => 5
        
    #print(f'steps: {steps}, state: {state}')
    

    
    
    
    
    DP = np.zeros(w+1, dtype=int)
    exdp=np.zeros((3,4)) 
    
    
    #    a, b = map(int, input().split())
        #dp[i][0] += [a]
        
    #    dp[i] += [a]
    #    dp[i] += [b]
        
        
    #print(dp)


    
    #print(brray)



    
    pin_l=["x" for i in range(10)]
    #print(pin_l)

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


    #print(ls[2:5])
    

    #print(ls[:-3])
    

    #print(ls[:4:2])
    
    
    
    #print(ls[::2])
    

if __name__ == "__main__":
    main()


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted