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):
def rotn(s,n):
    result = []
    for i in s:
        if ("a" <= i <= "m") or ("A" <= i <= "M"):
            result.append(chr(ord(i) + n))
        elif ("n" <= i <= "z") or ("N" <= i <= "Z"):
            result.append(chr(ord(i) - n))
        else:
            result.append(i)
    return "".join(result)

i = int(input())
s = input() 

sa = rotn(s,i)
print(sa)

a, b, x = map(int, input().split())
 
def Calprice(n):
  return a * n + b * len(str(n))
 
min = 0
max = 10 ** 9 + 1
 
while max - min > 1:
  dev = (max + min) // 2
  if Calprice(dev) > x:
    max = dev
  else:
    min = dev

print(min)
    

i = int(input())
s1 = input()
s = list(s1)
ans  = []

for k in range(len(s1)):
    a = ord(s1[k])
    #print(a)
    b = a + i
    #print(b)
    if b > 90:
        b = b - 26
    ans.append(chr(b))

print(''.join(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())
temp = 0
ans = ""
for i in input():
    temp = ord(i)
    if temp + N >= 65 + 26:
        temp = temp - 26
        print(temp)
print(ans)


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


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


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


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

n = int(input())
s = str(input())
c = len(s)
t = ''
for i in range(0,c):
  if (ord(s[i])+n)>90:
    a = ord(s[i])+n-26
  else:
    a = ord(s[i])+n
  t += chr(a)
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):
#import string
n = int(input())
s = input()
a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
print(a)
x = ""
for i in s:
    x += a[a.index(i)+n]
print(x)


#import string
n = int(input())
s = input()
a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
x = ""
for i in s:
    x += a[a.index(i)+n]
print(x)


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 = []

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(len(S)):
    for j in range(len(abc)):
        if S[i] == abc[j]:
            ans.append(abc[j + N])


print("".join(ans))


N = int(input())
S = list(input())
ans = []
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(len(S)):
    for j in range(len(abc)):
        if S[i] == abc[j]:
            if j + N < 26:
                ans.append(abc[j + N])
            else:
                ans.append(abc[j + N -26])


print("".join(ans).upper())


N = int(input())
S = list(input())
ans = []
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(len(S)):
    for j in range(len(abc)):
        if S[i] == abc[j]:
            if j + N < 26:
                ans.append(abc[j + N])
            else:
                ans.append(abc[j + N -26])


print("".join(ans))


N = int(input())
S = list(input())
ans = []
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(len(S)):
    for j in range(len(abc)):
        if S[i] == abc[j].upper():
            if j + N < 26:
                ans.append(abc[j + N])
            else:
                ans.append(abc[j + N -26])


print("".join(ans).upper())


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()
s_len=len(s)
ans=""
for i in range(s_len):
    char=97+(ord(s)+n)%26
    ans+=chr(char)
print(ans)

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

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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
import string

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

letters = string.ascii_uppercase + string.ascii_uppercase
letters = letters[N:N+26]
mapping = {s: letters[idx] for idx, s in enumerate(S)}

ans = "".join(map(lambda s: mapping[s], S))
print(ans, flush=True)

import string

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

letters = string.ascii_uppercase + string.ascii_uppercase
letters = letters[N:N+26]
mapping = {s: letters[idx] for idx, s in enumerate(string.ascii_uppercase)}

ans = "".join(map(lambda s: mapping[s], S))
print(ans, flush=True)

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

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

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):
a=int(input())
c=list(input())
b=list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
for i in range(len(c)):
  if b.index(c[i])+2<=26:
    c[i]=b.index(c[i])+2
  else:
    c[i]=c[27-(b.index(c[i])+2)]
print(c)

a=int(input())
p=list[]
c=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']
b=input()
for i in c:
  if i==b:
    if c[i]>25:
      z=c[i]-25
      p=c[z]
    else:
    
      z=c[c[i]+a]
      p=c[z]
  else:
    pass
print(p)    



N=int(input())
S=list(input())
a=list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
res=''
for s in S:
  code=a[i]+N
  if code>a.index('z'):
    code-=(a.index('z')-1)
  res+=code
print(res)

a=int(input())
c=list(input())
d=''
b=list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
for i in range(len(c)):
  if b.index(c[i])+a<=23+a:
    
    c[i]=b[b.index(c[i])+a]
  else:
    c[i]=b[27-(b.index(c[i])+a)]
for i in range(len(c)):
  d+=c[i]
print(d)


a=int(input())
c=list(input())
b=list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
for i in range(len(c)):
  if b.index(c[i])+a<=26:
    c[i]=b[b.index(c[i])+a]
  else:
    c[i]=b[27-(b.index(c[i])+a)]
print(c)


a=int(input())
c=list(input())
b=list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
for i in range(len(c)):
  if b.index(c[i])+a<=26:
    c[i]=b[b.index(c[i])+a]
  else:
    c[i]=b[27-(b.index(c[i])+a)]
print(c)


a=int(input())
p=list[]
c=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']
b=input()
for i in c:
  if i==b:
    if a+c[i]>25:
      z=a+c[i]-25
      p=c[z]
    else:
    
      z=c[i]+a
      p=c[z]
  else:
    pass
print(p)    


a=int(input())
p=list[]
c=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']
b=input()
for i in c:
  if i==b:
    if c[i]>25:
      z=c[i]-25
      p=c[z]
    else:
    
      z=c[c[i]+a]
      p=c[z]
  else:
    pass
  print(c[p])    


a=int(input())
c=list(input())
d=''
b=list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
for i in range(len(c)):
  if b.index(c[i])+a<=26:
    c[i]=b[b.index(c[i])+a]
  else:
    c[i]=b[27-(b.index(c[i])+a)]
for i in range(len(c)):
  d+=c[i]
print(d)


a=int(input())
p=list[]
c=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']
b=input()
for i in c:
  if i==b:
    if c[i]>25:
      p=c[i]-25
    else:
      p=c[c[i]+a]
  print(c[p])    


N=int(input())
S=list(input())
a=list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
res=''

for s in S:
  code=a.index(s)+N
  if code>a.index('Z'):
    code-=26
  res+=a[code]
print(res)


Verdicts: Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

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):
a = int(input())
b = input()
chr_a = 0
ans = ''
for i in range(len(b)):
    if ord(b[i]) + a <= 90:
        chr_a = ord(b[i]) + a
    else:
        chr_a = ord(b[i]) + a -25
    ans += chr(chr_a)
print(ans)

a = int(input())
b = input()
chr_a = 0
ans = ''
for i in range(len(b)):
    if ord(b[i]) + a <= 90:
        chr_a = ord(b[i]) + a
    else:
        chr_a = ord(b[i]) + a -26
    ans += chr(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):
n=input()

s=input()
s=s.lower()

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"]
length=len(s)
print(length)
export=""
for i in range(length):
    num=list.index(s[i])
    num=(num+int(n))%26
    export+=list[num]
    
export=export.upper()
print(export)


n=input()

s=input()
s=s.lower()

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"]
length=len(s)
export=""
for i in range(length):
    num=list.index(s[i])
    num=(num+int(n))%26
    export+=list[num]
    
export=export.upper()
print(export)



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):
t="ABCDEFGHIJKLMNOPQRSTUVWXYZ"*2
n=int(input())
print(t[t.index(input())+n])

t="ABCDEFGHIJKLMNOPQRSTUVWXYZ"*2
n=int(input())
ans=""
for i in input():
  ans+=t[t.index(i)+n]
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):
from collections import defaultdict, deque
import sys

INF = float('inf')
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


n = I()
s = list(S())
s.sort()
ans = ''
for c in s:
    if ord(c) + n > ord('Z'):
        ans += chr(ord(c) + n - ord('Z') + ord('A'))
    else:
        ans += chr(ord(c) + n)
print(ans)


from collections import defaultdict, deque
import sys

INF = float('inf')
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


n = I()
s = S()
ans = ''
for c in s:
    if ord(c) + n > ord('Z'):
        ans += chr((ord(c) + n) - ord('Z') + ord('A') - 1)
    else:
        ans += chr(ord(c) + n)
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
n=int(input())
s=str(input())
s1=''
alpha='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in s:
  s1+=alpha[ord(i)-66+n]
print(s1)

n=int(input())
s=str(input())
s1=''
alpha='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in s:
  s1+=alpha[ord(i)-65+n]
print(s1)

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())
inp_string = input()
result = ""
for char in inp_string:
  value = ord(char)
  value += n
  print(char,value)
  if value > 90:
    value = 64 + (value - 90)
  print(value,chr(value))
  result += chr(value)
print(result)

n = int(input())
inp_string = input()
result = ""
for char in inp_string:
  value = ord(char)
  value += n
  if value > 90:
    value = 64 + (value - 90)
  result += chr(value)
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):
n = int(input())
s = str(input())
for i in range(n):
    if s[i] == "Z":
        print("A",end="")
    else:
        print(chr(ord(s[i])+1),end="")
print()

n = int(input())
s = str(input())
for i in range(len(s)):
    r = ord(s[i])+n
    if 90 < r:
        print(chr(r-26),end="")
    else:
        print(chr(r),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())
ls = list(map(str,input()))
r = len(ls)
print(ls)
for i in range(r):
    if ord(ls[i]) + n <= 90:
        ls[i] = chr(ord(ls[i]) + n)
    else:
        ls[i] = chr((ord(ls[i]) + n)%90+64)
a = "".join(ls)
print(a)



n = int(input())
ls = list(map(str,input()))
r = len(ls)
for i in range(r):
    if ord(ls[i]) + n <= 90:
        ls[i] = chr(ord(ls[i]) + n)
    else:
        ls[i] = chr((ord(ls[i]) + n)%90+64)
a = "".join(ls)
print(a)



Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
N = int(input())
S = input()
li = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
sli = list(S)
for i in range(len(sli)):
  for j in range(26):
    if li[j] == sli[i]:
      sli[i] == li[j+N]
print("".join(sli))

S = input()
N = input()
li = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
sli = list(S)
for i in range(len(sli)):
  for j in range(26):
    if li[j] == sli[i]:
      sli[i] == li[j+N]
print("".join(sli))

S = input()
N = input()
li = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
sli = list(S)
for i in range(len(sli)):
  for j in range(26):
    if li[j] == sli[i]:
      sli[i] == li[j+N]
      break
print("".join(sli))

S = input()
N = int(input())
li = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
sli = list(S)
for i in range(len(sli)):
  for j in range(26):
    if li[j] == sli[i]:
      sli[i] == li[j+N]
print("".join(sli))

S = input()
N = input()
li = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
sli = list(S)
for i in range(len(sli)):
  for j in range(26):
    if li[j] == sli[i]:
      sli[i] == li[j+2]
print("".join(sli)
  

S = input()
N = input()
li = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
sli = list(S)
for i in range(len(sli)):
  for j in range(26):
    if li[j] == sli[i]:
      sli[i] == li[j+2]
print("".join(sli))

N = int(input())
S = input()
li = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
sli = list(S)
for i in range(len(sli)):
  for j in range(26):
    if li[j] == sli[i]:
      sli[i] = li[j+N]
      break
print("".join(sli))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
N = int(input())
S = input()

out = ""
for i in range(len(S)):
    s = (i + N) % len(S)
    out = out + S[s]

print(out)

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

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


N = int(readline())
S = [int(x) - ord("A") for x in read().rstrip]
N = int(readline())

S = [(x + N) % 26 for x in S]

anser = "".join([chr(x + ord("A")) for x in S])

print(anser)


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

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


N = int(readline())
S = [int(x) - ord("A") for x in read().rstrip]
N = int(readline())

S = [(x + N) % 26 for x in S]

anser = "".join(chr(x + ord("A")) for x in S)

print(anser)


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

out = ""
for i in S:
    tmp = (ord(i) + N) % 91
    if tmp < 65:
        tmp = tmp + 65
    out = out + chr(tmp)

print(out)


Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
N=int(input())
S=str(input())
letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(len(S)):
  S[i] = (letters.index(S[i])+N)%26
print(S)

N=int(input())
S=str(input())
letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = ""
for i in range(len(S)):
  ans = ans + letters[(letters.index(S[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):
# 2019-11-24 20:59:47(JST)
import sys
from string import ascii_uppercase as alphabet

# alpha_num = dict((alpha, num) for num, alpha in enumerate(alphabet, 0))
alpha_ind = dict((alphabet[i], i) for i in range(26))

def main():
    n, s = sys.stdin.read().split()
    n = int(n)

    t = ''
    for char in s:
        t += alphabet[(alpha_num[char] + n) % 26]
    
    print(t)

if __name__ == '__main__':
    main()


# 2019-11-24 20:59:47(JST)
import sys
from string import ascii_uppercase as alphabet

# alpha_num = dict((alpha, num) for num, alpha in enumerate(alphabet, 0))
alpha_ind = dict((alphabet[i], i) for i in range(26))

def main():
    n, s = sys.stdin.read().split()
    n = int(n)

    t = ''
    for char in s:
        t += alphabet[(alpha_ind[char] + n) % 26]
    
    print(t)

if __name__ == '__main__':
    main()


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()
leng=len(s)
slist=[s]
#print(slist)
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", "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,leng):
    for j in range(0,26):
#        print(s[i])

        if s[i]==alphabet[j]:
            slist[i]=alphabet[j+n]
#            print(slist[i])

print(slist)

n=int(input())
s=input()
leng=len(s)
slist=[]
#print(slist)
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", "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,leng):
    for j in range(0,26):
#        print(s[i])

        if s[i]==alphabet[j]:
            #print(j)
            slist.append(alphabet[j+n])
            
            #print(slist[i])

print(slist)


n=int(input())
s=input()
leng=len(s)
slist=[s]
#print(slist)
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", "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,leng):
    for j in range(0,26):
        print(s[i])

        if s[i]==alphabet[j]:
            slist[i]=alphabet[j+n]
#            print(slist[i])

print(slist)

n=int(input())
s=input()
leng=len(s)
slist=[]
#print(slist)
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", "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,leng):
    for j in range(0,26):
#        print(s[i])

        if s[i]==alphabet[j]:
            #print(j)
            slist.append(alphabet[j+n])
            
            #print(slist[i])

print(''.join(slist))


Verdicts: Runtime Error

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):
_,l=int(input()),input();print("".join(l[_:]+l[:_]))

_,l,a=int(input()),input(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
print(l.translate(str.maketrans(a,"".join(a[_:]+a[:_]))))

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
N = input()
S = input()
out = ""
for i in S:
  num = ord(i)
  num = num + N
  print(num)
  out.append(chr(num))

print(out)
  

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

## empty list ##
out = []

for i in S:
  ## make code num ##
  num = ord(i)
  num = num + N
  if num > 90:
    num = num - 26
  ## make list ##
  out.append(chr(num))

## output ##
out = "".join(out)
print(out)
  

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 MOJI in S:
  i = ord(MOJI) + N
  if i > 90:
    i = i - 26
  ANS.append(chr(i))

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

ANS = ""

for MOJI in S:
  i = ord(MOJI) + N
  if i > 90:
    i = i - 26
  ANS = ANS + chr(i)

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

alph = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for a in s:
    s1.append(alph[alph.index(a) + n])

print("".join(s1))

n = int(input())
s = input()
s1 = []

alph = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for a in s:
    s1.append(alph[(alph.index(a) + n)%26])

print("".join(s1))

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):
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
m = int(input())
list = str(input())
n = len(list)
for i in range(n):
	if alpha.index(list[i]) + m < 26:
		list[i] = alpha[alpha.index(list[i]) + m]
	else:
		list[i] = alpha[alpha.index(list[i]) + m -26] 
print(list)

alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
m = int(input())
list = str(input())
n = len(list)
for i in range(n):
	if int(alpha.index(list[i])) + m < 26:
		list[i] = alpha[int(alpha.index(list[i])) + m]
	else:
		list[i] = alpha[int(alpha.index(list[i])) + m -26] 
print(list)

alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
m = int(input())
list = input()
newlist = []
n = len(list)
for i in range(n):
	if int(alpha.find(list[i])) + m < 26:
		newlist.append(alpha[int(alpha.find(list[i])) + m])
	else:
		newlist.append(alpha[int(alpha.find(list[i])) + m -26]) 
moji = ''.join(newlist)
print(moji)

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):
if __name__ == '__main__':
    N = int(input())
    S = input()
    al=[chr(ord('A') + i) for i in range(26)]
    ans = ''
    for s in S:
        ans += al[(N+S.index(s))%26]
    print(ans)

if __name__ == '__main__':
    N = int(input())
    S = input()
    al=[chr(ord('A') + i) for i in range(26)]
    ans = ''
    for s in S:
        ans += al[(N+al.index(s))%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()

t=str()

for i in s:
    x = chr(ord(i) + n)
    
    if ord(t) > ord('Z'):
        x = chr(ord(x) - ord('Z') + ord('A')-1)
    
    ss += x

print(t)


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

ss=str()

for i in s:
    t = chr(ord(i) + n)
    
    if ord(t) > ord('Z'):
        t = chr(ord(t) - ord('Z') + ord('A')-1)
    
    ss += t

print(ss)


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

def push(chara, dig):
  if ord(chara) + dig > 90: return chr(64 + dig + ord(chara) -90)
  else: return chr(dig + ord(chara))
  
string = input()

for i in range(0, len(string)):
  string[i] = push(string[i], n)
  
print(string)

n = int(input())

def push(chara, dig):
  if ord(chara) + dig > 90: return chr(64 + dig + ord(chara) -90)
  else: return chr(dig + ord(chara))
  
string = input()
e = ""
for i in range(0, len(string)):
  e = e + push(string[i], n)
  
print(e)


Verdicts: Runtime Error

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
n = int(input())
s = list(input())

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

for c in s:
    if alp.index(c) + n > 25:
        ans.append(alp[alp.index(c)+n-26])
    else:
        ans.append(alp[alp.index(c) + n])

print(ans)

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

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

for c in s:
    if alp.index(c) + n > 25:
        ans += alp[alp.index(c)+n-26]
    else:
        ans += alp[alp.index(c) + n]

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
ALPHABETS = ["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 = input()
S = input()
converted = map(lambda x: ALPHABETS[x.index() + N], S.split())
print(converted)

ALPHABETS = ["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"]
size = len(ALPHABETS)
N = input()
S = input()
converted = map(lambda x: ALPHABETS[(ALPHABETS.index(x) + int(N)) % size], list(S))
print(''.join(converted))

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())
ss = input()
s = []
for i in ss:
    s.append(i)
res = ""
n = n % 24
print(n)
for i in s:
    print(i)
    if ord(i)+n >= 90:
        res+=chr(ord(i)-26+n)
    else:
        res += chr(ord(i)+n)
    print(res)
        
print(res)


n = int(input())
ss = input()
s = []
for i in ss:
    s.append(i)
res = ""
n = n % 26
#print(n)
for i in s:
    #print(i)
    if ord(i)+n > 90:
        res+=chr(ord(i)-26+n)
    else:
        res += chr(ord(i)+n)
    #print(res)
        
print(res)


Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
n = int(input())
s = list(str(input()))

for i in range(len(s)):
    tmp = ord(s[i]) + n
    if tmp > ord('Z')
        s[i] = chr(tmp - ord('Z'))
    else:
        s[i] = chr(tmp)

ans = ''
for i in range(len(s)):
    ans += s[i]

print(ans)

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

for i in range(len(s)):
    tmp = ord(s[i]) + n
    if tmp > ord('Z'):
        s[i] = chr(tmp - ord('Z'))
    else:
        s[i] = chr(tmp)

ans = ''
for i in range(len(s)):
    ans += s[i]

print(ans)

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

for i in range(len(s)):
    tmp = ord(s[i]) + n
    if tmp > ord('Z'):
        tmp -= ord('Z') - ord('A') + 1
    s[i] = chr(tmp)

ans = ''
for i in range(len(s)):
    ans += s[i]

print(ans)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
n = int(input())
s = input()
S = ''
list = [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z]*2

for i in range(len(s)):
  S += list[list.index('i') + n]
  
print(S)


n = int(input())
s = input()
st = ''
t = 0 

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

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):
word = {'A':0,'B':1,'C':2,'D':3,'E':4,'F':5,'G':6,'H':7,'I':8,'J':9,'K':10,'L':11,'M':12,'N':13,'O':14,'P':15,'Q':16,'R':17,'S':18,'T':19,'U':20,'V':21,'W':22,'X':23,'Y':24,'Z':25}
word_reverse={v: k for k, v in word.items()}
x=input()
y=input()
Ans=''
for i in x:
  Ans=Ans+word_reverse[word[i]+int(y)]

print(Ans)

word = {'A':0,'B':1,'C':2,'D':3,'E':4,'F':5,'G':6,'H':7,'I':8,'J':9,'K':10,'L':11,'M':12,'N':13,'O':14,'P':15,'Q':16,'R':17,'S':18,'T':19,'U':20,'V':21,'W':22,'X':23,'Y':24,'Z':25}
word_reverse={v: k for k, v in word.items()}
x=input()
y=input()
Ans=''
for i in y:
  if word[i]+int(x) > 25:
    z = (word[i]+int(x)) % 26
  else:z=word[i]+int(x)
  Ans=Ans+word_reverse[z]

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

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


n = int(input())
s = input()
lst_search = [chr(i) for i in range(65, 65+26)]
lst = [chr(i) for i in range(65, 65+26)] *2


ans = ''
for i in s:
    idx = lst_search.index(i)
    ans += lst[idx+n]

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: We have a string S consisting of uppercase English letters. Additionally, an integer N will be given.  Shift each character of S by N in alphabetical order (see below), and print the resulting string.  We assume that `A` follows `Z`. For example, shifting `A` by 2 results in `C` (`A` \to `B` \to `C`), and shifting `Y` by 3 results in `B` (`Y` \to `Z` \to `A` \to `B`).

Submission attempts (in order):
n=int(input())
s=list(input())
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}
di={1:"A",2:"B",3:"C",4:"D",5:"E",6:"F",7:"G",8:"H",9:"I",10:"J",11:"K",12:"L",13:"M",14:"N",15:"O",16:"P",17:"Q",18:"R",19:"S",20:"T",21:"U",22:"V",23:"W",24:"X",25:"Y",26:"Z"}
li=[]
t=len(s)
for i in range(0,t):
  k=s[i]
  m=dic[k]
  a=(m+n)%26
  b=di[a]
  li.append(b)
print("".join(li))

n=int(input())
s=list(input())
dic={"A":0,"B":1,"C":2,"D":3,"E":4,"F":5,"G":6,"H":7,"I":8,"J":9,"K":10,"L":11,"M":12,"N":13,"O":14,"P":15,"Q":16,"R":17,"S":18,"T":19,"U":20,"V":21,"W":22,"X":23,"Y":24,"Z":25}
di={1:"A",2:"B",3:"C",4:"D",5:"E",6:"F",7:"G",8:"H",9:"I",10:"J",11:"K",12:"L",13:"M",14:"N",15:"O",16:"P",17:"Q",18:"R",19:"S",20:"T",21:"U",22:"V",23:"W",24:"X",25:"Y",26:"Z"}
li=[]
t=len(s)
for i in range(0,t):
  k=s[i]
  m=dic[k]
  a=(m+n)%26+1
  b=di[a]
  li.append(b)
print("".join(li))

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

plain = ''

for i in list(s):
    ASCII = ord(i)
    num = ASCII - 97
    num = (num - n) % 26
    ASCII = num + 97
    plain += chr(ASCII)

print(plain)

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

low = s.lower()
plain = ''

for i in list(low):
    ASCII = ord(i)
    num = ASCII - 97
    num = (num - n) % 26
    ASCII = num + 97
    plain += chr(ASCII)

print(plain.upper())

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

low = s.lower()
plain = ''

for i in list(low):
    ASCII = ord(i)
    num = ASCII - 97
    num = (num + n) % 26
    ASCII = num + 97
    plain += chr(ASCII)

print(plain.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()
so = ''
for i in range(len(s)):
    ni = ord(s[i]) + n
    if ni > 122:
        ni -= 26
    so += chr(ni)
print(so)

n = int(input())
s = input()
so = ''
for i in range(len(s)):
    ni = ord(s[i]) + n
    if ni > ord('Z'):
        ni -= 26
    so += chr(ni)
print(so)

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()
alphabet = [chr(ord('A') + i) for i in range(26)]
ans = ''

for i in s:
    for j in range(26):
        if i == alphabet[j]:
            ans += alphabet[(j + 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()


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

ans = []
for character in S:
  try:
    num = alpha2num(character)
    new_num = (num + N) % 26
    new_chr = num2alpha(new_num)
    ans.append(new_chr)
  except:
    break

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

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


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

ans = []
for character in S:
  try:
    num = alpha2num(character)
    new_num = (num + N) % 26
    if new_num == 0:
      new_num = 26
    new_chr = num2alpha(new_num)
    ans.append(new_chr)
  except:
    break

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):
def shiftText(plain_text, key):
    plain_text.lower
    encoded_text = ""
    for i in plain_text:
        char = ord(i)+key
        if (char > 122):
            char -= 26
            encoded_text += chr(char)
        else:
            encoded_text += chr(char)
    return encoded_text


key = int(input())
plain_text = input()

print(shiftText(plain_text, key))


def shiftText(plain_text, key):
    plain_text.lower
    encoded_text = ""
    for i in plain_text:
        char = ord(i)+key
        if (char > 90):
            char -= 26
            encoded_text += chr(char)
        else:
            encoded_text += chr(char)
    return encoded_text


key = int(input())
plain_text = input()

print(shiftText(plain_text, key))


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 = input()
for c in s:
  print(string.ascii_uppercase[(ord(c)-ord('A')+n)%26)], end='')
print()

globals()['n'] = int(input());print(''.join(chr((ord(c)-ord('A')+n)%26+ord('A')) for c in input()))


Verdicts: Runtime Error

Accepted