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

Failing test case input:
13
ZYDWMUTWLQPGOURKJEOGBEESIA

Expected output:
MLQJZHGJYDCTBHEXWRBTORRFVN


Actual output:
LQJZHGJYDCTBHEXWRBTORRFVN


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

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()
Answer_list = []

for i in list(S):
    num = ord(i)+N
    if num >= 65 or num <= 90:
        Answer_list.append(chr(num))
    elif num < 90:
        Answer_list.append(chr(num - 26))
print(''.join(Answer_list))

Failing test case input:
13
XBIRLUXETNQUOWHPDDOHCYSAJK

Expected output:
KOVEYHKRGADHBJUCQQBUPLFNWX


Actual output:
eOV_YbeRa[^b\dU]QQ\UPf`NWX


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
Answer_list = []
for i in list(S):
    num = ord(i)+N
    if num >= 65 and num <= 90:
        Answer_list.append(chr(num))
    elif num > 90:
        Answer_list.append(chr(num - 26))
print(''.join(Answer_list))

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()

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

print(ret)

Failing test case input:
2
ZXBXCA

Expected output:
BZDZEC


Actual output:
CZDZEC


Fixed submission (verdict: Accepted):
n = int(input()) % 26
s = input()

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

print(ret)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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))


Failing test case input:
13
AISEEBGOEJKRUNGPQLXTUMWDYZ

Expected output:
NVFRROTBRWXEHATCDYKGHZJQLM


Actual output:
NV`RROT\RWX_bA:CD?KGH@J7LM


Fixed submission (verdict: Accepted):
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))
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=str(input())

result=""

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

print(result)

Failing test case input:
13
ABCDEFGGIJKLMNOOQRSTUVWXYZ

Expected output:
NOPQRSTTVWXYZABBDEFGHIJKLM


Actual output:
NOPQRSTTVWXYZ[\\^_`abcdefg


Fixed submission (verdict: Accepted):
n=int(input())
s=str(input())

result=""

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

Problem: p02848
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
S = input()
ans = ''
for i in range(len(S)):
  temp = ord(S[i]) - ord('A')
  ans += chr(ord("A") + temp%26 )
print(ans)

Failing test case input:
13
YEJXYUTUEPQGOWRKDEOGBNSAJK

Expected output:
LRWKLHGHRCDTBJEXQRBTOAFNWX


Actual output:
YEJXYUTUEPQGOWRKDEOGBNSAJK


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
ans = ''
for i in range(len(S)):
  temp = ord(S[i]) - ord('A') + N
  ans += chr(ord("A") + temp%26 )
print(ans)

Problem: p02848
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
S=input()
tmp=""
for i in range(len(S)):
  chtmp=ord(S[i])+N
  if(chtmp>ord('Z')):
    chtmp-=ord('A')
  tmp+=chr(chtmp)
print(tmp)


Failing test case input:
13
SJAKMBGOEDKSWOGPQEUTUEXJYZ

Expected output:
FWNXZOTBRQXFJBTCDRHGHRKWLM


Actual output:
WNXZOTRQX#TR! !R$W%&


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

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
al = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
n = int(input())
s = input()
ans =[]
for i in s:
  num = al.index(i)
  num = (num + n ) % 26 -1
  ans.append(al[num])
print(ans)

Failing test case input:
13
AISEEBGOFJKRUNGOQLXTUMWDYZ

Expected output:
NVFRROTBSWXEHATBDYKGHZJQLM


Actual output:
M U E Q Q N S A R V W D G Z S A C X J F G Y I P K L

Fixed submission (verdict: Accepted):
al = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
n = int(input())
s = input()
ans =[]
for i in s:
  num = al.index(i)
  num = (num + n ) % 26
  ans.append(al[num])
p=''.join(ans)
print(p)

Problem: p02848
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n=int(input())
s=input()

l=[]

for a in s:
  moji=ord(a)
  moji+=n
  l.append(chr(moji))

print(''.join(l))

Failing test case input:
13
KJASNBGNDDKHWOUQPEURUYXJEY

Expected output:
XWNFAOTAQQXUJBHDCRHEHLKWRL


Actual output:
XWN`[OT[QQXUd\b^]Rb_bfeWRf


Fixed submission (verdict: Accepted):
n=int(input())
s=input()

l=[]

for a in s:
  moji=ord(a)
  moji+=n

  if int(moji)>90:
    moji-=26

  l.append(chr(moji))

print(''.join(l))
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = int(input())
b = input()
chr_a = 0
ans = ''
for i in range(len(b)):
    if ord(b[i]) + a <= 90:
        chr_a = ord(b[i]) + a
    else:
        chr_a = ord(b[i]) + a -25
    ans += chr(chr_a)
print(ans)

Failing test case input:
2
ZXXDBA

Expected output:
BZZFDC


Actual output:
CZZFDC


Fixed submission (verdict: Accepted):
a = int(input())
b = input()
chr_a = 0
ans = ''
for i in range(len(b)):
    if ord(b[i]) + a <= 90:
        chr_a = ord(b[i]) + a
    else:
        chr_a = ord(b[i]) + a -26
    ans += chr(chr_a)
print(ans)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
l=str(input())


ll=[]
leng=len(l)

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

Failing test case input:
0
YABXAZ

Expected output:
YABXAZ


Actual output:
YABXA@


Fixed submission (verdict: Accepted):
n=int(input())
l=str(input())


ll=[]
leng=len(l)

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

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = list(input())

ans = ""
for a in S:
    ans += chr((ord(a) + N) % 26 + ord("A"))

print(ans)

Failing test case input:
0
ZXYABA

Expected output:
ZXYABA


Actual output:
MKLNON


Fixed submission (verdict: Accepted):
N = int(input())
S = list(input())

ans = ""
for a in S:
    ans += chr((ord(a) + N - ord("A")) % 26 + ord("A"))

print(ans)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
sn = int(input())
str_ = input()

result = ''

for alphabet in str_:
  t = ord(alphabet)
  chr_int = t + sn
  if chr_int > 91:
    chr_int -= 26
  result += chr(chr_int)
print(result)

Failing test case input:
13
KJASYCHODDPHWOUQNTDXUKSIBX

Expected output:
XWNFLPUBQQCUJBHDAGQKHXFVOK


Actual output:
XWNFLPUBQQCUJBHD[GQKHXFVOK


Fixed submission (verdict: Accepted):
sn = int(input())
str_ = input()

result = ''

for alphabet in str_:
  t = ord(alphabet)
  chr_int = t + sn
  if chr_int > 90:
    chr_int -= 26
  result += chr(chr_int)
print(result)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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))

Failing test case input:
13
ZYDWMUTWEQPGOUSKJEOGBEKSJA

Expected output:
MLQJZHGJRDCTBHFXWRBTORXFWN


Actual output:
AZEXNVUXFRQHPVTLKFPHCFLTKB


Fixed submission (verdict: Accepted):


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))
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = str(input())
alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'N', 'M', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
return_word = []
for i in range(len(S)):
  num = alphabet.index(S[i])
  return_num = N + num
  if return_num > 25:
    return_num = return_num - 26
  return_alphabet = alphabet[return_num]
  return_word.append(return_alphabet)
final = ''
for alpha in return_word:
  final += alpha
print(final)

Failing test case input:
13
YYJXEUTUEPQGOWRKDEOGBNRAJK

Expected output:
LLWKRHGHRCDTBJEXQRBTOAENWX


Actual output:
LLWKRHGHRCDTBJEXQRBTOZEMWX


Fixed submission (verdict: Accepted):
N = int(input())
S = str(input())
alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
return_word = []
for i in range(len(S)):
  num = alphabet.index(S[i])
  return_num = N + num
  if return_num > 25:
    return_num = return_num - 26
  return_alphabet = alphabet[return_num]
  return_word.append(return_alphabet)
final = ''
for alpha in return_word:
  final += alpha
print(final)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
S=input()
s=list()
for i in S:
  temp=ord(i)+2
  if temp<=ord("Z"):
    s.append(chr(temp))
  else:
    s.append(chr(temp-(ord("Z")-ord("A"))-1))
for i in s:
  print(i,end="")


Failing test case input:
13
KJASYCHODDPHWOUQNTEXULRIBX

Expected output:
XWNFLPUBQQCUJBHDAGRKHYEVOK


Actual output:
MLCUAEJQFFRJYQWSPVGZWNTKDZ

Fixed submission (verdict: Accepted):
N=int(input())
S=input()
s=list()
for i in S:
  temp=ord(i)+N
  if temp<=ord("Z"):
    s.append(chr(temp))
  else:
    s.append(chr(temp-(ord("Z")-ord("A"))-1))
for i in s:
  print(i,end="")

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
ALPHABETS = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
N = input()
S = input()
converted = map(lambda x: ALPHABETS[x.index() + N], S.split())
print(converted)

Failing test case input:
13
ZYDWMUTXLQPGNURKJEOGBEESIA

Expected output:
MLQJZHGKYDCTAHEXWRBTORRFVN


Actual output:
<map object at 0x7f91305d52a0>


Fixed submission (verdict: Accepted):
ALPHABETS = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
size = len(ALPHABETS)
N = input()
S = input()
converted = map(lambda x: ALPHABETS[(ALPHABETS.index(x) + int(N)) % size], list(S))
print(''.join(converted))
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys

readline = sys.stdin.buffer.readline


def rot_n(c, n):
    return chr((ord(c) - ord("A") + n) % 26 + ord("A"))


def main():
    N = int(input())
    S = readline()
    S = S.decode('UTF-8')
    S = list(map(lambda c: rot_n(c, N), list(S[0:-1])))
    print("".join(S))


main()


Failing test case input:
13
ABCDEFGHIJKLMNOPQRSTUVWXYZ

Expected output:
NOPQRSTUVWXYZABCDEFGHIJKLM

Actual output:

Fixed submission (verdict: Accepted):
def rot_n(c, n):
    return chr((ord(c) - ord("A") + n) % 26 + ord("A"))


def main():
    N = int(input())
    S = input()
    S = list(map(lambda c: rot_n(c, N), list(S)))
    print("".join(S))


main()

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=input()
leng=len(s)
slist=[]

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

for i in range(0,leng):
    for j in range(0,26):


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

print(slist)


Failing test case input:
2
ZABXCX

Expected output:
BCDZEZ


Actual output:
B, C, D, Z, E, Z

Fixed submission (verdict: Accepted):
n=int(input())
s=input()
leng=len(s)
slist=[]

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

for i in range(0,leng):
    for j in range(0,26):


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

print(''.join(slist))

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()

low = s.lower()
plain = ''

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

print(plain.upper())

Failing test case input:
2
ABDXYZ

Expected output:
CDFZAB


Actual output:
YZBVWX


Fixed submission (verdict: Accepted):
n = int(input())
s = input()

low = s.lower()
plain = ''

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

print(plain.upper())
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys,queue,copy,math
sys.setrecursionlimit(10**8)
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
INF = float('inf')
N = int(input())
S = list(input())
x = ""
ans =list()
for x in S:
    
    if ord(x)+N > ord('Z'):
        ans.append(ord('A') + (ord(x) + N - (ord('Z'))))
    else:
        ans.append(ord(x) + N)

ANS = list()
for i in range (len(S)):
    ANS.append(chr(ans[i]))

print("".join(ANS))



Failing test case input:
13
ZYXWUUTSLQOGNMRKJFOGBEEDIA

Expected output:
MLKJHHGFYDBTAZEXWSBTORRQVN


Actual output:
NMLKIIHGYECTBZFXWSCTORRQVN


Fixed submission (verdict: Accepted):
import sys,queue,copy,math
sys.setrecursionlimit(10**8)
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
INF = float('inf')
N = int(input())
S = list(input())
x = ""
ans =list()
for x in S:
    if ord(x)+N > ord('Z'):
        ans.append(ord('A') + (ord(x) + N - (ord('Z')))-1)
    else:
        ans.append(ord(x) + N)

ANS = list()
for i in range(len(S)):
    ANS.append(chr(ans[i]))

print("".join(ANS))

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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())


Failing test case input:
13
ZYDWMUTXLQOGNURKJFOGBEESIA

Expected output:
MLQJZHGKYDBTAHEXWSBTORRFVN


Actual output:
zydwmutxlqognurkjfogbeesia
MLQJZHGKYDBTAHEXWSBTORRFVN


Fixed submission (verdict: Accepted):
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())

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



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)

Failing test case input:
13
ZYDWMUTWEQPGOUSKJEOGBEKSJA

Expected output:
MLQJZHGJRDCTBHFXWRBTORXFWN


Actual output:
90
89
68
87
77
85
84
87
69
81
80
71
79
85
83
75
74
69
79
71
66
69
75
83
74
65
MLQJZHGJRDCTBHFXWRBTORXFWN


Fixed submission (verdict: Accepted):



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)
Problem: p02848
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
def main():
    n = int(input())
    s = input()
    ans = ""
    for i in range(len(s)):
        suuji = ord(s[i])
        tsugi = suuji + n
        if tsugi > 97+25:
            tsugi -= 26
        ans += chr(tsugi)
    print(ans)


    
    
if __name__ == "__main__":
    main()


Failing test case input:
13
XBIRKUXETNQUOWHPDDOHCYSAJK

Expected output:
KOVEXHKRGADHBJUCQQBUPLFNWX


Actual output:
eOV_XbeRa[^b\dU]QQ\UPf`NWX


Fixed submission (verdict: Accepted):
def main():
    n = int(input())
    s = input()
    ans = ""
    for i in range(len(s)):
        suuji = ord(s[i])
        tsugi = suuji + n
        if tsugi > 65+25:
            tsugi -= 26
        ans += chr(tsugi)
    print(ans)


    
    
if __name__ == "__main__":
    main()

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()

stdata = [chr(s) for s in range(ord("A"),ord("Z") + 1)]
ans = []
for i in range(len(s)):
  ind = stdata.index(s[i])
  ind = (ind + n) % 26
  ans.append(stdata[ind])
for i in range(len(s)):
  print(ans[i],end=" ")
  

Failing test case input:
13
ZYJXMUTUEQPGOWSKDEOGBEKSJA

Expected output:
MLWKZHGHRDCTBJFXQRBTORXFWN


Actual output:
M L W K Z H G H R D C T B J F X Q R B T O R X F W N 

Fixed submission (verdict: Accepted):
n = int(input())
s = input()

stdata = [chr(s) for s in range(ord("A"),ord("Z") + 1)]
ans = []
for i in range(len(s)):
  ind = stdata.index(s[i])
  ind = (ind + n) % 26
  ans.append(stdata[ind])
for i in range(len(s)):
  print(ans[i],end="")

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
S=list(input())
cha = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ'*2)
for i in range(len(S)):
    S[i]=cha[cha.index(S[i])+2]
print("".join(S))

Failing test case input:
13
AISEEBGOEJKRUNGPQLXTUMWDYZ

Expected output:
NVFRROTBRWXEHATCDYKGHZJQLM


Actual output:
CKUGGDIQGLMTWPIRSNZVWOYFAB


Fixed submission (verdict: Accepted):
N=int(input())
S=list(input())
cha = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ'*2)
for i in range(len(S)):
    S[i]=cha[cha.index(S[i])+N]
print("".join(S))

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=input()
l=list(s)
newcome=[]
alp=[chr(ord('A') + i) for i in range(26)]
for i in l:
  a=alp.index(i)
  if (a+n)<=26:
    t=alp[a+n-1]
  else:
    t=alp[a+n-26]
  newcome.append(t)
print("".join(newcome))

Failing test case input:
13
ZYDWMUTSLQOGNURKJFOGBEEXIA

Expected output:
MLQJZHGFYDBTAHEXWSBTORRKVN


Actual output:
MLPJYHGFXDBSZHEWVRBSNQQKUM


Fixed submission (verdict: Accepted):
n=int(input())
s=input()
l=list(s)
newcome=[]
alp=[chr(ord('A') + i) for i in range(26)]
for i in l:
  a=alp.index(i)
  if (a+n)<26:
    t=alp[a+n]
  else:
    t=alp[a+n-26]
  newcome.append(t)
print("".join(newcome))
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, s = input(), input()
out = ""
for i in range(len(s)):
  if ord(s[i].upper()) == 90:
    out += 'A'
  else:
    out += chr(ord(s[i].upper()) + 1)
print(out)

Failing test case input:
13
AISEEBGOEJKRUNGPQLXTUMWDYZ

Expected output:
NVFRROTBRWXEHATCDYKGHZJQLM


Actual output:
BJTFFCHPFKLSVOHQRMYUVNXEZA


Fixed submission (verdict: Accepted):
n, s = input(), input()
out = ""
for i in range(len(s)):
    a = ord(s[i].upper()) % 65
    out += chr((a + int(n) % 26) % 26 + 65)
print(out)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
if __name__ == '__main__':
    N = int(input())
    S = input()
    al=[chr(ord('A') + i) for i in range(26)]
    ans = ''
    for s in S:
        ans += al[(N+S.index(s))%26]
    print(ans)

Failing test case input:
13
YEJXYUUUEPQGOWRKDENGBNSAJK

Expected output:
LRWKLHHHRCDTBJEXQRATOAFNWX


Actual output:
NOPQNSSSOWXYZABCDOFYHFJKPC


Fixed submission (verdict: Accepted):
if __name__ == '__main__':
    N = int(input())
    S = input()
    al=[chr(ord('A') + i) for i in range(26)]
    ans = ''
    for s in S:
        ans += al[(N+al.index(s))%26]
    print(ans)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=input()
S=input()
abc=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
out=[]
for i in S:
  ind=abc.index(i)
  ind+=2
  if ind>25:
    ind-=26
  out.append(abc[ind])
out1=''.join(out)
print(out1)

Failing test case input:
13
KJASLCHNDDPHWOUQNTEXUYRIBX

Expected output:
XWNFYPUAQQCUJBHDAGRKHLEVOK


Actual output:
MLCUNEJPFFRJYQWSPVGZWATKDZ


Fixed submission (verdict: Accepted):
N=input()
S=input()
abc=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
out=[]
for i in S:
  idx=abc.index(i)
  idx=idx+int(N)%26
  if idx>25:
      idx-=26
  out.append(abc[idx])
out1=''.join(out)
print(out1)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



n = int(input())
s = input()
r = 65
alphabet_number = 26
n = n % alphabet_number

lst = []

for c in s:
    lst.append(chr(ord(c)+n))

print("".join(lst))

Failing test case input:
13
KJSANBHNEDLHWOUQPEURTYXIDX

Expected output:
XWFNAOUARQYUJBHDCRHEGLKVQK


Actual output:
XW`N[OU[RQYUd\b^]Rb_afeVQe


Fixed submission (verdict: Accepted):



n = int(input())
s = input()
r = 65





lst = []
for c in s:
    new_character = chr((ord(c)-65+n)%26+65)
    lst.append(new_character)

print("".join(lst))

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
num = int(input())
text = input()
movedText = ""
for i in text:
  if i == "z" or i == "Z":
    movedText += chr(ord(i) - 25 + num)
    continue
  movedText += chr(ord(i) + num)
print(movedText)

Failing test case input:
2
ZABXCX

Expected output:
BCDZEZ


Actual output:
CCDZEZ


Fixed submission (verdict: Accepted):
num = int(input())
text = input()
movedText = ""
for i in text:
  if ord(i) + num > ord("z") or ord(i) + num > ord("Z"):
    movedText += chr(ord(i) - 26 + num)
    continue
  movedText += chr(ord(i) + num)
print(movedText)
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()

a = [chr(i) for i in range(65, 65+26)]
c = []
for i in range(len(s)):
    j = 0
    while s[i] != a[j]:
        j+=1
    b = (j+n)%26
    c.append(a[b])
d = c[0]
print(c)
for i in range(len(c)-1):
    d += c[i+1]
print(d)

Failing test case input:
13
YEJXYUUUEPQGOWRKDENGBNSAJK

Expected output:
LRWKLHHHRCDTBJEXQRATOAFNWX


Actual output:
['L', 'R', 'W', 'K', 'L', 'H', 'H', 'H', 'R', 'C', 'D', 'T', 'B', 'J', 'E', 'X', 'Q', 'R', 'A', 'T', 'O', 'A', 'F', 'N', 'W', 'X']
LRWKLHHHRCDTBJEXQRATOAFNWX


Fixed submission (verdict: Accepted):
n = int(input())
s = input()

a = [chr(i) for i in range(65, 65+26)]
c = []
for i in range(len(s)):
    j = 0
    while s[i] != a[j]:
        j+=1
    b = (j+n)%26
    c.append(a[b])
d = c[0]
for i in range(len(c)-1):
    d += c[i+1]
print(d)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
ans = ""
for c in input():
  print(ord(c),ord('A'))
  ans+= chr((ord(c)-ord('A')+n)%26+ord('A'))
print(ans)

Failing test case input:
13
KJASLCHNDDPHWOUQNTERUYXIBX

Expected output:
XWNFYPUAQQCUJBHDAGREHLKVOK


Actual output:
75 65
74 65
65 65
83 65
76 65
67 65
72 65
78 65
68 65
68 65
80 65
72 65
87 65
79 65
85 65
81 65
78 65
84 65
69 65
82 65
85 65
89 65
88 65
73 65
66 65
88 65
XWNFYPUAQQCUJBHDAGREHLKVOK


Fixed submission (verdict: Accepted):
n=int(input())
ans = ""
for c in input():
  ans+= chr((ord(c)-ord('A')+n)%26+ord('A'))
print(ans)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
alp = list(input())

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

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

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

Failing test case input:
13
AJSKMBGOEDKSWOGPQEUTUEXJYZ

Expected output:
NWFXZOTBRQXFJBTCDRHGHRKWLM


Actual output:
NWFX@OTBRQXFJBTCDRHGHRKWLM


Fixed submission (verdict: Accepted):
n = int(input())%26
alp = list(input())

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

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

ans = "".join(alp)
print(ans)
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
shift = int(input())
X = input()
ans=''


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



for i in X:
    ans += LIST[(DIC[i] + 2) % 26]
    
print (ans)

Failing test case input:
13
KJASYCHODDPHWOUQNTDXUKRIBX

Expected output:
XWNFLPUBQQCUJBHDAGQKHXEVOK


Actual output:
MLCUAEJQFFRJYQWSPVFZWMTKDZ


Fixed submission (verdict: Accepted):
shift = int(input())
X = input()
ans=''


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



for i in X:
    ans += LIST[(DIC[i] + shift) % 26]
    
print (ans)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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))


Failing test case input:
13
YEJXYUTUEPQGOWRKDEOGBNSAJK

Expected output:
LRWKLHGHRCDTBJEXQRBTOAFNWX


Actual output:
LRWKLHGHRCDTBJEXQRBTO[FNWX


Fixed submission (verdict: Accepted):
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))

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()
result = ''

for c in s:
  result += chr((((ord(c) + n) -64) % 26) + 64)
  
print(result)

Failing test case input:
13
ABCDEFGOIJKLMNGOQRSTUVWXYZ

Expected output:
NOPQRSTBVWXYZATBDEFGHIJKLM


Actual output:
NOPQRSTBVWXY@ATBDEFGHIJKLM


Fixed submission (verdict: Accepted):
n = int(input())
s = input()
result = ''

for c in s:
  result += chr((((ord(c) + n) -65) % 26) + 65)
  
print(result)

Problem: p02848
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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))

Failing test case input:
13
ZYJXMUTUEQPGOWSKDEOGBEKSJA

Expected output:
MLWKZHGHRDCTBJFXQRBTORXFWN


Actual output:
MLWKYHGHRDCTBJFXQRBTORXFWN


Fixed submission (verdict: Accepted):
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))
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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]


Failing test case input:
13
XDIXYTRUENQUOWHPDENHBLASJK

Expected output:
KQVKLGEHRADHBJUCQRAUOYNFWX


Actual output:

Fixed submission (verdict: Accepted):
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)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()
print(len(S))
new_S = ''
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

for s in range (len(S)):
    for i in range(26):
        if (S[s] == alphabet[i]):
            new_S += alphabet[i+N]
            break
print(new_S)

Failing test case input:
13
ZYDWMUTWLQPGOURKJEOGBEESIA

Expected output:
MLQJZHGJYDCTBHEXWRBTORRFVN


Actual output:
26
MLQJZHGJYDCTBHEXWRBTORRFVN


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
new_S = ''
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

for s in range (len(S)):
    for i in range(26):
        if (S[s] == alphabet[i]):
            new_S += alphabet[i+N]
            break
print(new_S)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()
for i in s:
  a = ord(i) + n
  if a > 90:
    a -= 26
  print(chr(a))

Failing test case input:
13
ZYXWVUTSRQOGNMLKJIOGFEDCBA

Expected output:
MLKJIHGFEDBTAZYXWVBTSRQPON


Actual output:
M
L
K
J
I
H
G
F
E
D
B
T
A
Z
Y
X
W
V
B
T
S
R
Q
P
O
N


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

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
13
ZYDWMUTWLQPGOURKJEOGBEESIA

Expected output:
MLQJZHGJYDCTBHEXWRBTORRFVN


Actual output:
M L Q J Z H G J Y D C T B H E X W R B T O R R F V N

Fixed submission (verdict: Accepted):
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))
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()
n = len(S)
ans = ''
for i in range(n):
    a = ord(S[i])-97+N
    if a >= 26:
        a = a - 26
    a += 97
    b = chr(a)
    ans += b
print(ans)


Failing test case input:
2
ACXBXZ

Expected output:
CEZDZB


Actual output:
CEZDZ\


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
n = len(S)
ans = ''
for i in range(n):
    a = (ord(S[i])-65+N)%26
    a += 65
    b = chr(a)
    ans += b
print(ans)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = list(input())
al = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(len(s)):
        s[i] = al[(al.find(s[i])+n)%26]
print(s)

Failing test case input:
13
ZYXWVUTSLQOGNMRKJBOGFEEDIA

Expected output:
MLKJIHGFYDBTAZEXWOBTSRRQVN


Actual output:
M L K J I H G F Y D B T A Z E X W O B T S R R Q V N

Fixed submission (verdict: Accepted):
n = int(input())
s = list(input())
al = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(len(s)):
        s[i] = al[(al.find(s[i])+n)%26]
print("".join(s))

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
move_num = int(input())
input_char_str = input()

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

ans_char = ""
move_number = 0
for input_char in input_char_str:
    if (char_list.index(input_char)+move_number) < len(char_list):
        ans_char += char_list[char_list.index(input_char)+move_number]
    else:
        char_index = (char_list.index(input_char)+move_number) % len(char_list)
        ans_char += char_list[char_index]

Failing test case input:
13
ZYDWMUTWKQPGOUSKJEOGBEESJA

Expected output:
MLQJZHGJXDCTBHFXWRBTORRFWN


Actual output:

Fixed submission (verdict: Accepted):
move_num = int(input())
input_char_str = input()

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

ans_char = ""
move_number = move_num
for input_char in input_char_str:
    if (char_list.index(input_char)+move_number) < len(char_list):
        ans_char += char_list[char_list.index(input_char)+move_number]
    else:
        char_index = (char_list.index(input_char)+move_number) - len(char_list)
        ans_char += char_list[char_index]
        
print(ans_char)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
num = int(input())
text = input()
movedText = ""
for i in text:
  if i == "z" or i == "Z":
    movedText += chr(ord(i) - 25)
    continue
  movedText += chr(ord(i) + num)
print(movedText)

Failing test case input:
13
KJASLBHNDDPHWOUQNTUREYXIBX

Expected output:
XWNFYOUAQQCUJBHDAGHERLKVOK


Actual output:
XWN`YOU[QQ]Ud\b^[ab_RfeVOe


Fixed submission (verdict: Accepted):
num = int(input())
text = input()
movedText = ""
for i in text:
  if ord(i) + num > ord("z") or ord(i) + num > ord("Z"):
    movedText += chr(ord(i) - 26 + num)
    continue
  movedText += chr(ord(i) + num)
print(movedText)
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()
P = []
for i in range(len(S)):
    if ord(S[i]) + N > 90:
        temp = (ord(S[i]) + N) - 90
        P.append(chr(65 + (temp - 1)))
    else:
        P.append(chr(ord(S[i]) + N))
print(P)

Failing test case input:
13
YEJXYUUUEPQGOWRKDEOGBNSAJK

Expected output:
LRWKLHHHRCDTBJEXQRBTOAFNWX


Actual output:
L R W K L H H H R C D T B J E X Q R B T O A F N W X

Fixed submission (verdict: Accepted):
N = int(input())
S = input()
P = []
for_represent = []
for i in range(len(S)):
    if ord(S[i]) + N > 90:
        temp = (ord(S[i]) + N) - 90
        P.append(chr(65 + (temp - 1)))
    else:
        P.append(chr(ord(S[i]) + N))
P = "".join(map(str, P))
print(P)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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))

Failing test case input:
13
RJAKNBGOEDKSWOGPQEUTUEXJYZ

Expected output:
EWNXAOTBRQXFJBTCDRHGHRKWLM


Actual output:
AWNXAOTARQXAAATAARAAARAWAA


Fixed submission (verdict: Accepted):
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))

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import string
List = [chr(i) for i in range(65,65+26)]
N = int(input())
s = list(input())
for i in range(len(s)):
  if s[i] == 'Z':
    s[i] = 'A'
    continue
  s[i] = List[List.index(s[i])+1]
print(*s)

Failing test case input:
13
YEJXYUUUEPQGOWRKDENGBNSAJK

Expected output:
LRWKLHHHRCDTBJEXQRATOAFNWX


Actual output:
Z F K Y Z V V V F Q R H P X S L E F O H C O T B K L


Fixed submission (verdict: Accepted):
import string
List = [chr(i) for i in range(65,65+26)]
N = int(input())
s = list(input())
ans = ''
for i in range(len(s)):
  Next_index = List.index(s[i])+N
  if Next_index>25:
    Next_index = abs(26-Next_index)
  ans += List[Next_index]
print(ans)
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = list(input())
alp = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
for i in range(len(S)):
    for j in range(len(alp)):
        if alp[j] == S[i]:
            ans = int((j + N) % len(alp))
            S[i] = alp[ans]
            break
        else:
            continue
print(S)

Failing test case input:
13
ZYDWMUTWLQPGNURKJEOGBEESIA

Expected output:
MLQJZHGJYDCTAHEXWRBTORRFVN


Actual output:
M L Q J Z H G J Y D C T A H E X W R B T O R R F V N

Fixed submission (verdict: Accepted):
N = int(input())
S = list(input())
alp = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
for i in range(len(S)):
    for j in range(len(alp)):
        if alp[j] == S[i]:
            ans = int((j + N) % len(alp))
            S[i] = alp[ans]
            break
        else:
            continue
print(''.join(S))

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys

def main():
    input = sys.stdin.readline
    n = int(input())
    s = input()
    first = ord("A") - 1
    last = ord("Z")
    increment = lambda x: chr(ord(x)+n) if ord(x)+n <= last else chr(first + (ord(x)+n - last))
    new_s = "".join(map(increment, s))
    print(new_s)
    


if __name__ == '__main__':
    main()


Failing test case input:
13
KJSALBHNEDPHWOUQNEURTYXIDX

Expected output:
XWFNYOUARQCUJBHDARHEGLKVQK


Actual output:
XWFNYOUARQCUJBHDARHEGLKVQK


Fixed submission (verdict: Accepted):
import sys

def main():
    input = sys.stdin.readline
    n = int(input())
    s = input().rstrip()
    first = ord("A") - 1
    last = ord("Z")
    increment = lambda x: chr(ord(x)+n) if ord(x)+n <= last else chr(first + (ord(x)+n - last))
    new_s = "".join(map(increment, s))
    print(new_s, end="")
    


if __name__ == '__main__':
    main()

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = list(input())

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



Failing test case input:
13
ZYXWVUTSRQOGNMLKJBOGFEEDIA

Expected output:
MLKJIHGFEDBTAZYXWOBTSRRQVN


Actual output:
NMLKJIHGFECTBZYXWOCTSRRQVN

Fixed submission (verdict: Accepted):
n = int(input())
s = list(input())

for i in range(len(s)):
    ascii = ord(s[i])
    if((ascii+n)>90):
        print(chr(64+(ascii+n-90)),end='')
    else:
        print(chr(ascii+n),end='')
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()
al = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

if n == 0:
    print(s)

for i in range(len(s)):
    print(al[al.index(s[i]) - 26 + n])

print(s)

Failing test case input:
13
RJAKNBGOEDKSWOGPQEUTUEXJYZ

Expected output:
EWNXAOTBRQXFJBTCDRHGHRKWLM


Actual output:
E
W
N
X
A
O
T
B
R
Q
X
F
J
B
T
C
D
R
H
G
H
R
K
W
L
M
RJAKNBGOEDKSWOGPQEUTUEXJYZ


Fixed submission (verdict: Accepted):
n = int(input())
s = input()
al = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ''
for i in range(len(s)):
    ans += (al[al.index(s[i]) - 26 + n])

print(ans)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
13
ZYXWUUTSLQOGNMRKJBOGFEEDIA

Expected output:
MLKJHHGFYDBTAZEXWOBTSRRQVN


Actual output:
AZYXVVUTMRPHONSLKCPHGFFEJB


Fixed submission (verdict: Accepted):
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)

Problem: p02848
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
base_str, num = 'TEST', 24
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']
def replacer(letter, num):
    letter_index = alphabets.index(letter)
    return(alphabets[(letter_index+num)%27])
answer = []
for i in range(len(base_str)):
    answer.append(replacer(base_str[i], num))
answer = ''.join(answer)
print(answer)

Failing test case input:
13
KJSANBHNEDPHWOUQLEURTYXIDX

Expected output:
XWFNAOUARQCUJBHDYRHEGLKVQK


Actual output:
QBPQ


Fixed submission (verdict: Accepted):
num = int(input())
base_str = 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']
def replacer(letter, num):
    letter_index = alphabets.index(letter)
    return(alphabets[(letter_index+num)%26])
answer = []
for i in range(len(base_str)):
    answer.append(replacer(base_str[i], num))
answer = ''.join(answer)
print(answer)
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()
ns = []
for ch in s:
    if ('A' <= ch and ch <= 'Z'):
        ns.append(chr((ord(ch) - ord('A') - n) % 26 + ord('A')))
       
   
print("".join(ns))

Failing test case input:
2
ZAAXBX

Expected output:
BCCZDZ


Actual output:
XYYVZV


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

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = list(str(input()))

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

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

print(ans)

Failing test case input:
13
AIDEEFGOBJKLMNGOQRSTUVWXYZ

Expected output:
NVQRRSTBOWXYZATBDEFGHIJKLM


Actual output:
NVQRRSTOWXYZT	



Fixed submission (verdict: Accepted):
n = int(input())
s = list(str(input()))

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

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

print(ans)

Problem: p02848
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O',
   'P','Q','R','S','T','U','V','W','X','Y','Z']
N=int(input())
x=input()
X=[j for j in x]
for i in range(0,len(X)-1):
  n=(A.index(X[i])+N)%26
  X[i]=A[n]
print(X)

Failing test case input:
13
ZYDWMUTSLQOGNURKJFOGBEEXIA

Expected output:
MLQJZHGFYDBTAHEXWSBTORRKVN


Actual output:
M L Q J Z H G F Y D B T A H E X W S B T O R R K V A

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

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

str_list = list(S)
str_trsf = []

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

print(''.join(str_trsf))

Failing test case input:
13
YEJXYUTUEPQGOWRKDEOGBNSAJK

Expected output:
LRWKLHGHRCDTBJEXQRBTOAFNWX


Actual output:
BRWCBFGFRKJTLDIXQRLTOMHNWX


Fixed submission (verdict: Accepted):

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

print(''.join(str_trsf))
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
S=input()
ANS=""
for i in range(len(S)):
    ANS+=chr(64+((ord(S[i])+N)-64)%26)
print(ANS)

Failing test case input:
13
ZYDWMUTXLQPGNURKJEOGBEESIA

Expected output:
MLQJZHGKYDCTAHEXWRBTORRFVN


Actual output:
MLQJ@HGKYDCTAHEXWRBTORRFVN


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

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=str(input())

result=""

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

print(result)

Failing test case input:
13
SJAKNBGOEDKSWOGPQEUTUEXJYZ

Expected output:
FWNXAOTBRQXFJBTCDRHGHRKWLM


Actual output:
`WNX[OT\RQX`d\T]^RbabReWfg


Fixed submission (verdict: Accepted):
n=int(input())
s=str(input())

result=""

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

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n = int(input())
s = 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].upper())
print("".join(ans))


Failing test case input:
13
AICDEFGOBJKLMNGOQRSTUVWXYZ

Expected output:
NVPQRSTBOWXYZATBDEFGHIJKLM


Actual output:
NWPQRSTBOVXYZATBDEFGHJIKLM


Fixed submission (verdict: Accepted):

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

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

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

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

print(ans)


Failing test case input:
13
KJASYCHODDPHWOUQNTEXULRIBX

Expected output:
XWNFLPUBQQCUJBHDAGRKHYEVOK


Actual output:
X W N F L P U B Q Q C U J B H D A G R K H Y E V O K

Fixed submission (verdict: Accepted):

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

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

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

print("".join(map(str,ans)))