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):
num = int(input())
al = input()

newal = ""
alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in range(len(al)):
  newal = newal + alp[i+num]
  
print(newal)

num = int(input())
al = input()

newal = ""
alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in range(len(al)):
  if(alp.index(al[i])+num>25):
    newal = newal + alp[(alp.index(al[i])+num)-25]
  else:
    newal = newal + alp[alp.index(al[i])+num]
  
print(newal)

num = int(input())
al = input()

newal = ""
alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in range(len(al)):
  if(alp.index(al[i])+num>25):
    newal = newal + alp[(alp.index(al[i])+num)-26]
  else:
    newal = newal + alp[alp.index(al[i])+num]
  
print(newal)

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()
for i in range(len(s)):
  s[i]+=n
print(s)

n=int(input())
s=input()
for i in range(len(s)):
  s[i]=str(int(s[i])+n)
print(s)

n=int(input())
s=input()
a="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
s=list(s)
a=list(a)
for i in range(len(s)):
    if a.index(s[i]) + n >= 26:
        s[i]=a[int(a.index(s[i])+n-26)]
    else:
        s[i]=a[int(a.index(s[i])+n)]
s="".join(s)
print(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):
Num=int(input())
String=input()
Library=[['A',1],['B',2],['C',3],['D',4],['E',5],['F',6],['G',7],['H',8],['I',9],['J',10],['K',11],['L',12],['M',13],['N',14],['O',15],['P',16],['Q',17],['R',18],['S',19],['T',20],['U',21],['V',22],['W',23],['X',24],['Y',25],['Z',26]]
newstring=''
for i in String:
    for j in range(0,25):
        if i==Library[j][1]:
            oldstring=newstring
            newstring=Library[(j+Num)%26][1]+oldstring
print(newstring)

Num=int(input())
String=input()
Library=[['A',1],['B',2],['C',3],['D',4],['E',5],['F',6],['G',7],['H',8],['I',9],['J',10],['K',11],['L',12],['M',13],['N',14],['O',15],['P',16],['Q',17],['R',18],['S',19],['T',20],['U',21],['V',22],['W',23],['X',24],['Y',25],['Z',26]]
newstring=''
for i in String:
    for j in range(0,25):
        if i==Library[j][0]:
            oldstring=newstring
            newstring=oldstring+Library[(j+Num)%26][0]
print(newstring)

Num=input()
String=int(input())
Library=[['A',1],['B',2],['C',3],['D',4],['E',5],['F',6],['G',7],['H',8],['I',9],['J',10],['K',11],['L',12],['M',13],['N',14],['O',15],['P',16],['Q',17],['R',18],['S',19],['T',20],['U',21],['V',22],['W',23],['X',24],['Y',25],['Z',26]]
newstring=''
for i in String:
    for j in range(0,25):
        if i==Library[j][0]:
            oldstring=newstring
            newstring=oldstring+Library[(j+Num)%26][0]
print(newstring)

Num=int(input())
String=input()
Library=[['A',1],['B',2],['C',3],['D',4],['E',5],['F',6],['G',7],['H',8],['I',9],['J',10],['K',11],['L',12],['M',13],['N',14],['O',15],['P',16],['Q',17],['R',18],['S',19],['T',20],['U',21],['V',22],['W',23],['X',24],['Y',25],['Z',26]]
newstring=''
for i in String:
    for j in range(0,26):
        if i==Library[j][0]:
            oldstring=newstring
            newstring=oldstring+Library[(j+Num)%26][0]
print(newstring)

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 = list(input())
for i in range(len(s)):
    for j in range(65, 91):
        if s[i] == chr(j):
            print(chr(j))
            if j + n >= 91:
                s[i] = chr(65 + n - (91 - j))
                break
            else:
                s[i] = chr(j + n)
                break
print(''.join(s))

n = int(input())
s = list(input())
for i in range(len(s)):
    for j in range(65, 91):
        if s[i] == chr(j):
            if j + n >= 91:
                s[i] = chr(65 + n - (91 - j))
                break
            else:
                s[i] = chr(j + n)
                break
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())
S=input()
st=""
n2=0
for i in range(N):
  c1=S[i]
  n1=ord(c1)
  if n1+N>26:
    n2=(((n1-65)+N)%26)+65
  else:
    n2=n1
  st=st+chr(n2)
print(st)

N=int(input())
S=input()
st=""
n2=0
for i in range(len(S)):
  c1=S[i]
  n1=ord(c1)
  if n1+N>26:
    n2=(((n1-65)+N)%26)+65
  else:
    n2=n1
  st=st+chr(n2)
print(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):
N = int(input())
S = list(input())
alpha = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']

for i in range(len(S)) :
    S[i] = alpha[(alpha.index(S[i]) + N) % 26]
print(S)

N = int(input())
S = list(input())
alpha = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
buf = ''
for i in range(len(S)) :
    buf += alpha[(alpha.index(S[i]) + N) % 26]
print(buf)

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


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


sli = [ord(c) for c in S]
sli_mod = [n + N for n in sli]
sli_mod2 = [sraw if sraw < ord('Z') else sraw - 26 for sraw in sli_mod]
final = [chr(c) for c in sli_mod2]
out = "".join(final)
print(out)


#!/usr/bin/env python3


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


sli = [ord(c) for c in S]
sli_mod = [n + N for n in sli]
sli_mod2 = [sraw if sraw < ord('Z') else sraw - 26 for sraw in sli_mod]
final = [chr(c) for c in sli_mod2]
out = "".join(final)
print(out)


#!/usr/bin/env python3


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

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

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

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


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 i in s:
  j = ((ord(i)-ord("A")) + n )//26 

  ans += j
print(chr(ans))

n = int(input())
s = input()
ans = ''
for i in s:
  j = ((ord(i)-ord("A")) + n )%26 
  ans += chr(j + ord("A"))
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):
ls = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
dic = {"A":1,"B":2,"C":3,"D":4,"E":5,"F":6,"G":7,"H":8,"I":9,"J":10,"K":11,"L":12,"M":13,"N":14,"O":15,"P":16,"Q":17,"R":18,"S":19,"T":20,"U":21,"V":22,"W":23,"X":24,"Y":25,"Z":26}

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

ls = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
dic = {"A":1,"B":2,"C":3,"D":4,"E":5,"F":6,"G":7,"H":8,"I":9,"J":10,"K":11,"L":12,"M":13,"N":14,"O":15,"P":16,"Q":17,"R":18,"S":19,"T":20,"U":21,"V":22,"W":23,"X":24,"Y":25,"Z":26}

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


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

S = ''.join([chr(ord(s)+N) for s in S])
print(S)

N = int(input())
S = input()
 
S = ''.join([chr(ord('A')+(ord(s)-ord('A')+N)%26) for s in 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):
N = int(input())

S = input()
s = list(S)
l = len(s)



B = []

for i in range(l):
  c = ord(s[i])
  e = c+N
  if e>ord('Z'):
    e = (((e-ord('A')+1)%26)+64)
    if e == 64:
      e = 65
  d = chr(e)
  print(e)
  B.append(d)
    
b = ''.join(B)

print(b)


N = int(input())

S = input()
s = list(S)
l = len(s)



B = []

for i in range(l):
  c = ord(s[i])
  e = c+N
  if e>ord('Z'):
    e = e - 26
  d = chr(e)
  B.append(d)
    
b = ''.join(B)

print(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()
strs = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for s in S:
    ind = strs.index(s) + N
    if ind >= 26:
        ind = ind - 26
    print(strs[ind])



N = int(input())
S = input()
strs = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
result = ""

for s in S:
    ind = strs.index(s) + N
    if ind >= 26:
        ind = ind - 26
    result += strs[ind]
print(result)



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 = input()
li = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"*10
dic = {}
for i in range(26):
    S = S.replace(li[26-i],li[26-i+N])
print(S)


# -*- coding: utf-8 -*-
N = int(input())
S = input()
li = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"*10
dic = {}
for i in range(26):
    dic[li[i]] = i
re = []
for i in range(len(S)):
    re.append(li[dic[S[i]]+N])
print("".join(re))


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 f(c):
    r = ord(c) + n
    if 90 < r:
        r = r - (r // 90) * 26
    print(r)
    return chr(r)


r = ''

for i in s:
    r += f(i)

print(r)


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


def f(c):
    r = ord(c) + n
    if 90 < r:
        r = r - (r // 90) * 26
    return chr(r)


r = ''

for i in s:
    r += f(i)

print(r)


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()
ans = ""
a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in range(len(S)):
    if a.index(S[i]) + N > 26:
        ans += a[a.index(S[i]) + N - 26]
    else:
        ans += a[a.index(S[i]) + N]

print(ans)


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

for i in range(len(S)):
    if a.index(S[i]) + N > 26:
        ans += a[a.index(S[i]) + N - 26]
    else:
        ans += a[a.index(S[i]) + N]

print(ans)


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

for i in range(len(S)):
    if a.index(S[i]) + N > 25:
        ans += a[a.index(S[i]) + N - 26]
    else:
        ans += a[a.index(S[i]) + N]

print(ans)

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

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


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(s[n:]+s[:n])

n = int(input())
s = input()
s = sorted(s)
s = ''.join(s)

print(s[n:]+s[:n])

n = int(input())
a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
s = [i for i in input()]

b = []
for i in range(len(s)):
    for j in range(len(a)):
        if s[i]==a[j]:
            s[i] = a[(j+n)%26]
            break
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):
def change_str(moto_str):
    global Nnew
    global str_list
    global change_list

    for i in range(len(change_list)):
       if change_list[i] == moto_str:
            num = i+Nnew
            if num > 25:
                num = num - 25
    return change_list[num]

Nnew = int(input())
str = input()
str_list = list(str)
change_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"]

for i in range(len(str_list)):
    str_list[i] = change_str(str_list[i])


print(*str_list,sep='')



def change_str(moto_str):
    global Nnew
    global str_list
    global change_list

    for i in range(len(change_list)):
       if change_list[i] == moto_str:
            num = i+Nnew
            if num > 25:
                num = num - 26
    return change_list[num]

Nnew = int(input())
str = input()
str_list = list(str)
change_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"]

for i in range(len(str_list)):
    str_list[i] = change_str(str_list[i])


print(*str_list,sep='')



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()
t=''
for i in s:
  x=chr((ord(i)-65)%26+65)
  t+=x
print(t)

n=int(input())
s=input()
t=''
for i in s:
  x=chr((ord(i)-65)%26+65-n)
  t+=x
print(t)


n=int(input())
s=input()
t=''
for i in s:
  x=chr((ord(i)-65+n)%26+65)
  t+=x
print(t)


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

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

ans = ''
Z_s = 'Z'
for i in range(len(S)):
    ord_s = ord(S[i]) + N
    if ord_s > ord(Z_s):
        ord_s -= ord('Z') - ord('A')
    ans += chr(ord_s)
print(ans)

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

ans = ''
Z_s = 'Z'
for i in range(len(S)):
    ord_s = ord(S[i]) + N
    if ord_s > ord(Z_s):
        ord_s -= ord('Z') - ord('A')
    ans += chr(ord_s)
print(ans)

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

ans = ''
Z_s = 'Z'
for i in range(len(S)):
    ord_s = ord(S[i]) + N
    if ord_s > ord(Z_s):
        ord_s -= ord('Z') - ord('A') + 1
    ans += chr(ord_s)
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):
n = int(input())
s = input()
lenlen = len(s)

a = ''
for i in range(lenlen):
    c = ord(s[i]) + n
    print(c)
    if 91 <= c:
        c = c - 26
    a = a + chr(c)
print(a)
 

n = int(input())
s = input()
lenlen = len(s)

a = ''
for i in range(lenlen):
    c = ord(s[i]) + n
    if 91 <= c:
        c = c - 26
    a = a + chr(c)
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):
s = input()

N = int(s)

s = input()

S = s

for c in S:
    t = ord(c)
    t = t - 65 # A
    t = t + N
    t = t % 24
    print(chr(t+65))

s = input()

N = int(s)

s = input()

S = s

for c in S:
    t = ord(c) + N
    if t > 90:
       t = t-24
    print(chr(t))

s = input()

N = int(s)

s = input()

S = s

r = ''
for c in S:
    t = ord(c)
    t = t - 65 # A
    t = t + N
    t = t % 26
    r = r + chr(t+65)

print(r)

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


import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

word = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
N = int(readline())
S = readline().decode('utf8').rstrip()
print(S)

ans = [None] * len(S)
print(ans)
print(len(S))
for i in range(len(S)):
    # print(word[(word.index(S[i]) + N) % len(word)])
    ans[i] = word[(word.index(S[i]) + N) % len(word)]

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




import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline())
S = [int(x) - ord('A') for x in readline().rstrip()]
S = [(x + N)%26 for x in S]

ans = ''.join(chr(x+ord('A')) for x in S)
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()

ans = ""

for i in s:
    a = (ord(i) + n - 65) % 26 + 65
    print(a)
    ans += chr(a)

print(ans)


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

ans = ""

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

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):
import math

A,B,X = map(int,input().split())



check_num = [1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000]

if((A*1+B*1)>X):
    print(0)
else:
    flag = True
    for i in range(len(check_num)):
        if((A*check_num[i]+B*(i+1)) > X):
            flag = False
            break
    if(flag):
        print(10**9)
    else:
        value = math.ceil((X - B*i)/A)
        print(value-1)



N = int(input())
words = list(input())

for i in range(len(words)):
    check_word  = ord(words[i]) + N 
    if(check_word > ord('Z')):
        print(chr(ord('A') + (check_word - ord('Z'))-1),end="")
    else:
        print(chr(check_word),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):
n = int(input())
s = str(input())
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
rot = []
for i in s:
  pos = alphabet.find(i)
  pos = int(pos) + n
  if pos > 26:
    pos = int(pos) - 26
  rot.append(alphabet[pos])
strout = "".join(rot)
print(strout)

n = int(input())
s = str(input())
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
rot = []
for i in s:
  pos = alphabet.find(i)
  pos = int(pos) + n
  if pos >= 26:
    pos = int(pos) - 26
  rot.append(alphabet[pos])
strout = "".join(rot)
print(strout)

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()
ns = []
for ch in s:
    if ('A' <= ch and ch <= 'Z'):
        ns.append(chr((ord(ch) - ord('A') - n) % 26 + ord('A')))
       
   
print("".join(ns))

n = int(input())
s = input()
ns = []
for ch in s:
    if ('A' <= ch and ch <= 'Z'):
        ns.append(chr((ord(ch) - ord('A') + n) % 26 + ord('A')))
       
   
print("".join(ns))


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())
ans = ""
for c in input():
  print(ord(c),ord('A'))
  ans+= chr((ord(c)-ord('A')+n)%26+ord('A'))
print(ans)

n=int(input())
ans = ""
for c in input():
  ans+= chr((ord(c)+n))
print(ans)

n=int(input())
ans = ""
for c in input():
  ans+= chr((ord(c)-ord('A')+n)%26+ord('A'))
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):
n = int(input())
s = input()

len_s = len(s)
ss = []
for i in range(len_s):
    ss += s[(i+n)%len_s]
ans = "".join(ss)
print(ans)

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

len_s = len(s)
print(len_s)
ss = []
for i in range(len_s):
    print("i", i, "(i+n)", i+n, "(i+n)%len_s", (i+n)%len_s)
    ss += s[(i+n)%len_s]
ans = "".join(ss)
print(ans)

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

alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
len_alpha = len(alpha)
len_s = len(s)
ss = []

for i in range(len_s):
    index_ss = (alpha.index(s[i])+n)%len_alpha
    ss += alpha[index_ss]
ans = "".join(ss)
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):
N = int(input())
S = input()
alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

new_S = list()
for word in S:
    num = alpha.index(word)+N
    if num > 25:
        num -= 25
    new_S.append(alpha[num])
print(''.join(new_S))


N = int(input())
S = input()
alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

new_S = list()
for word in S:
    num = alpha.index(word)+N
    if num > 25:
        num -= 26
    new_S.append(alpha[num])
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):
n=int(input())
l=str(input())
#print(type(l))

ll=[]
leng=len(l)
#print('leng is %d'%leng)
for i in range(leng):
    t=l[i]
    #print(t)
    tt=(ord(t)-ord('A')+1+n)%26
    ttt=chr(tt+64)
    ll.append(ttt)
print(*ll,sep='')

n=int(input())
l=str(input())
#print(type(l))

ll=[]
leng=len(l)
#print('leng is %d'%leng)
for i in range(leng):
    t=l[i]
    tt=(ord(t)-ord('A')+1+n)%26
    if tt==0:
        tt+=26
    ttt=chr(tt+64)
    ll.append(ttt)
print(*ll,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):
import string

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

lis = list(string.ascii_uppercase)
answer = []

for s in S:
    index = lis.index(s)
    slide_index = index + N
    if slide_index > 25:
        slide_index -= 26
    new_s = lis[slide_index]
    answer.append(new_s)
answer = list(answer)

print(answer)


import string

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

lis = list(string.ascii_uppercase)
answer = []

for s in S:
    index = lis.index(s)
    slide_index = index + N
    if slide_index > 25:
        slide_index -= 26
    new_s = lis[slide_index]
    answer.append(new_s)

answer = ''.join(answer)

print(answer)


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 q2(in_num, in_str):
    o_str = ""
    letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    for i in range(len(in_str)):
        o_str += (letters[(letters.index(in_str[i])+int(in_num))%26])
    return o_str

q2(input(),input())

def q2(in_num, in_str):
    o_str = ""
    letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    for i in range(len(in_str)):
        o_str += (letters[(letters.index(in_str[i])+int(in_num))%26])
    return o_str

print(q2(input(),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())
moji = str(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"]
lst = list(moji)
for i in range(len(lst)):
  num = alphabet.index(lst[i])
  if i + n > 25:
    lst[i] = alphabet[i+n-26]
  else:
    lst[i] = alphabet[i+n]
ans = ""
for j in range(len(lst)):
  ans += lst[j]
print(ans)

n = int(input())
moji = str(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"]
lst = list(moji)
for i in range(len(lst)):
  num = alphabet.index(lst[i])
  if num + n >= 26:
    lst[i] = alphabet[num+n-26]
  else:
    lst[i] = alphabet[num+n]
ans = ""
for j in range(len(lst)):
  ans += lst[j]
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()
l = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(0,len(s)):
  for j in range (0,26):
    if s[i] == l[j]:
      s[i] = l[(j+n)%26]
      break
print(s)

n = int(input())
s = input()
s = list(s)
l = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(0,len(s)):
  for j in range (0,26):
    if s[i] == l[j]:
      s[i] = l[(j+n)%26]
      break
s = ''.join(s)
print(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().strip()
after = []
for s in S:
  x = ord(s) + N
  if x > ord('Z'):
    x = x - ord('Z')
  after.append(chr(x))
print(''.join(after))


N = int(input())
S = input().strip()
after = []
for s in S:
  x = ord(s) + N
  if x > ord('Z'):
    x = x - ord('Z')
  after.append(chr(x))
print(''.join(x))

N = int(input())
S = input().strip()
after = []
for s in S:
  x = ord(s) + N
  if x > ord('Z'):
    x = x - 26
  after.append(chr(x))
print(''.join(after))


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):
num = int(input())
text = input()
movedText = ""
for i in text:
  if i == "z" or i == "Z":
    movedText += chr(ord(i) - 25 + num)
    continue
  movedText += chr(ord(i) + num)
print(movedText)

num = int(input())
text = input()
movedText = ""
for i in text:
  if i == "z" or i == "Z":
    movedText += chr(ord(i) - 25)
    continue
  movedText += chr(ord(i) + num)
print(movedText)

num = int(input())
text = input()
movedText = ""
for i in text:
  if i == "z":
    movedText += "a"
    continue
  movedText += chr(ord(i) + num)
print(movedText)

num = int(input())
text = input()
movedText = ""
for i in text:
  if ord(i) + num > ord("z") or ord(i) + num > ord("Z"):
    movedText += chr(ord(i) - 26 + num)
    continue
  movedText += chr(ord(i) + num)
print(movedText)

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

for i in S:
    l.append(i)

l = [ord(i) for i in l]     
newl = []
for i in l:
    if i <= 89:
        i -= 24
    else:
        i += 2
    newl.append(i)

newl = [chr(i) for i in newl]
newl = ''.join(newl)

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

for i in S:
    l.append(i)

l = [ord(i) for i in l]     
newl = []
for i in l:
    if i <= 89:
        i -= 24
    else:
        i += 2
    newl.append(i)

newl = [chr(i) for i in newl]
newl = ''.join(newl)
print(newl)

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

for i in S:
    l.append(i)

l = [ord(i) for i in l]     
newl = []
for i in l:
    if i + N >= 91:
        i = i - 26 + N
    else:
        i += N
    newl.append(i)

newl = [chr(i) for i in newl]
newl = ''.join(newl)
print(newl)

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 i in range( len( S )):
	ans += chr( ord("A") + ( ord( S[i] ) - ord("A") + N ) % 26 )
	print(( ord( S[i] ) + N ) % 26)
print(ans)

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

ans = ""
for i in range( len( S )):
	ans += chr( ord("A") + ( ord( S[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()

s_lst=[]
for i in range(len(s)):
    o_s=ord(s[i])+n
    if o_s>=90:
        o_s=o_s-25
    s_lst.append(chr(o_s))
print(''.join(s_lst))

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

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

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):
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']
n = int(input())
s = input()
ans =[]
for i in s:
  num = al.index(i)
  num = (num + n ) % 26 -1
  ans.append(al[num])
print(ans)

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']
n = int(input())
s = input()
ans =[]
for i in s:
  num = al.index(i)
  num = (num + n ) % 26
  ans.append(al[num])
print(ans)

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']
n = int(input())
s = input()
ans =[]
for i in s:
  num = al.index(i)
  num = (num + n ) % 26
  ans.append(al[num])
p=''.join(ans)
print(p)

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):
import sys

input = sys.stdin.readline


def main():

    # print(ord("A"))
    # print(ord("Z"))

    SS =[]
    N =int(input())
    S =input()
    for i in range(len(S)):
        temp = ord(S[i]) + N
        temp = (temp-65) % 26 + 65
        SS.append( chr(temp))

    print("".join(SS))










if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline


def main():

    # print(ord("A"))
    # print(ord("Z"))

    SS =[]
    N =int(input())
    S =input()
    for i in range(len(S)):
        temp = ord(S[i]) + N
        temp = (temp-65) % 26 + 65
        SS.append( chr(temp))



    for i in SS:
        print(i,end="")
	
    print("")







if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline


def main():

    # print(ord("A"))
    # print(ord("Z"))

    SS =[]
    N =int(input())
    S =input()
    for i in range(len(S)):
        temp = ord(S[i]) + N
        temp = (temp-65) % 26 + 65
        SS.append( chr(temp))



    for i in SS:
        print(i,end="")





if __name__ == "__main__":
    main()

#import sys
import numpy as np
#from collections import defaultdict
#import math
#from collections import deque

#input = sys.stdin.readline


def main():
    N = int(input())
    S = input()
    S_new =""
    for i in range(len(S)):
         S_new +=chr((ord(S[i])+N-ord("A"))%26+ord("A"))
    print(S_new)
if __name__ == "__main__":
    main()

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):
n=int(input())
s=input()
hiee=""
ans=""
for i in range(len(s)):
    hiee=ord(s[i])
    if (hiee+n >90):
        print("0")
        hiee-=24
    ans+=chr(hiee+n)
print(ans)


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



n=int(input())
s=input()
hiee=""
ans=""
for i in range(len(s)):
    hiee=ord(s[i])
    if (hiee+n >90):
        hiee-=26
    ans+=chr(hiee+n)
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):
n = int(input())
s = input()
S = []
for i in s:
    S.append(chr((ord(i) - ord('A') + n - 26 + ord('A'))))
print(S,sep='')

n = int(input())
s = input()
S = []
for i in s:
    S.append(chr(((ord(i) - ord('A') + n) % 26 + ord('A'))))
print(*S,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):
N = int(input())
S = input()
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
w = ""
for x in S:
    if abc.index(x) + N > 26:
        w += abc[abc.index(x) + N - 26]
    else:
        w += abc[abc.index(x) + N]
print(w)

N = int(input())
S = input()
abc = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
w = ""
for x in S:
    if abc.index(x) + 1 + N > 26:
        w += abc[abc.index(x) + N - 26]
    else:
        w += abc[abc.index(x) + N]
print(w)

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()
ans =""

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

print(ans)

n = int(input())
s = input()
ans =""
 
for i in s:
  m = (ord(i)-ord("A")+n)%26
  ans += chr(m+ord("A"))
 
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()
ANS=""
for i in range(len(S)):
    ANS+=chr(64+((ord(S[i])+N)-64)%26)
print(ANS)

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

n = int(input())-65
s = input()
ans = ''
for x in s:
    ans += chr((ord(x)+n)%26 + 65)
print(ans

n = int(input())-65
s = input()
ans = ''
for x in s:
    ans += chr((ord(x)+n)%26 + 65)
print(ans)

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()
for o in s:
    print(chr((ord(o)+n-ord('A'))%27+ord('A')),end="")
print()

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

Verdicts: Wrong Answer

Accepted