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):
alf = ([chr(i) for i in range(ord("A"), ord("Z") + 1)])
N = int(input())
s = str(input())
S = list(s)
ans = []
for i in S:
    num1 = alf.index(i)
    print(num1)
    num2 = num1 + N
    if num2<= 25:
        ans.append(alf[num2])
    else:
        ans.append(alf[num2-26])
Ans = "".join(ans)
print(Ans)

alf = ([chr(i) for i in range(ord("A"), ord("Z") + 1)])
N = int(input())
s = str(input())
S = list(s)
ans = []
for i in S:
    num1 = alf.index(i)
    num2 = num1 + N
    if num2<= 25:
        ans.append(alf[num2])
    else:
        ans.append(alf[num2-26])
Ans = "".join(ans)
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()
codePoint = []

splitedInput = list(S)
wordCount = len(splitedInput)
for i in range(wordCount):
    convertAscii = ord(splitedInput[i]) + N
    if convertAscii > ord("Z"):
        convertAscii = convertAscii - ord("Z") + ord("A") - 1
    conversion = chr(convertAscii)
    codePoint.append(conversion)

print(codePoint)

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

splitedInput = list(S)
wordCount = len(splitedInput)
for i in range(wordCount):
    convertAscii = ord(splitedInput[i]) + N
    if convertAscii > ord("Z"):
        convertAscii = convertAscii - ord("Z") + ord("A") - 1
    conversion = chr(convertAscii)
    codePoint.append(conversion)

print(codePoint)

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

splitedInput = list(S)
wordCount = len(splitedInput)
for i in range(wordCount):
    convertAscii = ord(splitedInput[i]) + N
    if convertAscii > ord("Z"):
        convertAscii = convertAscii - ord("Z") + ord("A") - 1
    conversion = chr(convertAscii)
    codePoint.append(conversion)

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

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):
a=int(input())
b=list(input())
s=[]
for i in range(len(b)):
  c=(ord(b[i])-64+a)%26+64
  s.append(chr(c))
print("".join(s))


a=int(input())
b=list(input())
s=""
for i in range(len(b)):
  c=(ord(b[i])-64+a)%26+64
  s=s+chr(c)
print(s)

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


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().split())
S=list(input())
#65~90
for i in range(len(S)):
  S[i]+=N
  S[i]=(S[i]%26)+65
print("".join(S))

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

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:
    if ord(i) + n > 90:
        print(chr(64+n-(90-ord(i))))
    else:    
        print(chr(ord(i)+n))

n = int(input())
s = input()
out = ""
for i in s:
    if ord(i) + n > 90:
        out += chr(64+n-(90-ord(i)))
    else:    
        out += chr(ord(i)+n)

print(out)

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

str_list = list(S)
str_trsf = []

for item in str_list:
    str_trsf.extend(chr(ord('A') + ord('Z') - ord(item)) if ord(item) + N > ord('Z') else chr(ord(item) + N))

print(''.join(str_trsf))


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

str_list = list(S)
str_trsf = []

for item in str_list:
    str_trsf.extend(chr(N - (ord('Z') - ord(item)) + ord('A') if ord(item) + N > ord('Z') else chr(ord(item) + N)))

print(''.join(str_trsf))


N = int(input())
S = input()
 
str_list = list(S)
str_trsf = []
 
for item in str_list:
    str_trsf.extend(chr(N - (ord('Z') - ord(item)) + ord('A')) if ord(item) + N > ord('Z') else chr(ord(item) + N))

print(''.join(str_trsf))


N = int(input())
S = input()
 
str_list = list(S)
str_trsf = []
 
for item in str_list:
    str_trsf.extend(chr(N - (ord('Z') - ord(item) + 1) + ord('A')) if ord(item) + N > ord('Z') else chr(ord(item) + N))

print(''.join(str_trsf))

Verdicts: Wrong Answer

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("")
result = ""
size = len(S)
for i in range(size):
    if i + N < size:
        result += S[i + N]
    else:
        result += S[i + N - size]
print(result)

N = int(input())
S = input("")
result = str()
size = len(S)
for i in range(size):
    if i + N < size:
        result += S[i + N]
    else:
        result += S[i + N - size]
print(result

N = int(input())
S = input("")
result = str()
size = len(S)
for i in range(size):
    if i + N < size:
        result += S[i + N]
    else:
        result += S[i + N - size]
print(result)

alph_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"]
N = int(input())
S = input("")
ans = str()
for i in range(len(S)):
    t = alph_list.index(S[i]) + N
    if t < len(alph_list):
        ans += alph_list[t]
    else:
        ans += alph_list[t - len(alph_list)]
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 = inuput()
alfha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ''
for i in s:
  a += alfha[(alfha.index(i)+n) % 26]
print(ans)

n = int(input())
s = input()
alfha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ''
for i in s:
  ans += alfha[(alfha.index(i)+n) % 26]
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,T=input().split()
A=[]
for s,t in  zip(S,T):
  A.append(s+t)
print(write(A))

N=int(input())
S=input()
B=""
for i in range(len(S)):
   C=ord(S[i])+N
   if C>90:
       C=C-26
   else:
       C=C
   B=B+chr(C) 
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):
def solve(n: int, s: str) -> str:
    def inc(c: str, n: int) -> str:
        tbl = {
            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',
            23: 'W',
            24: 'X',
            25: 'Y',
            26: 'Z',
        }
        rev_tbl = {v: k for k, v in tbl.items()}
        idx = (rev_tbl[c] + n) % len(tbl)
        return tbl[idx]

    return ''.join([inc(c, n) for c in s])


n = int(input().strip())
s = input().strip()
print(solve(n, s))


def solve(n: int, s: str) -> str:
    def inc(c: str, n: int) -> str:
        tbl = {
            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',
        }
        rev_tbl = {v: k for k, v in tbl.items()}
        idx = (rev_tbl[c] + n) % len(tbl)
        return tbl[idx]

    return ''.join([inc(c, n) for c in s])


n = int(input().strip())
s = input().strip()
print(solve(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):
N=int(input())
S=input()
tmp=""
for i in range(N):
  if(S[i]!=Z):
    tmp+=chr(ord(S[i])+1)
  else:
    tmp+="A"
print(tmp)

N=int(input())
S=input()
tmp=""
for i in range(len(S)):
  chtmp=ord(S[i])+N
  if(chtmp>ord('Z')):
    chtmp-=(ord('Z') - ord('A'))
  tmp+=chr(chtmp)
print(tmp)


N=int(input())
S=input()
tmp=""
for i in range(N):
  if(S[i]!="Z"):
    tmp+=chr(ord(S[i])+1)
  else:
    tmp+="A"
print(tmp)


N=int(input())
S=input()
tmp=""
for i in range(len(S)):
  chtmp=ord(S[i])+N
  if(chtmp>ord('Z')):
    chtmp-=ord('A')
  tmp+=chr(chtmp)
print(tmp)


N=int(input())
S=input()
tmp=""
for i in range(len(S)):
  chtmp=ord(S[i])+N
  if(chtmp>ord('Z')):
    chtmp-=(ord('Z') - ord('A') + 1)
  tmp+=chr(chtmp)
print(tmp)


Verdicts: Runtime Error

Wrong Answer

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):
# the uppercase letters are encoded as 65 to 90
# I want to put A as 0, so Z is 25

def letter_to_int(letter):
    return ord(letter)-65


def int_to_letter(encoded_value):
    return chr(encoded_value+65)


def shift_string(N, string):
    shifted_string = ""
    for char in string:
        encoding = letter_to_int(char)
        # mod ensures it wraps around, eg N=3 sends Z to C
        shifted = (encoding+N)%26
        decoded_to_letter = int_to_letter(shifted)
        shifted_string = shifted_string + decoded_to_letter
    return shifted_string


if __name__ == "__main__":
    test1 = \
"""2
ABCXYZ"""
    test2 = \
"""0
ABCXYZ"""
    test3 = \
"""13
ABCDEFGHIJKLMNOPQRSTUVWXYZ"""
    various_tests = [test1, test2, test3]
"""    for test in various_tests:
        lines = test.split("\n")
        N = int(lines[0])
        string = lines[1]
        print(shift_string(N, string))"""
    N = int(input())
    string = input()
    print(shift_string(N, string))

# the uppercase letters are encoded as 65 to 90
# I want to put A as 0, so Z is 25

def letter_to_int(letter):
    return ord(letter)-65


def int_to_letter(encoded_value):
    return chr(encoded_value+65)


def shift_string(N, string):
    shifted_string = ""
    for char in string:
        encoding = letter_to_int(char)
        # mod ensures it wraps around, eg N=3 sends Z to C
        shifted = (encoding+N)%26
        decoded_to_letter = int_to_letter(shifted)
        shifted_string = shifted_string + decoded_to_letter
    return shifted_string


if __name__ == "__main__":
    test1 = \
"""2
ABCXYZ"""
    test2 = \
"""0
ABCXYZ"""
    test3 = \
"""13
ABCDEFGHIJKLMNOPQRSTUVWXYZ"""
    various_tests = [test1, test2, test3]
    """for test in various_tests:
        lines = test.split("\n")
        N = int(lines[0])
        string = lines[1]
        print(shift_string(N, string))"""
    N = int(input())
    string = input()
    print(shift_string(N, string))

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()
num=len(s)
new=""
for i in range(num):
  a=ord(s[i])
  b=a+n
  if b>90:
    new+=chr(b-24)
  else:
    new+=chr(b)
print(new)

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)

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()
al=list('ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ')
for i in s:
  s=s.replace(i, al[n+al.index(i)])
print(s)

n = int(input())
s = input()
ans = ""
for i in s:
    ans += chr(ord("A") + (ord(i) - ord("A") + n)%26)
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()
k = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(n):
  s.replace(s[i], k[k.index(s[i])+2])
print(s)

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

n = int(input())
s = list(input())
k = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(s)):
  s[i] = k[(k.index(s[i])+n)%len(k)]
s_change = "".join(s)
print(s_change)

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 = input()
t = ""
for i in s:
  a = ord(i) + n
  if a > ord("Z"):
    a = a - 26
  t += chr(a)

n = int(input())
s = input()
t = ""
for i in s:
  a = ord(i) + n
  if a > ord("Z"):
    a = a - 26
  t += chr(a)
print(t)

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

zn = ord('Z')
ret = ''
for x in s:
  a = ord(x) + 2
  if a > zn:
    a -= zn
    a += ord('A')
  ret += chr(a)

print(ret)

n = int(input()) % 26
s = input()

zn = ord('Z')
ret = ''
for x in s:
  a = ord(x) + n
  if a > zn:
    a -= zn
    a += ord('A')-1
  ret += chr(a)

print(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):
#i = int(input())
#s = input()
i = 13
s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
en = ['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_list = [(en[(en.index(k)+i)%26]) for k in s]
print(''.join(s_list)

i = int(input())
s = input()
en = ['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 = [en[(en.index(x) + 26) % 26 + i] for x in s]
print(ans.join(''))

i= int(input())
s = input()
en = ['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_list = [(en[(en.index(k)+i)%26]) for k in s]
print(''.join(s_list)

i= int(input())
s = input()
en = ['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_list = [(en[(en.index(k)+i)%26]) for k in s]
print(''.join(s_list))

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):
dict = ['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_str = ''
S = int(input())
strs = input()

for x in strs:
  new_idx = (dict.index(x)+S)%26
  new_str += str(new_idx)
  
print(new_str)

dict = ['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_str = ''
S = int(input())
strs = input()
 
for x in strs:
  new_idx = (dict.index(x)+S)%26
  new_str += str(dict[new_idx])
  
print(new_str)

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 rot(c):
    return chr(((ord(c) - ord('A') + 1) % 26) + ord('A'))

_ = input()
print(''.join(map(rot, input())))


def _rot(N):
    def rot(c):
        return chr(((ord(c) - ord('A') + N) % 26) + ord('A'))
    return rot

rot = _rot(int(input()))
print(''.join(map(rot, 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()

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

	
for i in range(0, len(s)):
	b = s[i]
	x = abc.index(b) + n
	print(x)
	while x > 25:
		x = x - 26	
	y = abc[x]
	print(y)
	s = list(s)
	s[i] = y
	s = ''.join(s)
print(s)
	

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

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

	
for i in range(0, len(s)):
	b = s[i]
	x = abc.index(b) + n
	while x > 25:
		x = x - 26	
	y = abc[x]
	s = list(s)
	s[i] = y
	s = ''.join(s)
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):
# -*- coding: utf-8 -*-
n = int(input())
s = list(input())

l = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']

ans = []
for ss in s:
    ind = l.index(ss) + 1
    n_ind = ind + n
    r = n_ind % 26 - 1
    ans.append(l[r])

print(ans)


# -*- coding: utf-8 -*-
n = int(input())
s = list(input())

l = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']

ans = []
for ss in s:
    ind = l.index(ss) + 1
    n_ind = ind + n
    r = n_ind % 26 - 1
    ans.append(l[r])

print("".join(map(str,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):
sl = [i for i in list(__import__('string').ascii_uppercase)] #string list
nl = list(range(26)) 
sd = dict(zip(nl, ul)) #                 {0:A}
sd_inv = {i:j for j,i in sd.items()} #  {A:0}

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

orig_num = [sd_inv[i]+n for i in s]
ans_num = []
for i in orig_num:
    if i>25:
        a = i-26
    else:
        a = i
    ans_num.append(a)
ans_list = [sd[i] for i in ans_num]
ans = "".join(ans_list)
print(ans)

ul = [i for i in list(__import__('string').ascii_uppercase)]
nl = list(range(26))
ad = dict(zip(nl, al))
ad_inv = {i:j for j,i in ad.items()}

n = int(input())
s = list(input())
ans = [ad_inv[i]+n for i in s]
ans = [ad[i] for i in ans]
ans = "".join(ans)
print(ans)

ul = [i for i in list(__import__('string').ascii_uppercase)]
nl = list(range(26))
ad = dict(zip(nl, ul))
ad_inv = {i:j for j,i in ad.items()}

n = int(input())
s = list(input())
ans = [ad_inv[i]+n for i in s]
ans = [ad[i] for i in ans]
ans = "".join(ans)
print(ans)

ll = [i for i in list(__import__('string').ascii_lowercase)]
ul = [i for i in list(__import__('string').ascii_uppercase)]
al = ll + ul
nl = list(range(52))
ad = dict(zip(nl, al))
ad_inv = {i:j for j,i in ad.items()}

n = int(input())
s = list(input())
ans = [ad_inv[i]+n for i in s]
ans = [ad[i] for i in ans]
ans = "".join(ans)
print(ans)

n = int(input())
s = input()
moji = [(ord(i) - ord("A") + n)%26 + ord("A") for i in s]
ans = "".join(list(map(chr, moji)))
print(ans)

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

output = ""

for char in list(S):
    ASCII = ord(char)
    num = ASCII - 65
    print(num)
    print(N)
    num = (num + N) % 26
    ASCII = num + 65
    print(chr(ASCII))
    output += chr(ASCII)

print(output)

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

output = ""

for char in list(S):
    ASCII = ord(char)
    num = ASCII - 65
    num = (num + N) % 26
    ASCII = num + 65
    output += chr(ASCII)

print(output)

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 = str(input())
ans = []
a2z = ["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)):
    index = a2z.index(s[i]) + n
    if index <= 25:
        tmp = a2z[index]
        ans.append(tmp)
    else:
        index -= 26
        tmp = a2z[index]
        ans.append(tmp)

for i in ans:
    print(i)


n = int(input())
s = str(input())
ans = []
a2z = ["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)):
    index = a2z.index(s[i]) + n
    if index <= 25:
        tmp = a2z[index]
        ans.append(tmp)
    else:
        index -= 26
        tmp = a2z[index]
        ans.append(tmp)

print("".join(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):
a=int(input())
s=list(input())
t=[len(s)]
list=[chr(i) for i in range(65, 65+26)]
for i in s:
  t.append(list.index(i))
u=[i+a for i in t]
u=[i-26 if i>26 else i for i in u]
b=[]
for i in u :
  b.append(list[i])
k=""
for s in b:
  k+=s
print(k)

a=int(input())
s=list(input())
t=[len(s)]
list=[chr(i) for i in range(65, 65+26)]
for i in s:
  t.append(list.index(i))
u=[i+a for i in t]
u=[i-26 if i>=26 else i for i in u]
b=[]
for i in u :
  b.append(list[i])
k=""
for s in b:
  k+=s
print(k)

a=int(input())
s=list(input())
t=[]
list=[chr(i) for i in range(65, 65+26)]
for i in s:
  t.append(list.index(i))
u=[i+a for i in t]
u=[i-26 if i>=26 else i for i in u]
b=[]
for i in u :
  b.append(list[i])
k=""
for s in b:
  k+=s
print(k)

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

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

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):
import string
List = [chr(i) for i in range(65,65+26)]
N = int(input())
s = list(input())
for i in range(len(s)):
  if s[i] == 'Z':
    s[i] = 'A'
    continue
  s[i] = List[List.index(s[i])+1]
print(*s)

import string
List = [chr(i) for i in range(65,65+26)]
N = int(input())
s = list(input())
ans = ''
for i in range(len(s)):
  Next_index = List.index(s[i])+N
  if Next_index>25:
    Next_index = abs(26-Next_index)
  ans += List[Next_index]
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()
def caesar(s, n):
    ns = []
    for ch in s:
        # A - Z
        if ('A' <= ch and ch <= 'Z'):
            ns.append(chr((ord(ch) - ord('A') - n) % 26 + ord('A')))
        else:
            ns.append(ch)
    return "".join(ns)

result = caesar(S, N)
print(result)

N = int(input())
S = [i for i in 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(''.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())
alp = list(input())

num = []
alpha2num = lambda c: ord(c) - ord('A') + 1
num2alpha = lambda c: chr(c+64)

for i in range(0,len(alp)):
    num.append(alpha2num(alp[i]))
    num[i]+=n
    num[i] = num[i]%26
    alp[i]=num2alpha(num[i])

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

n = int(input())%26
alp = list(input())

num = []
alpha2num = lambda c: ord(c) - ord('A') + 1
num2alpha = lambda c: chr(c+64)

for i in range(0,len(alp)):
    num.append(alpha2num(alp[i]))
    num[i]+=n
    if num[i]>26:
        num[i]=num[i]-26
    alp[i]=num2alpha(num[i])

ans = "".join(alp)
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 = str(input())
alp = 'abcdefghijklmnopqrstuvwxyz' * 2
lst = []

for i in range(len(s)):

    lst.append(alp[alp.index(s[i])+n])

print(''.join(lst))

n = int(input())
s = str(input())
alp = 'abcdefghijklmnopqrstuvwxyz' * 2
lst = []

for i in range(len(s)):

    lst.append(str(alp[alp.index(s[i])+n]))

print(''.join(lst))

n = int(input())
s = str(input())
alp = 'abcdefghijklmnopqrstuvwxyz' * 2
ss = ''

for i in range(len(s)):

    ss += str(alp[alp.index(s[i])+n])

print(ss)


n = int(input())
s = str(input())
alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
ss = ''

for i in range(len(s)):

    ss += str(alp[alp.index(s[i])+n])

print(ss)

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();
ans = []

for i in s:
    num = ord(i) + n;
    
    num = num - ord("a")
    num = num % 26 
    print(num)
    ans.append(chr(num  + ord("a")))

new = ""
for j in ans:
    new += j

print(new.upper())

n = int(input());
s = input();
ans = []

for i in s:
    num = ord(i) + n;
    
    num = num - ord("a")
    num = num % 26 
    print(num)
    ans.append(chr(num  + ord("a")))

new = ""
for j in ans:
    new += j

print(new)

n = int(input());
s = input();
ans = []

for i in s:
    num = ord(i) + n;
    
    num = num - ord("A")
    num = num % 26
    ans.append(chr(num  + ord("A")))
    
new = ""
for j in ans:
    new += j

print(new.upper())

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()
l = len(S)
word = ["a"]*l
for i in range(l):
  if ord(S[i]) + N <= 90:
    word[i] = chr(ord(S[i])+N)
  else:
    word[i] = chr(ord(S[i])+N-25)
print("".join(word))

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

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):
import sys
input = sys.stdin.readline
import numpy as np
base_list = np.array(['A','B','C','D','E','F','G','F','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'])
dict_list = []
dict_list.append(base_list)
for i in range(25):
    tmp_char = dict_list[i][0]
    tmp_list = dict_list[i][1:]
    tmp_list = np.append(tmp_list,tmp_char)
    dict_list.append(tmp_list)

def print_ans(N, sr):
    """Test Case
    >>> print_ans(2, ['A', 'B', 'C', 'X', 'Y', 'Z'])
    CDEZAB
    >>> print_ans(0, ['A', 'B', 'C','X', 'Y', 'Z'])
    ABCXYZ
    """
    idx_list = []
    for s in sr:
        tmp = np.where(base_list == s)[0]
        idx_list.append(int(tmp))
    print(''.join(dict_list[N][idx_list]))
    

if __name__ == '__main__':
    N = int(input().rstrip())
    sr = list(map(str, input().rstrip().split('')))
    print_ans(N, sr)




import sys
input = sys.stdin.readline
import numpy as np
base_list = np.array(['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'])
dict_list = []
dict_list.append(base_list)
for i in range(26):
    tmp_char = dict_list[i][0]
    tmp_list = dict_list[i][1:]
    tmp_list = np.append(tmp_list,tmp_char)
    dict_list.append(tmp_list)

def print_ans(N, sr):
    """Test Case
    >>> print_ans(2, ['A', 'B', 'C', 'X', 'Y', 'Z'])
    CDEZAB
    >>> print_ans(0, ['A', 'B', 'C','X', 'Y', 'Z'])
    ABCXYZ
    """
    idx_list = []
    for s in sr:
        tmp = np.where(base_list == s)[0]
        idx_list.append(int(tmp))
    ans = ''.join(dict_list[N][idx_list])
    print(ans)

if __name__ == '__main__':
    N = int(input().rstrip())
    tmp_s= input().rstrip()
    sr = []
    for s in tmp_s:
        sr.append(s)
    print_ans(N, 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):
N = input()
S = input()
N = int(N)

A = ""
num = 0
for s in S:
    num = (ord(s) + N) if ord(s) + N < 90 else (ord(s) + N - 25)
    A += chr(num)

print(A)

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

A = ""
num = 0
for s in S:
    num = (ord(s) + N) if ord(s) + N <= 90 else (ord(s) + N - 25)
    A += chr(num)

print(A)

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

A = ""
num = 0
for s in S:
    num = (ord(s) + N) if ord(s) + N < 91 else (ord(s) + N - 26)
    A += chr(num)

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):
# coding: utf-8
import string

alphabet = string.ascii_uppercase + string.ascii_uppercase

n_steps = int(input())
row_text = input()
processed_tuple = (alphabet[alphabet.index(x)+n_steps] for x in row_text)
print(*processed_tuple)

# coding: utf-8
import string

alphabet = string.ascii_uppercase + string.ascii_uppercase

n_steps = int(input())
row_text = input()
processed_tuple = (alphabet[alphabet.index(x)+n_steps] for x in row_text)
print(*processed_tuple, sep = '')

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):
A = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','S','Y','X','Z']
N = int(input())
S = list(input())
B = []
for i in range(len(S)):
  for j in range(26):
    if S[i] == A[j]:
      if j+N > 25:
        B.append(A[j+N-25])
      else:
        B.append(A[j+N])
print(''.join(B))

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']
N = int(input())
S = list(input())
B = []
for i in range(len(S)):
  for j in range(26):
    if S[i] == A[j]:
      if j+N > 25:
        B.append(A[j+N-26])
      else:
        B.append(A[j+N])
print(''.join(B))

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


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


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):
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
n = int(input())
s = input()
res = s[n:] + s[:n]
print(res)

alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
n = int(input())
res = alphabet[n:] + alphabet[:n]
print(res)

alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
alphabet += alphabet
n = int(input())
s = input()
res = alphabet[alphabet.index(_) + n] for _ in s
print(res)

alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
alphabet += alphabet
n = int(input())
s = list(input())
res = "".join([alphabet[alphabet.index(_) + n] for _ in s])
print(res)

Verdicts: 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()
int_A = 65
letters = 25
nums = [ord(char) for char in S]
print(nums)
nums = [(num - int_A + N) % letters for num in nums ]
print(nums)
print(''.join([chr(num + int_A) for num in nums]))

N = int(input())
S = input()
int_A = 65
letters = 25
nums = [ord(char) for char in S]
nums = [(num - int_A + N) % letters for num in nums ]
print(''.join([chr(num + int_A) for num in nums]))

N = int(input())
S = input()
int_A = 65
letters = 26
nums = [ord(char) for char in S]
nums = [(num - int_A + N) % letters for num in nums ]
print(''.join([chr(num + int_A) for num in nums]))

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

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

print(''.join(ans))


r = int(input())

print(int(r**2))

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


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()
lst=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','X','Y','Z']
S=list(s)
for i in range(n):
  idx=lst.index(S[i])
  S[i]=lst[(idx+n)%len(lst)]
t=''.join(S)
print(t)
  

n=int(input())
s=input()
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']
S=list(s)
for i in range(len(S)):
  idx=lst.index(S[i])
  S[i]=lst[(idx+n)%(len(lst))]
t=''.join(S)
print(t)
  


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):
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
N = int(input())
S = input()
a = ''
for item in S:
  a_index = alphabet.index(item) + n
  if a_index > 25:
    a_index = a_index - 26
  a += alphabet[a_index]
print(a)


alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
N = int(input())
S = input()
a = ''
for item in S:
  a_index = alphabet.index(item) + N
  if a_index > 25:
    a_index = a_index - 26
  a += alphabet[a_index]
print(a)


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())
A=''
for i in S:
    if ord(i)+N<ord('Z'):
        A+=chr(ord(i)+N)
    else:
        A+=chr(ord(i)+N-ord('z'))
print(A)


N=int(input())
S=list(input())
A=''
for i in S:
  A+=chr(ord(i)+N)
print(A)

N=int(input())
S=input().split()
for i in S:
    S[i]=chr(ord(i)+N)
print(S)

N=int(input())
S=list(input())
for i in S:
  S[i]=chr(ord(i)+N)
print(S)

N=int(input())
S=list(input())
A=''
for i in S:
    if ord(i)+N<=ord('Z'):
        A+=chr(ord(i)+N)
    else:
        A+=chr(ord(i)+N-(ord('Z')-ord('A')+1))
print(A)



Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Accepted