TnT/Multi_CodeNet4Repair huggingface dataset:
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):

N = int(input())


S = input()

AAA = ""

for char in list(S):
    hoge = ord(char)
    huga = hoge - 97
    huga = (huga + N) % 26
    hoge = num + 97
    AAA += chr(hoge)

print()


N = map(int, input().split()


S = input()

AAA = ""

for char in list(S):
    hoge = ord(char)
    huga = hoge - 97
    huga = (huga + S) % 26
    hoge = num + 97
    AAA += chr(hoge)

print()

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


def encrypt(S, N):
    X = ""

    for ch in list(S):
        if 'A' <= ch <= 'Z':
            X += chr((ord(ch) - ord('A') - int(N)) % 26 + ord('A'))
        elif 'a' <= ch <= 'z':
            X += chr((ord(ch) - ord('a') - int(N)) % 26 + ord('a'))
        else:
            X += ch

    return X



def decrypt(X, N):
    S = ""

    for ch in list(X):
        if 'A' <= ch <= 'Z':
            S += chr((ord(ch) - ord('A') + int(N)) % 26 + ord('A'))
        elif 'a' <= ch <= 'z':
            S += chr((ord(ch) - ord('a') + int(N)) % 26 + ord('a'))
        else:
            S += ch

    return S
    


X = encrypt(S, N)
print(X)

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


def encrypt(S, N):
    X = ""

    for ch in list(S):
        if 'A' <= ch <= 'Z':
            X += chr((ord(ch) - ord('A') + int(N)) % 26 + ord('A'))
        elif 'a' <= ch <= 'z':
            X += chr((ord(ch) - ord('a') + int(N)) % 26 + ord('a'))
        else:
            X += ch

    return X


X = encrypt(S, N)
print(X)

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
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):
N = int(input())
S = input()
Sr = []

al = ['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)):
  m = al.index(S[i])
  n = (1 + n + N) % 26 - 1
  Sr.append(al[n])
  
print(''.join(Sr))

N = int(input())
S = input()
Sr = []

al = ['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)):
  m = al.index(S[i])
  n = (1 + m + N) % 26 - 1
  Sr.append(al[n])
  
print(''.join(Sr))

Verdicts: Runtime Error

Accepted
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 -*-
N = int(input())
S = input()

moji_list = []
for i in range(N):
  moji_list.append(chr(ord(S[i]) + N))
  
print("".join(moji_list))

# -*- coding: utf-8 -*-
N = int(input())
S = input()

moji_list = []
for i in range(N):
  if (ord(S[i])+N) <= 90:
    moji_list.append(chr(ord(S[i]) + N))
  else:
    moji_list.append(chr(ord(S[i]) + N - 26))
    
  
print("".join(moji_list))

# -*- coding: utf-8 -*-
N = int(input())
S = input()

moji_list = []

q, mod = divmod(N, 26)
for i in range(len(S)):
  if (ord(S[i])+mod) <= 90:
    moji_list.append(chr(ord(S[i]) + mod))
  else:
    moji_list.append(chr(ord(S[i]) + mod - 26))
    
  
print("".join(moji_list))

Verdicts: Runtime Error

Runtime Error

Accepted
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):
n = int(input())
s = input()
fin = ''
for i in range(len(s)):
  t = ord(s[i])-ord('A')+n 
  if (t > 25):
    fin += chr(ord(s[i])+t-26)
  else:
    fin +=chr(ord(s[i])+t)
print(fin)

n = int(input())
s = input()
fin = ''
for i in range(len(s)):
  t = ord(s[i])-ord('A')+n 
  if (t > 25):
    fin += chr(ord('A')+t-26)
  else:
    fin +=chr(ord('A')+t)
print(fin)

Verdicts: Wrong Answer

Accepted
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):
N = int(input())
S = input(())
a = len(S)
A = chr(ord(S[0])+N)
for i in range(1,a):
  A += chr(ord(S[i])+N)
print(A)


n = input()
s = raw_input()
l = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
r = ""
for i in s:
    r += l[l.index(i)+n]
print r


N = int(input())
S = input(())
a = len(S)
A = chr(ord(S[0])+N)
for i in range(1,N):
  A += chr(ord(S[i])+N)
print(A)

n = int(input())
chars = input()

alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = ""
for c in chars:
    pos = alphabet.find(c)
    ans += alphabet[(pos + n) % 26]

print(ans)


Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
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):
N = int(input())
S = input()
ans = ''
for i in range(N):
    a = ord(S[i])-97+N
    if a >= 26:
        a = a - 26
    a += 97
    b = chr(a)
    ans += b
print(ans)

N = int(input())
S = input()
n = len(S)
ans = ''
for i in range(n):
    a = ord(S[i])-97+N
    if a >= 26:
        a = a - 26
    a += 97
    b = chr(a)
    ans += b
print(ans)


N = int(input())
S = input()
n = len(S)
ans = ''
for i in range(n):
    a = (ord(S[i])-65+N)%26
    a += 65
    b = chr(a)
    ans += b
print(ans)

Verdicts: Runtime Error

Wrong Answer

Accepted
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):

# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np
# import math
mod = 10**9 + 7

# n = int(input())
# a = list(map(int, input().split()))
n = int(input())
s = input()
ans = []
for i in range(s):
    ans.append(chr((ord(i)-ord('A')+n)%26 + ord('A')))

print(''.join(ans))


# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np
# import math
# mod = 10**9 + 7

# n = int(input())
# a = list(map(int, input().split()))
n = int(input())
s = input()
ans = []
for i in s:
    ans.append(chr((ord(i)-ord('A')+n)%26 + ord('A')))

print(''.join(ans))

Verdicts: Runtime Error

Accepted
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):
n = int(input())
s = input()
al = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

if n == 0:
    print(s)

for i in range(len(s)):
    print(al[al.index(s[i]) - 26 + n])

print(s)

n = int(input())
s = input()
al = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ''
for i in range(len(s)):
    ans += (al[al.index(s[i]) - 26 + n])

print(ans)

Verdicts: Wrong Answer

Accepted
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):
n = int(input())
s = input()
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
b = ""
for i in s:
    j = (s.index(i) + n) % 26
    b += s[j]
print(b)

n = int(input())
s = input()
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
b = ""
for i in s:
    j = (alpha.index(i) + n) % 26
    b += alpha[j]
print(b)


Verdicts: Runtime Error

Accepted
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):
s = input()

n = int(input())

alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","M","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 ) % 26
    ans += alphabet[num]
    
print(ans)

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)

Verdicts: Runtime Error

Accepted
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):
N = int(input())
S = input()
for i in S:
	m = (ord(i) - ord('A') + N) % 26
    ans += chr(m +ord('A'))
print(ans)

n = int(input())
s = input()


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

print(ans)

n = int(input())
s = input()


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

print(ans)

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)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
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):
n=int(input())
s=input()
l=list(s)
newcome=[]
alp=[chr(ord('A') + i) for i in range(26)]
for i in l:
  a=alp.index(i)
  if (a+n)<=26:
    t=alp[a+n]
  else:
    t=alp[a+n-26]
  newcome.append(t)
print("".join(newcome))

n=int(input())
s=input()
l=list(s)
newcome=[]
alp=[chr(ord('A') + i) for i in range(26)]
for i in l:
  a=alp.index(i)
  if (a+n)<=26:
    t=alp[a+n]
  else:
    t=alp[a+n-26]
  newcome.append(t)
print("".join(newcome))

n=int(input())
s=input()
l=list(s)
newcome=[]
alp=[chr(ord('A') + i) for i in range(26)]
for i in l:
  a=alp.index(i)
  if (a+n)<=26:
    t=alp[a+n-1]
  else:
    t=alp[a+n-26]
  newcome.append(t)
print("".join(newcome))

n=int(input())
s=input()
l=list(s)
newcome=[]
alp=[chr(ord('A') + i) for i in range(26)]
for i in l:
  a=alp.index(i)
  if (a+n)<26:
    t=alp[a+n]
  else:
    t=alp[a+n-26]
  newcome.append(t)
print("".join(newcome))

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
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):
N = int(input())
res = ""

for i in list(input()):
    ascii = ord(i)
    n = ascii - 65
    n = (n + N) % 26
    res += chr(n + 65)
print(res == input())

# coding: utf-8
# Your code here!
N = int(input())
res = ""

for i in list(input()):
    ascii = ord(i)
    n = ascii - 65
    n = (n + N) % 26
    res += chr(n + 65)
print(res == input())

N = int(input())
res = ""

for i in list(input()):
    ascii = ord(i)
    n = ascii - 65
    n = (n + N) % 26
    res += chr(n + 65)
print(res)

Verdicts: Runtime Error

Runtime Error

Accepted
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):
N = int(input())
S = input()
ans = ""

for i in range(len(S)):
	ans += chr(ord("A") + (ord(S[i]) + N) % ord("A") % (ord("Z") - ord("A")))
print(ans)

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

for i in range(len(S)):
	ans += chr(ord("A") + (ord(S[i]) + N) % ord("A") % (ord("Z") - ord("A") + 1))
print(ans)


Verdicts: Wrong Answer

Accepted
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):
def judge(S,N):
    a = [x for x in list(S)]
    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","A","B"]
    mak = []
    llst = lst
    for i in range(len(a)):
        for j in range(25):
            if a[i]==lst[j]:
                mak.append(lst[j+N])
    print("".join(mak))

N = int(input())
S = input()
judge(S,N)

def judge(S,N):
    a = [x for x in list(S)]
    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"]
    mak = []
    llst = lst + lst
    for i in range(len(a)):
        for j in range(26):
            if a[i]==llst[j]:
                mak.append(llst[j+N])
    print("".join(mak))

N = int(input())
S = input()
judge(S,N)

Verdicts: Runtime Error

Accepted
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):
N=int(input())
S=input()
print(S[N:len(S)]+S[-len(S):-len(S)+N])

N=int(input())
S=input()
print(S[N:]+S[:N])

N=int(input())
S=input()
print(bytes((s-65+N)%26+65 for s in S.encode()).decode())

Verdicts: Wrong Answer

Wrong Answer

Accepted
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):
n = int(input())
s = input()

ans = ''
for c in s:
    tmp_i = ord(c) - ord('A')
    if tmp_i + n < 26:
        ans+=chr(ord(c)+n)
    else:
        ans+=chr(ord('A')+(25-tmp_i))
    
print(ans)

n = int(input())
s = input()

ans = ''
for c in s:
    tmp_i = ord(c) - ord('A')
    if tmp_i + n < 26:
        ans+=chr(ord(c)+n)
    else:
        ans+=chr(ord('A')+(n-(ord('Z')-ord(c)))-1)
    
print(ans)

Verdicts: Wrong Answer

Accepted
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):
N = int(input())
print("".join(map(lambda c: chr((c+N-65)%27+65), map(ord, input()))))

N = int(input())
print("".join(map(lambda c: chr((c+N-65)%26+65), map(ord, input()))))

Verdicts: Wrong Answer

Accepted
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):
N = int(input())
S = input()
P = []
for i in range(len(S)):
    if ord(S[i]) + N > 90:
        temp = (ord(S[i]) + N) - 90
        P.append(chr(65 + (temp - 1)))
    else:
        P.append(chr(ord(S[i]) + N))
print(P)

N = int(input())
S = input()
P = []
for_represent = []
for i in range(len(S)):
    if ord(S[i]) + N > 90:
        temp = (ord(S[i]) + N) - 90
        P.append(chr(65 + (temp - 1)))
    else:
        P.append(chr(ord(S[i]) + N))
P = "".join(map(str, P))
print(P)

Verdicts: Wrong Answer

Accepted
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):
N=int(input())
str=input()
ordnum=0
ans=""
for i in str:
  ordnum=ord(i)+N
  if (ordnum>91):
    ordnum=ordnum-26
  ans=ans+chr(ordnum)
print(ans)

N=int(input())
str=input()
ordnum=0
ans=""
for i in str:
  ordnum=ord(i)+N
  if (ordnum>=91):
    ordnum=ordnum-26
  ans=ans+chr(ordnum)
print(ans)

Verdicts: Wrong Answer

Accepted
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):
n = int(input())
A = list(input())
A_change={}
B = [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 A:
  for j in B:
    if A[i]=B[j]
  A_change[i] = B[(j+n)%26]
print(list(A_change.values()))

n = int(input())
A = list(input())
A_change={}
B = [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 A:
  for j in B:
    if i= j:
      A_change[i] = B[(B.index(j)+n)%26]
print(list(A_change.values()))

n = int(input())
A = list(input())
A_change={}
B = [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 A:
  for j in B:
    if i==j:
      A_change[i] = str(B[(B.index(j)+n)%26])
print(list(A_change.values()))

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
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):
N=int(input())
S=input()
Z='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(S)):
  for j in range(len(Z)):
    if S[i]==Z[j]:
        print(Z[(j+N)%26])
    else:
        pass

N=int(input())
S=input()
Z='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
List=[]
y=0
for i in range(len(S)):
  for j in range(len(Z)):
    if S[i]==Z[j]:
        y=Z[(j+N)%26]
    else:
        pass

  List.append(y)

print(List)

N=int(input())
S=input()
Z='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
List=[]
y=0
for i in range(len(S)):
  for j in range(len(Z)):
    if S[i]==Z[j]:
        y=Z[(j+N)%26]
    else:
        pass

  List.append(y)

a=List[0]
for i in range(1,len(S)):
    a=a+List[i]
    
print(a)

Verdicts: Wrong Answer

Wrong Answer

Accepted
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):
def main():
    n = int(input())
    s = str(input())

    str_list = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

    ans_list = []
    for i in range(len(s)):
        print(s[i])
        tmp = str_list.find(str(s[i]))
        index_tmp = tmp+n
        if index_tmp >= len(str_list):
            index_tmp -= len(str_list)

        ans_list.append(str_list[index_tmp])

    mojiretsu = ''.join(ans_list)
    print(mojiretsu)



if __name__ == '__main__':
    main()



def main():
    n = int(input())
    s = str(input())

    str_list = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

    ans_list = []
    for i in range(len(s)):
        tmp = str_list.find(str(s[i]))
        index_tmp = tmp+n
        if index_tmp >= len(str_list):
            index_tmp -= len(str_list)

        ans_list.append(str_list[index_tmp])

    mojiretsu = ''.join(ans_list)
    print(mojiretsu)



if __name__ == '__main__':
    main()



Verdicts: Wrong Answer

Accepted
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):
n = int(input())
s = input()
x = len(s)
for i in range(x):
  a = s[i]
  b = ord(a)
  c = ord("A")
  d = (b + n - c)%26
  s[i] = chr(c + d)
print(s)

n = int(input())
s = input()
x = len(s)
for i in range(x):
  a = s[i]
  b = ord(a)
  c = ord("A")
  d = (b + n - c)%26
  print(chr(c + d), end = '')
print()


Verdicts: Runtime Error

Accepted
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):
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]*2
N = int(input())
S = list(input())
for i in range(len(S)):
	Anum = Alp.index(S[i])
    S.replace(S[i],Alp[Anum+N])
print("".join(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]*2
N = int(input())
S = list(input())
for i in range(len(S)):
  Anum = Alp.index(S[i])
  S.replace(S[i],Alp[Anum+N])
print("".join(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"]*2
N = int(input())
S = list(input())
for i in range(len(S)):
	Anum = Alp.index(S[i])
	S[i] = Alp[Anum+N]
print("".join(S))

Verdicts: Runtime Error

Runtime Error

Accepted
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):
n=int(input())
s=input()
alpha=[chr(i) for i in range(ord("A"),ord("Z")+1)]
encode=alpha[n:]+alpha[:n]
text=[]
for c in s:
    text.append(encode[alpha.index(c)])
    print("".join)

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)

Verdicts: Wrong Answer

Accepted
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):
n=int(input())
s=input()
cnt=len(s)
a='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans=''
for i in range(cnt-1):
  ans=ans+a[(i+n)%26]
print(ans)  
  

n=int(input())
s=input()
cnt=len(s)
a='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans=''
for i in range(cnt):
  ans=ans+a[(i+n)%26]
print(ans)  
  

n=int(input())
s=input()
cnt=len(s)
a='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans=''
for i in range(cnt):
  ans=ans+a[(i+n)%26]
print(ans)  
  

n=int(input())
s=input()
cnt=len(s)
a='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans=''
for i in range(cnt):
  ans=ans+a[i+n]
print(ans)  


n=int(input())
s=input()
cnt=len(s)
a='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans=''
for i in range(cnt):
  
  l=a.index(s[i])
  ans=ans+a[(l+n)%26]
print(ans)  
  

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Accepted
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):
n = int(input())
s = input()
S=""
for i in range(len(s)):
	print(chr((ord(s[i])+n-65)%26+65))

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


Verdicts: Wrong Answer

Accepted
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):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from EmurateInput import input

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


def rot_encode(n):
    from string import ascii_lowercase as lc, ascii_uppercase as uc
    lookup = str.maketrans(lc + uc, lc[n:] + lc[:n] + uc[n:] + uc[:n])
    return lambda s: s.translate(lookup)


print(rot_encode(N)(S))


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


def rot_encode(n):
    from string import ascii_lowercase as lc, ascii_uppercase as uc
    lookup = str.maketrans(lc + uc, lc[n:] + lc[:n] + uc[n:] + uc[:n])
    return lambda s: s.translate(lookup)


print(rot_encode(N)(S))


Verdicts: Runtime Error

Accepted
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):

def main(N, S):
    base = ord('A')
    res = ''.join(chr((ord(s) - base + N) % 26 + base) for s in S)
    print(res)


if __name__ == "__main__":
    N = int(input('N >'))
    S = input('S >')
    main(N, S)




def main(N, S):
    base = ord('A')
    res = ''.join(chr((ord(s) - base + N) % 26 + base) for s in S)
    print(res)


if __name__ == "__main__":
    N = int(input(''))
    S = input('')
    main(N, S)



Verdicts: Wrong Answer

Accepted
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):
KEY = int(input())
s = input()

ans = ""
for i in range(len(s)):
  num = ord(s[i])
  num = num + (KEY % 26)
  if ord("Z") < num:
    num = ord("A") + num - ord("Z")
  ans += chr(num)
print(ans)

n = int(input())
s = input()

ans = ""
for i in range(len(s)):
    num = (ord(s[i]) + n)
    if num > ord("Z"):
        num %= ord("Z")
        num += ord("A") - 1
    ans += chr(num)
print(ans)

Verdicts: Wrong Answer

Accepted
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):
n= int(input())
s = input()
a =''
for i in range(len(s)):
   
    a += (chr(ord(s[i])+n))
     
print(a)

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

Verdicts: Wrong Answer

Accepted
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):
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"]
new_S = []
for i in range(len(S)):
  s = alphabet.index(S[i])+N
  new_S.append(alphabet[s])
print("".join(new_S))

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"]
new_S = []
for i in range(len(S)):
  s = alphabet.index(S[i])+N
  if s >= 26 :
    s -= 26
  new_S.append(alphabet[s])
print("".join(new_S))

Verdicts: Runtime Error

Accepted
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):
rot = int(input())
strlist = list(input())

def shift(char, rot):
  str = ["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"]
  index = str.index(char)
  index = (index + rot) % 25
  return str[index]

ret = []
for c in strlist:
  ret.append(shift(c, rot))
 
print("".join(ret))

rot = int(input())
strlist = list(input())

def shift(char, rot):
  str = ["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"]
  index = str.index(char)
  index = (index + rot) % 26
  return str[index]

ret = []
for c in strlist:
  ret.append(shift(c, rot))
 
print("".join(ret))

Verdicts: Wrong Answer

Accepted
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):
N = int(input())
S = list(input())
L = len(S)

for i in range(L):
  S[i] = chr((ord(S[i])+N-65)%26+65)
  
print(S)

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

for i in range(L):
  S[i] = chr((ord(S[i])+N-65)%26+65)
  
print("".join(S))

Verdicts: Wrong Answer

Accepted
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):
N = int(input())
st = input()
ans_st = ""

for i in range(N):
  ch_ord = ord(st[i])
  if ch_ord + N > 122:
    ans_st += chr(ch_ord + N - 26)
  else:
    ans_st += chr(ch_ord + N)
print(ans_st)

N = int(input())
st = input()
ans_st = ""

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

Verdicts: Runtime Error

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

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



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


# -*- coding: utf-8 -*-

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

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


Verdicts: Wrong Answer

Accepted
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):
n, s = input(), input()
out = ""
for i in range(len(s)):
  if ord(s[i].upper()) == 90:
    out += 'A'
  else:
    out += chr(ord(s[i].upper()) + 1)
print(out)

n, s = input(), input()
out = ""
for i in range(len(s)):
    if ord(s[i].upper()) == 90:
        out += 'A'
    else:
        out += chr(ord(s[i].upper()) + int(n))
print(out)

n, s = input(), input()
out = ""
for i in range(len(s)):
    a = ord(s[i].upper()) % 65
    out += chr((a + int(n) % 26) % 26 + 65)
print(out)


Verdicts: Wrong Answer

Wrong Answer

Accepted
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):
N = int(input())
S_list = list(input())

for i in range(0,len(S_list)):
    M = ord(S_list[i])+N
    if M > 90:
        M -= 25
    S_list[i] = chr(M)

print("".join(S_list))

N = int(input())
S_list = list(input())

for i in range(0,len(S_list)):
    M = ord(S_list[i])+N
    if M > 90:
        M -= 26
    S_list[i] = chr(M)

print("".join(S_list))

Verdicts: Wrong Answer

Accepted
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):
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','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']
anslist=[]

for i in range(len(S)):
    b=a.index(S[i])
    ans.append(a[b+N])

ans="".join(anslist)


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','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']
anslist=[]

for i in range(len(S)):
    b=a.index(S[i])
    anslist.append(a[b+N])

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

Verdicts: Runtime Error

Accepted
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):
n = int(input())
s = list(input())

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

print(alp.index('F'))

for i in range(len(s)):
    s[i] = alp[(int(alp.index(s[i])) + n) % len(alp)]

print(''.join(s))

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


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

print(''.join(s))

Verdicts: Wrong Answer

Accepted
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):
N= input()
S= input()



Len = len(S)
LIST = list(S)

ANSWER = ""

for SS in LIST:
    NUNBER = ord(SS)
    NUNBER = NUNBER -64
    AFFTER = NUNBER + N
    LAST  = AFFTER % 26
    if LAST == 0:
        LAST = 26
    LAST  = chr(LAST+64)
    ANSWER = ANSWER + LAST
    
print(ANSWER)




N= input()
S= input()







Len = len(S)
LIST = list(S)

ANSWER = ""

for SS in LIST:
    NUNBER = ord(SS)
    NUNBER = NUNBER -65
    AFFTER = NUNBER + N
    LAST  = AFFTER % 26
   # if LAST == 0:
    #    LAST = 26
    LAST  = chr(LAST+65)
    ANSWER = ANSWER + LAST
    
print(ANSWER)


N= input()
S= input()

Len = len(S)
LIST = list(S)

ANSWER = ""

for SS in LIST:
    NUNBER = ord(SS)
    NUNBER = NUNBER -64
    AFFTER = NUNBER + N
    LAST  = AFFTER % 26
    LAST  = chr(LAST+64)
    ANSWER = ANSWER + LAST
    
print(ANSWER)

N= input()
S= input()



Len = len(S)
LIST = list(S)

ANSWER = ""

for SS in LIST:
    NUNBER = ord(SS)
    NUNBER = NUNBER -64
    AFFTER = NUNBER + N
    LAST  = AFFTER % 26
    if LAST == 0:
        LAST = 26
    LAST  = chr(LAST+64)
    ANSWER = ANSWER + LAST
    
print(ANSWER)


N= input()
S= input()


N = int(N)
Len = len(S)
LIST = list(S)

ANSWER = ""

for SS in LIST:
    NUNBER = ord(SS)
    NUNBER = NUNBER -65
    AFFTER = NUNBER + N
    LAST  = AFFTER % 26
    LAST  = chr(LAST+65)
    ANSWER = ANSWER + LAST
    
print(ANSWER)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
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):
n = int(input())
s = input()
x = []
import string
a = list(string.ascii_uppercase)
for i in s:
    b = a.index(i)
    x.append(a[b + n])
    
print(''.join(x))

n = int(input())
s = input()
x = []
import string
a = list(string.ascii_uppercase)*2
#print(a)
for i in s:
    b = a.index(i)
    x.append(a[b + n])
    
print(''.join(x))


Verdicts: Runtime Error

Accepted
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):
num = int(input())
str_ls = list(input().split())

ans_ls = []
for x in str_ls:
    i = lambda x: ord(x)
    ii = int(i)
    if ii >= 90:
        ans_ls.append(i)
    else:
        ans_ls.append(i - 26)
ls = []
for y in ans_ls:
    l = lambda y : chr(y)
    ls.append(i)

ans = join(ls)
print(ans)


num = int(input())
str = input()

ans_ls = []
for x in str:
    i = ord(x)
    if i <= 90:
        ans_ls.append(i)
    else:
        ans_ls.append(i - 26)
ls = []
for y in ans_ls:
    l = chr(y)
    ls.append(l)

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

num = int(input())
str = input()

ans_ls = []
for x in str:
    i = ord(x) + num
    if i <= 90:
        ans_ls.append(i)
    else:
        ans_ls.append(i - 26)
ls = []
for y in ans_ls:
    l = chr(y)
    ls.append(l)

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

Verdicts: Runtime Error

Wrong Answer

Accepted
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):
N = int(input())
S = list(input())

result = ''
for i in range(0,len(S)):
  num = ord(S[i])
  new = chr(num+N)
  result += new

print(result)

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

result = ''
for i in range(0,N):
  num = ord(S[i])
  new = chr(num+2)
  result += new

print(result)

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)

Verdicts: Wrong Answer

Runtime Error

Accepted
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):
N=int(input())
S=input()
l=[0]*len(S)
for i in range(len(S)):
    if ord(S[i])+2<=90:
        print(ord(S[i]))
        l[i]=chr(ord(S[i])+N)
    else:
        l[i]=chr(ord(S[i])+N-26)
print(''.join(l))


N=int(input())
S=input()
l=[0]*len(S)
for i in range(len(S)):
    print(ord(S[i]))
    if ord(S[i])+N<=90:
        l[i]=chr(ord(S[i])+N)
    else:
        l[i]=chr(ord(S[i])+N-26)
print(''.join(l))


N=int(input())
S=input()
l=[0]*len(S)
for i in range(len(S)):
    print(ord(S[i]))
    if ord(S[i])+2<=90:
        print(ord(S[i]))
        l[i]=chr(ord(S[i])+N)
    else:
        l[i]=chr(ord(S[i])+N-26)
print(''.join(l))

N=int(input())
S=input()
l=[0]*len(S)
for i in range(len(S)):
    if ord(S[i])+N<=90:
        l[i]=chr(ord(S[i])+N)
    else:
        l[i]=chr(ord(S[i])+N-26)
print(''.join(l))


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
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):
import sys
input=sys.stdin.readline
n=int(input())
L=input()
F=[]
for i in range(len(L)):
    A=ord(L[i])+n
    if A>=91:
        A=A-91+65
    F.append(chr(A))
print("".join(F))



import sys
input=sys.stdin.readline
n=int(input())
L=input()[:-1]
F=[]
for i in range(len(L)):
    A=ord(L[i])+n
    if A>=91:
        A=A-91+65
    F.append(chr(A))
print("".join(F))

Verdicts: Wrong Answer

Accepted
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):
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']
nalp = []
n = int(input())
str = input()
chars = list(str)

for i in range(len(chars)):
  num = alp.index(chars[i])
  if n+num>26:
      num -= 26
  nalp.append(alp[n+num])

mojiretu = ' '
 
for x in nalp:
    mojiretu += x
print(mojiretu)


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']
nalp = []
n = int(input())
str = input()
chars = list(str)

for i in range(len(chars)):
  num = alp.index(chars[i])
  if n+num>=26:
      num -= 26
  nalp.append(alp[n+num])

mojiretu = ''
 
for x in nalp:
    mojiretu += x
print(mojiretu)


Verdicts: Runtime Error

Accepted
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):
n=int(input())
s=input()
list='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(s)):
  x=list[(list.index(s[i])+n)%26]
  s.replace(s[i],x)
print(s)

n=int(input())
s=input()
list=ABCDEFGHIJKLMNOPQRSTUVWXYZ
for i in range(len(s)):
  x=list[(list.index(s[i])+n)%26]
  s.replace(s[i],x)
print(s)

n=int(input())
s=input()
list=ABCDEFGHIJKLMNOPQRSTUVWXYZ
for i in range(len(s)):
  x=list[(list.index(s[i])+n)%26]
  s.replace(s[i],x)

n=int(input())
s=input()
t='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(s)):
  x=t[(t.index(s[i])+n)%26]
  s=s[:i]+x+s[i+1:]
print(s)

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted