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

Submission attempts (in order):
n = int(input())
s = input()
for i in range(len(s)):
  c = (ord(s[i]) + n - ord('A')) % 26
  c += ord('A')
  s[i] = chr(c)
 print(s)

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

for i in s:
    if ord(i)+N > 90:
        list.append(chr(ord(i)+N-26))
    else:
        list.append(chr(ord(i)+N))
        
ans = "".join(list)
print(ans)

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

for i in s:
    if ord(i)+n > 90:
        list.append(chr(ord(i)+n-26))
    else:
        list.append(chr(ord(i)+n))
        
ans = "".join(list)
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()
a = ''
for i in s:
  n = (ord(i) + n) // 90 + 65
  a += chr(n)
print(a)

s = input()
a = ''
for i in s:
  n = (ord(i) + 2) // 90 + 65
  a += chr(n)
print(a)

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

Verdicts: Wrong Answer

Wrong Answer

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

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

str = list(input())

out = []

for st in str:
    num = ord(st) + N
    if num >= 91:
        num = num - 26
    out.append(chr(num))

print(out)


N = int(input())

str = list(input())

out = []

for st in str:
    num = ord(st) + N
    if num >= 91:
        num = num - 26
    out.append(chr(num))

print("".join(out))


Verdicts: Wrong Answer

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

Submission attempts (in order):
N=int(input())
S=input()
L='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans=''
for i in range(len(S)):
  a=S[i]
  index=L.find(a)
  b=L[index+N]
  ans=ans+b
prin(ans)

N=int(input())
S=input()
L='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans=''
for i in range(len(S)):
  a=S[i]
  index=L.find(a)
  b=L[index+N]
  ans=ans+b
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()
alps = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
number = 0
ans = str()

for i in range(len(s)):
  alp = s[i]
  for j in range(26):
    if alps[j] == alp:
      number = (j + n) % 26
      ans += alps[number]


n = int(input())
s = input()
alps = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
number = 0
ans = str()

for i in range(n):
  alp = s[i]
  for j in range(26):
    if alps[j] == alp:
      number = (j + n) % 26
      ans += alps[number]

print(ans)

n = int(input())
s = input()
alps = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
number = 0
ans = str()

for i in range(len(s)):
  alp = s[i]
  for j in range(26):
    if alps[j] == alp:
      number = (j + n) % 26
      ans += alps[number]
      
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 = input()
S = input()
t = []
for i in S:
    t.append(chr(ord(i) + N))
print(t.join)

N = input()
S = input()
t = []
for i in S:
    if ord(i) + N >= 91:
        t.append(chr(ord(i) + N - 26))
    else:
        t.append(chr(ord(i) + N))
print(''.join(t))

N = input()
S = input()
t = []
for i in S:
    if ord(i) + N >= 91:
        t.append(chr(ord(i) + N - 26))
    else:
        t.append(chr(ord(i) + N))
print(t)

N = input()
S = input()
t = []
for i in S:
    if ord(i) + N >= 91:
        t.append(chr(ord(i) + N - 26))
    else:
        t.append(chr(ord(i) + N))
print(''.join(t))

N = int(input())
S = input()
t = []
for i in S:
    if ord(i) + N >= 91:
        t.append(chr(ord(i) + N - 26))
    else:
        t.append(chr(ord(i) + N))
print(''.join(t))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
import string
N=int(input())
S=list(str(input()))

Alphabet_List=list(string.ascii_uppercase)
Alphabet_List.extend(2*Alphabet_List)

for i in range(len(S)):
    for j in range(len(Alphabet_List)):
        if S[i]==Alphabet_List[j]:
            S[i]=Alphabet_List[j+13]
            break
            
print(("").join(S))

import string
N=int(input())
S=list(str(input()))

Alphabet_List=list(string.ascii_uppercase)
Alphabet_List.extend(2*Alphabet_List)

for i in range(len(S)):
    for j in range(len(Alphabet_List)):
        if S[i]==Alphabet_List[j]:
            S[i]=Alphabet_List[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):
import sys
input = sys.stdin.readline

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

for i in range(len(s)-1):
  print(chr(ord(s[i])+n),end="")

import sys
input = sys.stdin.readline

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

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

print("")

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=list(input())
for i in s:
  ord_= ord("A")
  t_ord = (ord_ +n) % 26
  i = chr(t_ord)
print(''.join(s))

n=int(input())
s=list(input())
l=len(s)
ans=""
a=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
for i in s:
    idx=a.index(i)
    t_idx=(idx+n) % 26
    ans += a[t_idx]
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()
L = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
A = ''
for i in S:
  N = L.index(i)
  if N == 25:
    N = 0
  else:
    N += 1
  A += L[N]
print(A)

N = int(input())
S = input()
L = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
A = ''
for i in S:
  X = L.index(i) + N
  while X >= 26:
    X -= 26
  A += L[X]
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()

for s in S:
    print(chr(ord('A') + ((ord(s) - ord('A') + N)) % 26 ))



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

result = ''
for s in S:
    result += chr(ord('A') + ((ord(s) - ord('A') + N)) % 26 )

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

num = input()
s = input()
res = ""
for x in s:
    loc = ord(x) + num
    res += chr(loc - 26 if loc > 90 else loc)
print(res)

num = int(input())
s = input()
res = ""
for x in s:
    loc = ord(x) + num
    res += chr(loc - 26 if loc > 90 else loc)
print(res)

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

def shifter(n, char):
    if (char == 'Z'):
        n = n - 26
    
    return chr(ord(char) + n)

shifted_s = ''.join([shifter(n, char) for char in list(s)])

print(shifted_s)

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

def shifter(n, char):
    if (char == 'Z'):
        n = n - 26
    
    return chr(ord(char) + n)

shifted_s = ''.join([shifter(n, char) for char in list(s)])

print(shifted_s)

alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' #use a string like this, instead of ord()
N = int(input().strip())
def shifttext(shift):
    S = str(input('').upper()) #Input text here
    data = []
    for i in S: #iterate over the text not some list
        if i.strip() and i in alphabet: # if the char is not a space ""
            data.append(alphabet[(alphabet.index(i) + shift) % 26])
        else:
            data.append(i) #if space the simply append it to data
    output = ''.join(data)
    return output
print(shifttext(N))

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()
a = []
s_list = list(s)
for i in range(len(s)):
    if i + 1 < len(s) - n: 
        w = s_list[i + n]
    else:
        w = s_list[i + n - len(s)]
    a.append(w)
print("".join(a))

a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S = input()
l = [] 
for i in S:
    b = a.index(i) + N
    if b <= 25:
        w = a[b]
    else:
        w = a[b-26]
    l.append(w)
print("".join(l))

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):
input_number = int(input())
input_str = input()
abc_list = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
abc_list = abc_list + abc_list
for i in len(input_str):
    output_str += abc_list[abc_list.index(input_str[i]) + input_number]

input_number = int(input())
input_str = input()
abc_list = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
abc_list = abc_list + abc_list
for i in len(input_str):
    output_str += abc_list[abc_list.index(input_str[i]) + input_number]
print(output_str)

input_number = int(input())
input_str = input()
abc_list = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
abc_list = abc_list + abc_list
output_str = ""
for i in range(len(input_str)):
    output_str += abc_list[abc_list.index(input_str[i]) + input_number]
print(output_str)

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

upper = [chr(i) for i in range(65, 65+26)]
new_upper = []

for i in S:
    Index = upper.index(i) + N
    if Index >= 26:
        Index =- 26
        new_upper.append(upper[Index])
    else:
        new_upper.append(upper[Index])
        
print(''.join(new_upper))

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

upper = [chr(i) for i in range(65, 65+26)]
new_upper = []

for i in S:
    Index = upper.index(i) + N
    if Index >= 26:
        Index -= 26
        new_upper.append(upper[Index])
    else:
        new_upper.append(upper[Index])
        
print(''.join(new_upper))

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())
def rot(s, num):
    ans = []
    for i in range(len(s)):
        temp = ord(s[i])
        if 65 <= temp + num < 90:
            ans.append(chr(temp + num))
        else:
            ans.append(chr(65 + (temp + num) - 91))
    temp_ans = "".join(ans)
    return temp_ans
print(rot(s = S, num = N))

N = int(input())
S = str(input())
def rot(s, num):
    ans = []
    for i in range(len(s)):
        temp = ord(s[i])
        if 65 <= temp + num <= 90:
            ans.append(chr(temp + num))
        else:
            ans.append(chr(65 + (temp + num) - 91))
    temp_ans = "".join(ans)
    return temp_ans
print(rot(s = S, num = N))

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

front = S[0:N]
back = S[N:]
print(back+front)

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

N = N%26
S_new = []
for s in S:
    s_new = chr((ord(s)-ord('A')+N)%26+ord('A'))
    S_new.append(s_new)

result = ''.join(S_new)
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):
import codecs

n = input()
s = input()

codecs.decode(s,'rot'+ n)

n = int(input())
s = list(input())
l = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
a = []

for i in s:
  t = l.index(i)+n
  if t < 26:
    a.append(l[t])
  else:
    a.append(l[t-26])

print("".join(a))


Verdicts: Runtime Error

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

Submission attempts (in order):
N = input()
S= input()
hoge=[]
Alphas='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
 
for a in S:
  for i, Alpha in enumerate(Alphas):
    if Alpha == a:
      hoge.append(Alphas[(i+N)%26])
      break
mojiretsu=''
for x in hoge:
    mojiretsu += x
print(mojiretsu)

N=input()
S=input()
hoge=[]
Alphas='ABCDEFGHIJKLMNOPQRSTUVWXYZ'

for a in S:
  for i, Alpha in enumerate(Alphas):
    if Alpha == a:
      hoge.append(Alphas[(i+N)%26])
      break
print(hoge)      

N = int(input())
S = input()
hoge=[]
Alphas='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
 
for a in S:
  for i, Alpha in enumerate(Alphas):
    if Alpha == a:
      hoge.append(Alphas[(i+N)%26])
      break
mojiretsu=''
for x in hoge:
    mojiretsu += x
print(mojiretsu)

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):
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
n = int(input())
print(alphabet[(alphabet.index(input())+n)%26])

alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
n = int(input())
s = input()
for x in s:
  print(alphabet[(alphabet.index(x)+n)%26], 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):
a=int(input())
alp=input()
x=""
for i in range(len(alp)):
    f=(a+ord(alp[i])-96)%26+96
    x+=chr(f)
print(x)



a=int(input())
alp=input()
x=""
for i in range(len(alp)):
    f=a+ord(alp[i])
    x+=chr(f)
print(x)


a=int(input())
alp=input()
x=""
for i in range(len(alp)):
    f=(a+ord(alp[i])-64)%26+64
    x+=chr(f)
print(x)



a=int(input())
alp=input()
x=""
for i in range(len(alp)):
    f=(a+ord(alp[i])-65)%26+65
    x+=chr(f)
print(x)


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


s = list(S)
s_new =[]
for i in range(len(S)):
    if ord(s[i])+N<=91:
        s[i] = chr(ord(s[i])+N)
        s_new.append(s[i])
    else:
        s[i] = chr(ord(s[i])+N-26)
        s_new.append(s[i])
print(''.join(s_new))


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

s = list(S)
s_new =[]
for i in range(len(S)):
    s[i] = chr(ord(s[i])+N)
    s_new.append(s[i])
print(''.join(s_new))


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

s = list(S)
s_new =[]
for i in range(len(S)):
    if i+N<26:
        s[i] = chr(ord(s[i])+N)
        s_new.append(s[i])
    else:
        s[i] = chr(ord(s[i])+N-26)
        s_new.append(s[i])
print(''.join(s_new))


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


s = list(S)
s_new =[]
for i in range(len(S)):
    if ord(s[i])+N<91:
        s[i] = chr(ord(s[i])+N)
        s_new.append(s[i])
    else:
        s[i] = chr(ord(s[i])+N-26)
        s_new.append(s[i])
print(''.join(s_new))


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()
ans = ""
for i in s:
  t = ord(i)
  if t >= 90 - n:
    t = 65 + t - (90 - n)
  else:
    t += n
  ans += chr(t)
print(ans)

n = int(input())
s = input()
ans = ""
for i in s:
  t = ord(i) + n
  if t > 90:
    t -= 26
  ans += chr(t)
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=[]
for i in range(len(s)):
  num=ord(s[i])+n
  if num>122:
    num-=26
  t.append(chr(num))

print("".join(t))

n=int(input())
s=input()
 
t=[]
for i in range(len(s)):
  num=ord(s[i])+n
  if num>90:
    num-=26
  t.append(chr(num))

print("".join(t))

Verdicts: Wrong Answer

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

Submission attempts (in order):
a = input().split()

N = int(a[0])
S = a[1]

alpha_dict = {chr(c): i+1 for i, c in enumerate(range(ord('A'), ord('Z')+1))}

st =""
o = []
for c in S:
    # print(c)
    n = alpha_dict[c]
    n = n + 2
    if (n > 26):
        n = n - 26
    # print(n)
    keys = [k for k, v in alpha_dict.items() if v == n]
    st += str(keys[0])
    #o.append(keys)
    # print(alpha_dict[n])


print(st)

a = input().split()

N = int(a[0])
S = a[1]

alpha_dict = {chr(c): i+1 for i, c in enumerate(range(ord('A'), ord('Z')+1))}

st =""
o = []
for c in S:
    # print(c)
    n = alpha_dict[c]
    n = n + N
    if (n > 26):
        n = n - 26
    # print(n)
    keys = [k for k, v in alpha_dict.items() if v == n]
    st += str(keys[0])
    #o.append(keys)
    # print(alpha_dict[n])


print(st)

a = input().splitlines()

N = int(a[0])
S = a[1]

alpha_dict = {chr(c): i+1 for i, c in enumerate(range(ord('A'), ord('Z')+1))}

st =""

for c in S:
    n = alpha_dict[c]
    n = n + N
    if (n > 26):
        n = n - 26
    keys = [k for k, v in alpha_dict.items() if v == n]
    st += str(keys[0])
    
print(st)

a = input()
b = input()

N = int(a)
S = b

alpha_dict = {chr(c): i+1 for i, c in enumerate(range(ord('A'), ord('Z')+1))}

st =""

for c in S:
    n = alpha_dict[c]
    n = n + N
    if (n > 26):
        n = n - 26
    keys = [k for k, v in alpha_dict.items() if v == n]
    st += str(keys[0])
    
print(st)

Verdicts: Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
n=int(input())
s=input()
l=s.lower()
print(l)
ans=""
for i in list(l):
  asd=ord(i)
  num=asd-97
  num=(num+n)%26
  asd=num+97
  ans+=chr(asd)
print(ans.upper())


n=int(input())
s=input()
l=s.lower()
ans=""
for i in list(l):
  asd=ord(i)
  num=asd-97
  num=(num+n)%26
  asd=num+97
  ans+=chr(asd)
print(ans.upper())

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

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: 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)):
  val=ord(s[i])
  val-=65
  val=(val+n)%26
  val+=65
  s[i]=chr(val)
print(s)

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

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


Verdicts: Runtime Error

Runtime Error

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

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

def forward(s, n):
  A_id = ord('A')
  num_AtoZ = ord('Z') - ord('A') + 1
  return chr(A_id + (ord(s) + n) % (A_id + num_AtoZ))

print(''.join([forward(s, n) for s in S]))


n=int(input())
S=input()

def forward(s, n):
  A_id = ord('A')
  num_AtoZ = ord('Z') - ord('A') + 1
  return chr(A_id + (ord(s) - A_id + n) % (num_AtoZ))

print(''.join([forward(s, n) for s in 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())
str = [input() for i in range(1)]
STRING=str[0]
enc = ""

for i in list(STRING):
    ASCII = ord(i)
    num = ASCII - 65
    num = (num + N % 26)
    ASCII = num + 65
    if ASCII > 91:
        ASCII -= 26
    enc += chr(ASCII)
print(enc)

N = int(input())
str = [input() for i in range(1)]
STRING=str[0]
enc = ""

for i in list(STRING):
    ASCII = ord(i)
    num = ASCII - 65
    num = (num + N % 26)
    ASCII = num + 65
    enc += chr(ASCII)
print(enc)

N = int(input())
str = [input() for i in range(1)]
STRING=str[0]
enc = ""

for i in list(STRING):
    ASCII = ord(i)
    num = ASCII - 65
    num = (num + N % 26)
    ASCII = num + 65
    if ASCII > 90:
        ASCII -= 26
    enc += chr(ASCII)
print(enc)

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 ss in s:
  if ord(ss)+n<=ord('z'):
    ss=chr(ord(ss)+n)
  else:
    ss=chr(ord(ss)+n-26)
  ans+=ss
print(ans)

n=int(input())
s=input()
ans=''
for ss in s:
  if ord(ss)+n<=ord('Z'):
    ss=chr(ord(ss)+n)
  else:
    ss=chr(ord(ss)+n-26)
  ans+=ss
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()
list_S = list(S)
list_ans = []

alphabet_number = {'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}

number_alphabet = {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'}

for i in range(len(list_S)):
    A = alphabet_number[list_S[i]]
    if A + N <= 26:
        B = A + N
    else:
        B = (A+N) - 26
        
    C = number_alphabet[B]
    list_ans.append(C)

print(''.join(list_ans))

N = int(input())
S = input()
list_S = list(S)
list_ans = []

alphabet_number = {'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}

number_alphabet = {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'}

for i in range(len(list_S)):
    A = alphabet_number[list_S[i]]
    if A + N <= 26:
        B = A + N
    else:
        B = (A+N) - 26
        
    C = number_alphabet[B]
    list_ans.append(C)

print(''.join(list_ans))


N = int(input())
S = input()
list_S = list(S)
list_ans = []

alphabet_number = {'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}

number_alphabet = {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'}

for i in range(len(list_S)):
    A = alphabet_number[list_S[i]]
    
    if A + N <= 26:
        B = A + N
    else:
        B = (A+N) - 26
        
    C = number_alphabet[B]
    list_ans.append(C)

print(''.join(list_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()
A=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','t','u','v','w','x','y','z']
A=[i.upper() for i in A]
print(A)
S=list(S)
for i, a in enumerate(S):
    S[i]=A.index(a)+N
    if S[i]>26:
        S[i]=S[i]-26
    S[i]=A[S[i]]

print("".join(S))

N=int(input())
S=input()
A=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','t','u','v','w','x','y','z']
A=[i.upper() for i in A]
print(A)
S=list(S)
for i, a in enumerate(S):
    S[i]=A.index(a)+N
    S[i]=A[S[i]]

print("".join(S))

N=int(input())
S=input()
A=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
A=[i.upper() for i in A]
##print(A)
S=list(S)
for i, a in enumerate(S):
    S[i]=A.index(a)+N
    if S[i]>25:
        S[i]=S[i]-26
    S[i]=A[S[i]]

print("".join(S))

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
N = int(input())
S = input()
alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
s = [i for i in S]


for i in range(len(S)):
  index = alp.index(S[i])
  ans_index = (index + N + 1) % 26
  s[i] = alp[ans_index]

ans = ""
for i in s:
  ans += i
print(ans)
  

N = int(input())
S = input()
alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
s = [i for i in S]

for i in range(len(S)):
  index = alp.index(S[i])
  ans_index = (index + N + 1) % 26
  s[i] = alp[ans_index - 1]

ans = ""
for i in s:
  ans += i
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()
alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans=''
for i in range(len(S)):
    ans=ans+alphabet[(alphabet.find(S[i])+N)%26]

N=int(input())
S=input()
alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans=''
for i in range(len(S)):
    ans=ans+alphabet[(alphabet.find(S[i])+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=str(input())

result=""

for i in s:
    result += chr(ord(i)+n)

print(result)

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

result=""

for i in s:
    result += chr(ord(i)+n%26)

print(result)

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

result=""

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

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):
D = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
n = int(input())
S = list(input())

for i in range(len(S)):
    S[i] = D[(D.index(S[i]) + 1) % 26]

print("".join(S))

# B - ROT N

D = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
n = int(input())
S = list(input())

for i in range(len(S)):
    S[i] = D[(D.index(S[i]) + n) % 26]

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())
i_s = input()
out = ''
for s in i_s:
       s = ord(s)
       s = s + n
       if s > 91 :
            s=s-25
       s = chr(s)
       out += s

print(out)

n = int(input())
i_s = input()
out = ''
for s in i_s:
       s = ord(s)
       s = s + n
       if s >= 91 :
            s = s % 91 + 64
       s = chr(s)
       out += s

print(out)

n = int(input())
s = inut()
alp = 'ABCDEFGHJKLMNOPQRSTUVWXYZ'
print(a.tanslate(str.maketrans(alp , alp[:n] + alp[n:])))


n = int(input())
i_s = input()
out = ''
for s in i_s:
       s = ord(s)
       s = s + n
       if s > 91 :
            s=s-26
       s = chr(s)
       out += s

print(out)

n = int(input())
i_s = input()
out = ''
for s in i_s:
        s = ord(s)
        s = s + n
        s = chr(s)
        out += s

print(out)


n = int(input())
s = input()
alp= "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
print(s.translate(str.maketrans(alp, alp[n:] + alp[:n])))


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

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)):
    num=ord(s[i])+n
    if num>90:
        num-=25
    ans.append(chr(num))
ans="".join(ans)
print(ans)

n=int(input())
s=input()
ans=[]
for i in range(n):
    num=ord(s[i])+2
    if num>90:
        num-=90
    ans.append(chr(num))
ans="".join(ans)
print(ans)

n=int(input())
s=input()
ans=[]
for i in range(len(s)):
    num=ord(s[i])+n
    if num>90:
        num-=26
    ans.append(chr(num))
ans="".join(ans)
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):
s = input()
n = input()

char_list = list(n)
length = len(char_list)
result = []
if s != '0':
    for i in range(0,length):
        result.append(chr(ord(char_list[i]) + int(s)))
        
elif s == '0':
    result = char_list
resultstr = ''.join(result)
print(resultstr)

s = input()
n = input()

char_list = list(n)
length = len(char_list)
result = []
if s != '0':
    for i in range(0,length):
        x = ord(char_list[i]) + int(s)
        if x > 90:
            x = x - 26
        result.append(chr(x))
        
elif s == '0':
    result = char_list
resultstr = ''.join(result)
print(resultstr)

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

ans=[]
for i in S:
    if ord(i)+N>90:
        temp=chr(ord(i)+N-26)
        ans.append(temp)
    else:
        temp=chr(ord(i)+N)
        ans.append(temp)

f=''.join(ans)

print(f)

N=int(input())
S=list(input())
 
ans=[]
for i in S:
    if ord(i)+N>90:
        temp=chr(ord(i)+N-26)
        ans.append(temp)
    else:
        temp=chr(ord(i)+N)
        ans.append(temp)
 
f=''.join(ans)
 
print(f)

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_list = list(S)

ans = ""
for i in range(len(S_list)):
  ans = ans + S_list[N+i]
  
print(ans)


N = int(input())

S = input()


S_list = list(S)

ans = ""
for i in range(len(S_list)):
  if(N+i<=len(S_list)):
    ans = ans + S_list[N+i]
  else:
    ans = ans + S_list[len(S_list)-N-i]
  
print(ans)




N = int(input())

S = input()

S_list = list(S)

ans = ""
for i in range(len(S_list)):
  
  ans = ans + chr(ord(S_list[i]) + N)
  
  
print(ans)


N = int(input())

S = input()

S_list = list(S)

ans = ""
for i in range(len(S_list)):
  if(ord(S_list[i])+N<=90):
    
    ans = ans + chr(ord(S_list[i]) + N)
  else:
    a = ord(S_list[i])+N - 90
    #print(a)
    ans = ans + chr(a+64)
  
print(ans)

Verdicts: Runtime Error

Runtime Error

Wrong Answer

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

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

s = list(S)
for i in range(len(S)):
    if (ord(s[i]) - 64 + N) == 26:
        p = 89
    else:
        p = (ord(s[i]) - 64 + N) % 26 + 64

    s[i] = chr(p)

print("".join(s))

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

s = list(S)
for i in range(len(S)):
    if (ord(s[i]) - 64 + N) % 26 == 26:
        p = 89
    else:
        p = (ord(s[i]) - 64 + N) % 26 + 64

    s[i] = chr(p)

print("".join(s))

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

s = list(S)
for i in range(len(S)):
    if (ord(s[i]) - 64 + N) % 26 == 0:
        p = 90
    else:
        p = (ord(s[i]) - 64 + N) % 26 + 64

    s[i] = chr(p)

print("".join(s))

Verdicts: Wrong Answer

Wrong Answer

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

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

abc = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ") 
ans = []

for i in range(len(S)):
    index = abc.index(S[i])
    if index + N < 26:
        ans.append(abc[index + N])
    else:
        ans.append(abc[index + N - 26])
print(ans)

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

abc = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ") 
ans = []

for i in range(len(S)):
    index = abc.index(S[i])
    if index + N < 26:
        ans.append(abc[index + N])
    else:
        ans.append(abc[index + N - 26])
print("".join(ans))
    

Verdicts: Wrong Answer

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

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

ans = []
for i in range(N, len(S)):
    ans.append(S[i])

for i in range(N):
    ans.append(S[i])

print(''.join(ans))

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

N = N % len(S)

ans = []
for i in range(N, len(S)):
    ans.append(S[i])

for i in range(N):
    ans.append(S[i])

print(''.join(ans))

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

alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
di = {}
for i in range(len(alp)):
    di[alp[i]] = i
alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
# N = N % len(S)

ans = []
for s in S:
    ans.append(alp[di[s]+N])

print(''.join(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()

lst = []
for i in S:
    x = ord(i)
    if x + N > 90:
        x = x - 90 - 1 + 65
    lst.append(chr(int(x) + N))
print(lst)

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

lst = []
for i in S:
    x = ord(i)
    if x + N > 90:
        x = x - 90 - 1 + 65
    lst.append(chr(int(x) + N))
print(''.join(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):
N = int(input())
S = list(input())

lst = [chr(ord('a') + i) for i in range(26)]
lst_up = list(map(str.upper,lst))
for i in range(len(S)):
    if int(lst_up.index(S[i])+N) <= len(lst_up):
        S[i] = lst_up[lst_up.index(S[i])+N]
    elif  int(lst_up.index(S[i])+N) > len(lst_up):
        S[i] = lst_up[lst_up.index(S[i])+N-26]

lst_2 = "".join(S)
print(lst_2)

n = int(input())
s = list(input())
lst_26 = [(chr(ord("a") + i)).upper() for i in range(26)]

for i in range(len(s)):
    if lst_26.index(s[i])+n >= 26:
        s[i] = lst_26[lst_26.index(s[i])+n-26]
    else:
        s[i] = lst_26[lst_26.index(s[i])+n]
print("".join(s))

Verdicts: Runtime Error

Accepted