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):
s = input()
n = int(input())
ans=[]
a = "ABCDEFGHIJKLMNOPQRSTUWVXYZABCDEFGHIJKLMNOPQRSTUWVXYZ"
a_list=[]
for j in a:
	a_list.append(j)
for i in range (len(s)):
	ans.append(a_list[int(a_list.index(s[i]))+n])
print("".join(ans))

s = input()
n = int(input())
ans=[]
a = "ABCDEFGHIJKLMNOPQRSTUWVXYZabcdefghijklmnopqrstuwvxyz"
a_list=[]
for j in a:
	a_list.append(j)
for i in range (len(s)):
	ans.append(a_list[a_list.index(s[i])+n])
ans=ans.upper()
print("".join(ans))

s = input()
n = int(input())
ans=[]
a_list = "ABCDEFGHIJKLMNOPQRSTUWVXYZABCDEFGHIJKLMNOPQRSTUWVXYZ"
for i in range (len(s)):
	ans.append(a_list[a_list.index(s[i])+n])
print("".join(ans))

s = input()
n = int(input())
ans=[]
a = "ABCDEFGHIJKLMNOPQRSTUWVXYZABCDEFGHIJKLMNOPQRSTUWVXYZ"
a_list=[]
for j in a:
	a_list.append(j)
for i in range (len(s)):
	ans.append(a_list[a_list.index(s[i])+n])
print("".join(ans))


n = int(input())
s = input()
ans=[]
a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
a_list=[]
for j in a:
	a_list.append(j)
for i in range (len(s)):
	ans.append(a_list[a_list.index(s[i])+n].upper())
print("".join(ans))


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

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

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

for i in range(len(s)):
  result = result + chr(ord(s[i]) + n)

print(result)

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

for i in range(len(s)):
  if (ord(s[i]) + n <= ord('Z')):
    result = result + chr(ord(s[i]) + n)
  else:
    result = result + chr(ord(s[i]) + 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):
N=int(input())
S=input()

l="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
out=""

for i in S:
    out += l[(l.index(i)+n)%26]

print(out)

n = int(input())
s = input()
 
l = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 
out = ""
 
for c in s:
    out += l[(l.index(c)+n)%26]
 
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()
print (chr(48))
r=""
for i in range(len(S)):
    r=r+(chr((ord(S[i])+N-65)%26+65))
print(r)


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

Verdicts: Wrong Answer

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

Submission attempts (in order):
import sys
input = sys.stdin.readline

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

l=["A",'B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',"A",'B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
n=int(input())
s=input()
ans=""
for i in range(len(s)):
    ans+=l[l.index(s[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):
N = int(input('int'))
S = input('string')
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']
new_string = ''

for s in S:
    new_string += (alphabets[(alphabets.index(s) + N) % 26])


print(new_string)

N = int(input())
S = input()
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']
new_string = ''

for s in S:
    new_string += (alphabets[(alphabets.index(s) + N) % 26])

print(new_string)


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

new_s = s[n:] + s[:(-1)*(n)]

print(new_s[:len(s)])

N=int(input())
S=list(input())
for i in range(len(S)):
    S[i]=chr((ord(S[i])-ord('A')+N)%26+ord('A'))
print(''.join(S))

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
def caesar(s, n):
    ns = []
    for ch in s:
        # A - Z
        if ('A' <= ch and ch <= 'Z'):
            ns.append(chr((ord(ch) - ord('A') - n) % 26 + ord('A')))
        
        elif ('a' <= ch and ch <= 'z'):
            ns.append(chr((ord(ch) - ord('a') - n) % 26 + ord('a')))
        # 0 - 9
        elif ('0' <= ch and ch <= '9'):
            ns.append(chr((ord(ch) - ord('0') - n) % 10 + ord('0')))
        # no change for other characters
        else:
            ns.append(ch)
    return "".join(ns)

result = caesar("Hello#0", 1)
print(result)

SHIFT_COUNT = int(input())
encryptionStr = input()
result = ""
excludeStr = "{}_"

for c in encryptionStr :
    
    if excludeStr.find(c) != -1 :
        result = result + c
        continue

    
    if ord('a') <= ord(c) <= ord('z') :
        result = result + chr(abs(((ord(c) + SHIFT_COUNT - ord('a')) % 26)) + ord('a'))
    else :
        result = result + chr(abs(((ord(c) + SHIFT_COUNT - ord('A')) % 26)) + ord('A'))

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

alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in S:

    s=ord(i)
    if 65 <= s and s <= 90:
        s = s + 3
    elif 97 <= s and s <= 122:
        s = s + 3
    i=chr(s)
    letters+=i
print(letters)

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

alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in S:

    s=ord(i)
    s=(s-65+N)%26+65
    i=chr(s)
    letters+=i
print(letters)

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 s in S:
  if ord("Z") < ord(s)+N:
    ans+=chr(ord("A")+ord("Z")-(ord(s)+N))
  else:
    ans+=chr(ord(s)+N)
print(ans)

N=int(input())
S=input()
ans=""
for s in S:
  if ord("Z") < ord(s)+N:
    ans+=chr(ord("A")+ord(s)+N-ord("Z")-1)
  else:
    ans+=chr(ord(s)+N)
print(ans)

Verdicts: Wrong Answer

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

Submission attempts (in order):
n = int(input())
s = input()
b = ""
ab = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in range(int(len(s))):
    for j in range(int(len(ab))):
        if (s[i] == ab[j]):
            if (int(j+n) > 25):
                b += ab[j+n-25]
                break
            else:
                b += ab[j+n]
                break

print(b)


n = int(input())
s = input()
b = ""
ab = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for i in range(int(len(s))):
    for j in range(int(len(ab))):
        if (s[i] == ab[j]):
            if (int(j+n) > 25):
                b += ab[j+n-26]
                break
            else:
                b += ab[j+n]
                break

print(b)


Verdicts: Runtime Error

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

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

for i in range (0, len(S)):
    if ord(S[i]) + N <= 90:
        character.append(chr(ord(S[i]) + N))
    else :
        character.append(chr(ord(S[i]) + N - 89 +63))


print(character)

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

for i in range (0, len(S)):
    if ord(S[i]) + N <= 90:
        character.append(chr(ord(S[i]) + N))
    else :
        character.append(chr(ord(S[i]) + N - 89 +63))

answer = "".join(character)

print(answer)

Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())
S = input()
res = ""
for s in S:
    res += chr((ord(s) - ord("A") + n) % 26)
print(res)

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

s = []
L = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
L += L

for i in S:
  s += a[a.find(c) + N]
  
print(*s, sep="")

N = int(input())
L = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
S = input()
res = ""

for i in S:
  n = ord(i)
  n = n + N
  if n > ord("Z"):
    n -= 26
  res += L[n - ord("A")]
  
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()
out=''
for i in range(len(S)):
    out+=chr(ord(S[i])+N)
    
print(out)

N=int(input())
S=input()
out=''
for i in range(len(S)):
    if ord(S[i])+N>90:
        out+=chr(ord(S[i])+N-26)
    else:
        out+=chr(ord(S[i])+N)
        
    
print(out)

Verdicts: Wrong Answer

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

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

alpha=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ") # idx : 0-25
for i in range(len(S)):
    idx = alpha.index(S[i])
    idx_re = idx + N
    if idx_re > 25:
        idx_re = idx_re %25 -1
    else:
        idx_re=idx_re%26
    S[i] = alpha[idx_re]


print(*S)

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


for i in range(len(S)):
    ss=S[i].lower()
    tmp=ord(ss) - ord("a")+N
    num=tmp%26 + ord("a")
    ss=chr(num)
    S[i]=ss.upper()

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
# ABC146B - ROT N
def main():
    N = int(input())
    S = input().rstrip()
    ans = "".join([chr(64 + (ord(ch) + N - 64) % 26) for ch in S])
    print(ans)


if __name__ == "__main__":
    main()

# ABC146B - ROT N
def main():
    N = int(input())
    S = input().rstrip()
    ans = "".join([chr(65 + (ord(ch) + N - 65) % 26) for ch in S])
    print(ans)


if __name__ == "__main__":
    main()

Verdicts: Wrong Answer

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

Submission attempts (in order):
a = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
b = ''

for c in list(input()):
  d = a.index(c)
  if d > 23:
    d = d - 26
  b += a[d+2]

print(b)

a = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
b = ''
e = int(input())

for c in list(input()):
  d = a.index(c)
  if d > 25 - e:
    d = d - (26)
    b += a[(d+e)]
  else:
    b += a[(d+e)]

print(b)

Verdicts: Runtime Error

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

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

alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

for c in s:
	ans += alphabet[alphabet.index(c) % 26]
    
print(ans)

n = int(input())
s = input()
ans = ""
 
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 
for c in s:
	ans += alphabet[(n + alphabet.index(c)) % 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()

ans = ""

for x in range(S)
	num=(ord(x) + N)
  	if num >90:
    	num=64+num%90
    ans += chr(num)
print(ans)



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

ans = ''

for x in range(S)
	num=(ord(x) + N)
  	if(num >90):
    	num=64+num%90
    ans += chr(num)
print(ans)



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

ans = ''

for x in range(S)
	num=(ord(x) + N)
  	if(num >90):
    	num=64+num%90
    ans += chr(num)
print(ans)



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

ans = ""

for x in S
	num=(ord(x) + N)
  	if num >90:
    	num=64+num%90
    ans += chr(num)
print(ans)



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

ans = ''

for x in range(S)
	num=(ord(x) + N)
  	if(num >=90):
    	num=64+num%90
    ans += chr(num)
print(ans)

N = input()
S = input()

s = ""

for i in range(S):
  s+=S[i+N]
  
  
print(s)
  

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

ans = ""

for x in range(S)
	num=(ord(x) + N)
  	if(num >=90):
    	num=64+num%90
    ans += chr(num)
print(ans)


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


Verdicts: 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):
n = int(input())
s = input()
a = s[n:]
b = s[:n]
print(a+b)

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

n = int(input())
s = input()
b = ''
for i in s:
  a = ord(i) + n
  if a > 90:
    a -= 26
  b += chr(a)
print(b)

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):
arphs = list(ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ)
n = int(input())
s = list(input())
i = []
for x in s:
  i.append(arphs.index(x) + n)
print("".join(i))

arphs = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
n = int(input())
s = list(input())
i = []
for x in s:
  i.append(arphs[arphs.index(x) + n])
print("".join(i))

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):
K = int(input())
def enc(k, m):
  plain = list(m.encode("ascii")) 
  cipher = plain.copy() 
  for i,code in enumerate(plain ):
    cipher[i] = cipher[i] + k
    if (cipher[i] > 122):
      cipher[i] = cipher[i] - 26      
  return(bytes(cipher ). decode("ascii"))
angobun = enc(K,input())
print(angobun) 


K = int(input())
def enc(k, m):
  plain = list(m.encode("ascii")) 
  cipher = plain.copy() 
  for i,code in enumerate(plain ):
    cipher[i] = cipher[i] + k
    if (cipher[i] > 90):
      cipher[i] = cipher[i] - 26      
  return(bytes(cipher ). decode("ascii"))
angobun = enc(K,input())
print(angobun) 


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())
alf=("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 k in range(len(alf)):
    if s[i]==alf[k] and k<=23:
      s[i]==alf[k+2]
    elif s[i]==alf[24]:
      s[i]=="A"
    elif s[i]==alf[25]:
      s[i]=="B"
      
print(''.join(s))
  
   
    
               
              

n = int(input())
s = input()
x = ['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']
y = []
for i in range(len(s)):
    for j in range(len(x)):
        if s[i] == x[j]:
            y.append(x[(j+n)%26])
ans = ''.join(y)
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):
a = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"

t = int(input())
a_str = str(input())

a_uniquie = ''.join(set(a_str))

for i in a_uniquie:
  for j in range(len(a)):
    if i == a[j]:
      a_str = a_str.replace(i, a[j+t])
      break

print(a_str)


a = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"

t = int(input())
a_str = str(input())
answer = ""

a_uniquie = ''.join(set(a_str))

for i in a_str:
  for j in range(26):
    if i == a[j]:
      answer += a[j+t]
      break

print(answer)


Verdicts: Wrong Answer

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

Submission attempts (in order):
n = int(input())
s = str(input())
if int(ord(s)) + n > 122:
    print(chr(int(ord(s)) + n - 26))
else:
    print(int(ord(s)) + n)

n = int(input())
s = str(input())
if int(ord(s)) + n > 122:
    print(chr(int(ord(s)) + n - 26))
else:
    print(chr(int(ord(s)) + n))

n = int(input())
s = str(input())
ans = ''
for i in s:
    t = (int(ord(i) + n - 64)) % 26
    if t == 0:
        ans += 'Z'
    else:
        ans += chr(t + 64)
print(ans)

Verdicts: Runtime Error

Runtime Error

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

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

ret = ""
for s in list(S):
    a = ord(s)
    max_z_a = a - 25 if a + N > 90 else a
    ret += chr(max_z_a + N)
print(ret)


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

ret = ""
for s in list(S):
    a = ord(s)
    max_z_a = a - 26 if a + N > 90 else a
    ret += chr(max_z_a + N)
print(ret)


Verdicts: Wrong Answer

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

Submission attempts (in order):
n = int(input())
s = input()
x = 0
ans = ""
c = ""

for i in s:
  x = ord(i) + n
  if x > 90:
      x = x - 26
  c = chr((x))
  ans = ans + c
  print(x)

print(ans)

n = int(input())
s = input()
x = 0
ans = ""
c = ""

for i in s:
  x = ord(i) + n
  if x > 90:
      x = x - 26
  c = chr((x))
  ans = ans + c

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 main():
    n=int(input())
    s=input()
    sum=''
    model='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
    m=list(model)
    for i in range(len(s)):
        now=m.index(s[i])
        sum=sum+m[now+n]
    print(sum)


if __name__=='__main__':
    main()   def main():
    

def main():
    n=int(input())
    s=input()
    sum=''
    model='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
    m=list(model)
    for i in range(len(s)):
        now=m.index(s[i])
        sum=sum+m[now+n]
    print(sum)


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):
def f(N,S):
    alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    ret_s = ""
    for s in S:
        num = (alpha.index(str(s)) + N)
        if num <= 25:
            pass
        else:
            num = num%25-1
        ret_s += alpha[num]
    return print(ret_s)

def f(N,S):
    alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    ret_s = ""
    for s in S:
        num = (alpha.index(str(s)) + N)
        if num <= 25:
            pass
        else:
            num = num-(num//25)*25-1
        ret_s += alpha[num]
    return print(ret_s)

N = input()
S = input()
f(N,S)

def f(N,S):
    alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    ret_s = ""
    for s in S:
        num = (alpha.index(str(s)) + N)
        if num <= 25:
            pass
        else:
            num = num-(num//25)*25-1
        ret_s += alpha[num]
    return print(ret_s)

def f(N,S):
    alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    ret_s = ""
    for s in S:
        num = (alpha.index(str(s)) + int(N))
        if num <= 25:
            pass
        else:
            num = num-(num//26)*26
        ret_s += alpha[num]
    return print(ret_s)
  
a = input()#13#
b = input()#"ABCDEFGHIJKLMNOPQRSTUVWXYZ"#
 
f(a,b)

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

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

Submission attempts (in order):
n = int(input())
s = list(map(ord,input()))
for i in range(len(s)):
  s[i]+=n
  if s[i]>90:
    s[i]-=26
  s[i]=chr(s[i])
print(*s)

n = int(input())
s = list(map(ord,input()))
ans = ""
for i in range(len(s)):
  s[i]+=n
  if s[i]>90:
    s[i]-=26
  ans+=chr(s[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):
def sort(str):
  return ''.join(sorted(str))

i = int(input())
alpha = input()
x = sort(alpha[i:])
y = sort(alpha[:i])
if x.endswith("Z"):
	print(x + "A" + y)
else :
	print(x + y)

i = int(input())
alpha = input()
x = sorted(alpha[i:])
y = sorted(alpha[:i])
print(''.join(x) + ''.join(y))

i = int(input())
alpha = input()
print(alpha[i:] + alpha[:i])

def sort(str):
  return ''.join(sorted(str))

i = int(input())
alpha = input()
x = sort(alpha[i:])
y = sort(alpha[:i])
if x.endswith("Z"):
	print(x + "A" + y[1:])
else :
	print(x + y)

alphaList = ['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']
i = int(input())
str = input()
out = ""
for s in str :
    out = out + alphaList[(alphaList.index(s) + i) % 26]
print(out)

Verdicts: Wrong Answer

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=list(input())
a=""
for c in s:
  a+=chr((ord(c)-ord(a)+n)%26+ord(a))
print(a)
  

n=int(input())
s=list(input())
a=""
for c in s:
  a+=chr((ord(c)-ord("A")+n)%26+ord("A"))
print(a)
  


Verdicts: Runtime Error

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

Submission attempts (in order):
s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
n = int(input())
input_s = input()
print(''.join([s[s.index(c)+n % 26] for c in input_s])

n = int(input())
t = input()
S = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
shift = [S[(S.index(c)+n)%26] for c in t]
print(''.join(shift))

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=list(S)
alpha=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A"]
SS2=[]
for i in range(len(a)):
    x=alpha.index(a[i])
    SS2.append(x)
 
for j in range(len(SS2)):
    SS2[j]+=N
 
SS3=[]
for k in range(len(SS2)):
    y=alpha[SS2[k]]
    SS3.append(y)
 
moji="".join(SS3)
print(moji)

N=int(input())
SS=input()
a=list(SS)
alpha=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","A"]
SS2=[]
for i in range(len(a)):
    x=alpha.index(a[i])
    SS2.append(x)

for j in range(len(SS2)):
    SS2[j]+=1

SS3=[]
for k in range(len(SS2)):
    y=alpha[SS2[k]]
    SS3.append(y)

moji="".join(SS3)
print(moji)

N=int(input())
S=input()
a=list(S)
alpha=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","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"]
SS2=[]
for i in range(len(a)):
    x=alpha.index(a[i])
    SS2.append(x)
 
for j in range(len(SS2)):
    SS2[j]+=N
 
SS3=[]
for k in range(len(SS2)):
    y=alpha[SS2[k]]
    SS3.append(y)
 
moji="".join(SS3)
print(moji)

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())
z=input()
s=list(z)
n=n%26
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"]
x=int(len(s))
d=[]
for i in range(x):
    b=s.pop(0)
    y=a.index(b)
    if y+n>25:
        c=y+n-25
    else:
        c=y+n
    d.append(a[c])
v=int(0)
ans=''.join(d)   
print(ans)


n=int(input())
z=input()
s=list(z)
n=n%26
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"]
x=int(len(s))
d=[]
for i in range(x):
    b=s.pop(0)
    y=a.index(b)
    if y+n>25:
        c=y+n-26
    else:
        c=y+n
    d.append(a[c])
v=int(0)
ans=''.join(d)   
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())

A = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

for i,s in enumerate(S):
    n = A.index(s)
    if n+N > 25:
        nn = n+N-26
    else:
        nn = n+N
    S[i]=A[nn]
B=' '.join(S)
print(B)

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

ai = ord('A')

for i,s in enumerate(S):
    n = ord(s)
    nn= (n+N-ai)%26 + ai
    S[i]=chr(nn)

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):
num2alpha = lambda c: chr(c+64)
alpha2num = lambda c: ord(c) - ord('A') + 1
N = int(input())
S = input()
s_list = list(S)
ANS = ''
for i in s_list:
    if i == 'Z':
        i = '@'
    ANS += num2alpha((N + alpha2num(i)))
print(ANS)

num2alpha = lambda c: chr(c+64)
alpha2num = lambda c: ord(c) - ord('A') + 1
N = int(input())
S = input()
s_list = list(S)
ANS = ''
if N >= 27:
    kazu = int(N/26)
    hiku = int(kazu * 26)
    N = (N - hiku)
for i in s_list:
    AA = (N + alpha2num(i))
    if AA >= 27:
        AA = AA - 26
    ANS += num2alpha(AA)
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()
for i in range(len(s)):
  s[i]=chr((ord(s[i])-ord('A')+n)%26+ord('A'))
print(s)

n=int(input())
s=list(input())
for i in range(len(s)):
  s[i]=chr((ord(s[i])-ord('A')+n)%26+ord('A'))
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()
t = ''
abc = [chr(i) for i in range(65, 65+26)]
for i in s:
  m = abc.index(i)
  if m+n <= 25:
    t += abc[m+n]
  else:
    t += abc[m+n-25]
print(t)

n = int(input())
s = input()
t = ''
abc = [chr(i) for i in range(65, 65+26)]
for i in s:
  m = abc.index(i)
  if m+n <= 25:
    t += abc[m+n]
  else:
    t += abc[m+n-26]
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):
n = int(input())
s = input()
ans = ''
for i in s:
  ans += chr((ord(i)+n-1 - ord('A'))%26 + 1 + ord('A'))
print(ans)


n = int(input())
s = input()
ans = s[:-1] + chr((ord(s[-1])+n-1)%26 + 1)
print(ans)


n = int(input())
s = input()
ans = s[:-1] + chr((ord(s[-1])+n-1 - ord('A'))%26 + 1 + ord('A'))
print(ans)


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

res = list()

strings = [chr(ord('a').upper() + i) for i in range(26)]
for s in S:
  ind = strings.index(s) + N
  res.append(strings[ind % len(strings)])
  
print(''.join(map(str, res)))

N = int(input())
S = str(input())
 
res = list()
 
strings = [chr(i) for i in range(65, 65+26)]
for s in S:
  ind = strings.index(s) + N
  res.append(strings[ind % len(strings)])
  
print(''.join(map(str, 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()
strings = [chr(ord(c)+n) if c != "Z" else chr(ord("A")+(n-1)) for c in s]
ans = "".join(strings)
print(ans)

n = int(input())
s = input()
strings = [chr(ord(c)+n) if ord(c)+n <= ord("Z") else chr(ord(c)+n-26) for c in s]
ans = "".join(strings)
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())
ans = []
lst = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']

for i in range(len(S)):
    tmp = lst.index(S[i])
    tmp += N
    if tmp > 25:
        tmp -= 25
    ans.append(lst[tmp])
print(''.join(ans))


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

for i in range(len(S)):
    tmp = lst.index(S[i])
    tmp += N
    if tmp > 25:
        tmp -= 26
    ans.append(lst[tmp])
print(''.join(ans))


Verdicts: Runtime Error

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

Submission attempts (in order):
A=[chr(i) for i in range(65, 65+26)]
N=int(input())
S=str(input())

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

A=[chr(i) for i in range(65, 65+26)]
N=int(input())
S=str(input())
T=[]
U=str()

for i in range(len(S)):
  k=(A.index(S[i])+N)%26
  T.append(A[k])
  U=U+str(T[i])
  
print(U)

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):
k=int(input())
s=input()
n=len(s)
for i in range(n):
    z=ord(s[i]+k)
    if z>123:
        z-=27
    s[i]=chr(z)
print(s)

k=int(input())
s=input()
n=len(s)
temp=""
for i in range(n):
    z=ord(s[i])+k
    if z>123:
        z-=27
    temp+=chr(z)
print(temp)

k=int(input())
s=input()
n=len(s)
temp=""
for i in range(n):
    z=ord(s[i])+k
    if z>122:
        z-=26
    temp+=chr(z)
print(temp)

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

Verdicts: 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):
# B - ROT N


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

tmp = ""

for s in S:
    unicode_point = ord(s) + N

    if unicode_point >= 90:
        unicode_point = 65 + (unicode_point - 90)

    tmp += chr(unicode_point)

print(tmp)

# B - ROT N


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

tmp = ""

for s in S:
    print(ord(s))
    unicode_point = ord(s) + N

    if unicode_point > 90:
        unicode_point = 64 + (unicode_point - 90)

    tmp += chr(unicode_point)

print(tmp)

# B - ROT N


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

tmp = ""

for s in S:
    unicode_point = ord(s) + N

    if unicode_point > 90:
        unicode_point = 64 + (unicode_point - 90)

    tmp += chr(unicode_point)

print(tmp)

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):
class RotN:
    def __init__(self):
        self.alphabet = [a for a in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ']

    def calculate(self, N, S):
        result_list =[]
        for s in S:
            num = self.alphabet.index(s)
            
            if num + N > 25:
                tmp = 25 - (num + N)
                result_list.append(self.alphabet[tmp])
            
            else:
                tmp = num + N
                result_list.append(self.alphabet[tmp]) 
        return result_list

if __name__ == '__main__':
    N = int(input())
    S = [s for s in input()]
    rn = RotN()
    result_list = rn.calculate(N, S)
    result = ''
    for x in result_list:
        result += x
    print(result)

class RotN:
    def __init__(self):
        self.alphabet = [a for a in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ']

    def calculate(self, N, S):
        result_list =[]
        for s in S:
            num = self.alphabet.index(s)
            
            if num + N > 25:
                tmp = 25 - (num + N)
                result_list.append(self.alphabet[abs(tmp)-1])
            
            else:
                tmp = num + N
                result_list.append(self.alphabet[tmp]) 
        return result_list

if __name__ == '__main__':
    N = int(input())
    S = [s for s in input()]
    rn = RotN()
    result_list = rn.calculate(N, S)
    result = ''
    for x in result_list:
        result += x
    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 string
l = string.ascii_uppercase

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

ans = []
plusNumber = N % 26
for c in S :
    ans.append(l[l.index(c) + plusNumber])
print("".join(ans))

import string
l = string.ascii_uppercase

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

ans = []
for c in S :
    plusNumber = (l.index(c) + N) % 26
    ans.append(l[plusNumber])
print("".join(ans))

Verdicts: Runtime Error

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

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

for i in range(len(s)):
    if ord(s[i])+n > 90:
        t += chr(65+ord(s[i])+n-90)
    else:
        t += chr(ord(s[i])+n)
    
print(t)

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

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


Verdicts: Wrong Answer

Accepted