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

Failing test case input:
13
XBIXYERUTNQUOWHPDDNHBLSAJK

Expected output:
KOVKLREHGADHBJUCQQAUOYFNWX


Actual output:
intstringKOVKLREHGADHBJUCQQAUOYFNWX


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

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

Failing test case input:
13
YYJXEUTUEPQGOWRKDEOGBNRAJK

Expected output:
LLWKRHGHRCDTBJEXQRBTOAENWX


Actual output:
MMWLRIHIRDETCKFXQRCTOBFNWX


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

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import string
alphabet = string.ascii_uppercase

N = int(input())
chara = input()

for ch in chara:
  index = alphabet.index(ch)
  pr = (index + N) % 26
  print(pr,end = '')



Failing test case input:
0
YABXAZ

Expected output:
YABXAZ


Actual output:
240123025

Fixed submission (verdict: Accepted):
import string
alphabet = string.ascii_uppercase
 
N = int(input())
chara = input()
 
for ch in chara:
  index = alphabet.index(ch)
  pr = alphabet[(index + N) % 26]
  print(pr,end = '')

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = list(input())
alpha = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']

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

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())
alpha = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
buf = ''
for i in range(len(S)) :
    buf += alpha[(alpha.index(S[i]) + N) % 26]
print(buf)
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()
alph_list = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'
for i in s:
    pos =alph_list.find(i)
    print(alph_list[n+pos],end="")

Failing test case input:
13
ZYXWVUTSRQOGNMLKJIOGFEDCBA

Expected output:
MLKJIHGFEDBTAZYXWVBTSRQPON


Actual output:
mmmmmmmmmmmmmmmmmmmmmmmmmm

Fixed submission (verdict: Accepted):
n = int(input())
s = input()
alph_list = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in s:
    pos =alph_list.find(i)
    print(alph_list[n+pos],end="")

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

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


Failing test case input:
13
YYJXEUTUEPQGOWRKDEOGBNKAJR

Expected output:
LLWKRHGHRCDTBJEXQRBTOAXNWE


Actual output:
LL=K8HGH8CD:BJE>78B:5A>4=E


Fixed submission (verdict: Accepted):
n = int(input())
s = input()
ans = [''] * len(s)

for i in range(len(s)):
  rot = ord(s[i]) + n
  if rot > ord('Z'):
    rot -= (ord('Z') - ord('A') + 1)
    
  ans[i] = chr(rot)
  
print(''.join(ans))

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

ans = ""

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

print(ans)


Failing test case input:
13
ZYXWVUTSRQOGNMLKJIOGFEDCBA

Expected output:
MLKJIHGFEDBTAZYXWVBTSRQPON


Actual output:
77
76
75
74
73
72
71
70
69
68
66
84
65
90
89
88
87
86
66
84
83
82
81
80
79
78
MLKJIHGFEDBTAZYXWVBTSRQPON


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

ans = ""

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

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('Z') - ord('A'))
  tmp+=chr(chtmp)
print(tmp)


Failing test case input:
2
ABCXYZ

Expected output:
CDEZAB

Actual output:
CDEZBC


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 (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
string = str(input())
res = ''
for i in range(len(string)):
	temp = ''
	temp = chr((ord(string[i])+N)%26)
	res += temp 
print(''.join(res))


Failing test case input:
13
ZYDWMUTWKQPGOUSKJEOGBEESJA

Expected output:
MLQJZHGJXDCTBHFXWRBTORRFWN


Actual output:


		


Fixed submission (verdict: Accepted):
N = int(input())
string = str(input())
res = ''
for i in range(len(string)):
	temp = ''
	
	x = ord(string[i])-ord('A')
	x = (x+N)%26
	temp = chr(x+ord('A'))
	res += temp
print(''.join(res))
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = list(input())
res = []
for si in s:
    res.append(chr(ord(si) + n))
print(''.join(res).upper())


Failing test case input:
13
AIDEEFGOBJKLMNGOQRSTUVWXYZ

Expected output:
NVQRRSTBOWXYZATBDEFGHIJKLM


Actual output:
NVQRRST\OWXYZ[T\^_`ABCDEFG


Fixed submission (verdict: Accepted):
n = int(input())
s = list(input())
res = []
for si in s:
    new = ord(si) + n
    if new > 90:
        new += 6
    res.append(chr(new))
print(''.join(res).upper())

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()
k = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(s)):
  s = s.replace(s[i], k[(k.index(s[i])+n)%len(k)])
print(s)

Failing test case input:
13
KJASNBGNDDLHWOUQPEURTYXJEY

Expected output:
XWNFAOTAQQYUJBHDCRHEGLKWRL


Actual output:
KWNFNBGNQQYUWBUQCRURGYKWRY


Fixed submission (verdict: Accepted):
n = int(input())
s = list(input())
k = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(s)):
  s[i] = k[(k.index(s[i])+n)%len(k)]
s_change = "".join(s)
print(s_change)

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

Failing test case input:
0
ZXYABA

Expected output:
ZXYABA


Actual output:
BZACDC


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

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

ans_ls = []
for x in str:
    i = ord(x)
    if i <= 90:
        ans_ls.append(i)
    else:
        ans_ls.append(i - 26)
ls = []
for y in ans_ls:
    l = chr(y)
    ls.append(l)

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

Failing test case input:
13
AJSKMBGOEDKSWOGPQEUTUEXJYZ

Expected output:
NWFXZOTBRQXFJBTCDRHGHRKWLM


Actual output:
AJSKMBGOEDKSWOGPQEUTUEXJYZ


Fixed submission (verdict: Accepted):
num = int(input())
str = input()

ans_ls = []
for x in str:
    i = ord(x) + num
    if i <= 90:
        ans_ls.append(i)
    else:
        ans_ls.append(i - 26)
ls = []
for y in ans_ls:
    l = chr(y)
    ls.append(l)

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

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=input()
print(len(s))
ans=""
for i in range(len(s)):
    x=(ord(s[i])+n-65)%26+65
    ans=ans+chr(x)
print(ans)


Failing test case input:
0
YABXAZ

Expected output:
YABXAZ


Actual output:
6
YABXAZ


Fixed submission (verdict: Accepted):
n=int(input())
s=input()
ans=""
for i in range(len(s)):
    x=(ord(s[i])+n-65)%26+65
    ans=ans+chr(x)
print(ans)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
a = ''
for i in s:
  n = (ord(i) + 2) 
  a += chr(n)
print(a)

Failing test case input:
2
ABCXYZ

Expected output:
CDEZAB

Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
s = input()
a = ''
for i in s:
  n = ((ord(i) + N) - 65) % 26 + 65
  a += chr(n)
print(a)
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()
ans = ''
for i in s:
  ans += chr((ord(i)+n-1 - ord('A'))%26 + 1 + ord('A'))
print(ans)


Failing test case input:
13
KJASLCHODDPHWOUQNTEXUYRIBX

Expected output:
XWNFYPUBQQCUJBHDAGRKHLEVOK


Actual output:
XWNFYPUBQQCUJBHD[GRKHLEVOK


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

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-1))
    new_s = "".join(map(increment, s))
    print(new_s)
    


if __name__ == '__main__':
    main()


Failing test case input:
13
AISEEBGOFJKRUNGPQLXTUMWDYZ

Expected output:
NVFRROTBSWXEHATCDYKGHZJQLM


Actual output:
NVERROTASWXDG@TBCYJFGZIQKL


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



Failing test case input:
13
ZYDWMUTWEQPGOUSKJEOGBEKSJA

Expected output:
MLQJZHGJRDCTBHFXWRBTORXFWN


Actual output:
['Z', 'Y', 'D', 'W', 'M', 'U', 'T', 'W', 'E', 'Q', 'P', 'G', 'O', 'U', 'S', 'K', 'J', 'E', 'O', 'G', 'B', 'E', 'K', 'S', 'J', 'A']
MLQJZHGJRDCTBHFXWRBTORXFWN


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

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

Failing test case input:
13
XDIXYTRUENQUOWHPDENHBLASJK

Expected output:
KQVKLGEHRADHBJUCQRAUOYNFWX


Actual output:
eQVefa_bR[^b\dU]QR[UOYN`WX


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):
def rot(c):
    return chr(((ord(c) - ord('A') + 1) % 26) + ord('A'))

_ = input()
print(''.join(map(rot, input())))


Failing test case input:
0
YBCXAZ

Expected output:
YBCXAZ


Actual output:
ZCDYBA


Fixed submission (verdict: Accepted):
def _rot(N):
    def rot(c):
        return chr(((ord(c) - ord('A') + N) % 26) + ord('A'))
    return rot

rot = _rot(int(input()))
print(''.join(map(rot, input())))
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)


Failing test case input:
13
KJASNBGNDDKHWOUQPEURUYXJEY

Expected output:
XWNFAOTAQQXUJBHDCRHEHLKWRL


Actual output:
KWNFNBTNDDKUWBUDCRURULKWRL


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

Problem: p02848
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N=int(input())
S=input()
s=[]
for i in S:
    T=ord(i) - ord('A') + 1+N+64
    if T<=90:
        t=T
    else:
        t=T-26
    s.append(chr(t))
print(*s)



Failing test case input:
13
YYJXEUTUEPQGOWRKDEOGBNKAJR

Expected output:
LLWKRHGHRCDTBJEXQRBTOAXNWE


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


Fixed submission (verdict: Accepted):
N=int(input())
S=input()
s=[]
for i in S:
    T=ord(i) - ord('A') + 1+N+64
    if T<=90:
        t=T
    else:
        t=T-26
    s.append(chr(t))
print(*s,sep='')

Problem: p02848
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
s=input()
ans=[]
for i in range(len(s)):
    num=ord(s[i])+n
    if num>90:
        num-=25
    ans.append(chr(num))
ans="".join(ans)
print(ans)

Failing test case input:
13
YEJXYUUUEPQROWGKDENGBNSAJK

Expected output:
LRWKLHHHRCDEBJTXQRATOAFNWX


Actual output:
MRWLMIIIRDEFCKTXQRBTOBGNWX


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

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

Failing test case input:
2
ZYXDBA

Expected output:
BAZFDC


Actual output:
BA@FDC


Fixed submission (verdict: Accepted):
N = int(input())
S = str(input())
def rot(s, num):
    ans = []
    for i in range(len(s)):
        temp = ord(s[i])
        if 65 <= temp + num <= 90:
            ans.append(chr(temp + num))
        else:
            ans.append(chr(65 + (temp + num) - 91))
    temp_ans = "".join(ans)
    return temp_ans
print(rot(s = S, num = N))
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=input()

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

print("".join(t))

Failing test case input:
13
KJASYCHODDPHWOUQNTDXUKRIBX

Expected output:
XWNFLPUBQQCUJBHDAGQKHXEVOK


Actual output:
XWN`fPU\QQ]Ud\b^[aQebX_VOe


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

print("".join(t))

Problem: p02848
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N=int(input())
S=input()
for c in S:
  print(''.join(chr( (ord(c)-ord("A")+N) %26 + ord("A") )))

Failing test case input:
13
XDIXYTRUENQUOWHPDENHBLASJK

Expected output:
KQVKLGEHRADHBJUCQRAUOYNFWX


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


Fixed submission (verdict: Accepted):
N=int(input())
S=input()
ans=[]
for c in S:
  ans.append(chr( (ord(c)-ord("A")+N) %26 + ord("A") ))
print(''.join(ans))

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()
A = ''
for i in range(len(S)):
    if ord(S[i])+N <= 90:
        A += chr(ord(S[i])+N)
        print(A)
    else:
        A += chr(ord(S[i])+N-26)
        print(A)
print(A)

Failing test case input:
2
ZAAXCX

Expected output:
BCCZEZ


Actual output:
B
BC
BCC
BCCZ
BCCZE
BCCZEZ
BCCZEZ


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
A = ''
for i in range(len(S)):
    if ord(S[i])+N <= 90:
        A += chr(ord(S[i])+N)
    
    else:
        A += chr(ord(S[i])+N-26)
        
print(A)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def changeStr(num, charactor):
  sum = num + ord(charactor)
  if sum > 65 + 26 :
    return chr(sum - 26)
  else:
    return chr(sum)

inputStr = [input() for i in range(2)]
num = int(inputStr[0])
targetStr = inputStr[1]

for target in list(targetStr):
  print(changeStr(num, target))

Failing test case input:
13
KJASYCHODDPHWOUQNTDXUKRIBX

Expected output:
XWNFLPUBQQCUJBHDAGQKHXEVOK


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


Fixed submission (verdict: Accepted):
def changeStr(num, charactor):
  sum = num + ord(charactor)
  if sum > 64 + 26 :
    return chr(sum - 26)
  else:
    return chr(sum)

inputStr = [input() for i in range(2)]
num = int(inputStr[0])
targetStr = inputStr[1]

for target in list(targetStr):
  print(changeStr(num, target), end="")
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input());
s = input();
ans = []

for i in s:
    num = ord(i) + n;
    
    num = num - ord("a")
    num = num % 26 
    print(num)
    ans.append(chr(num  + ord("a")))

new = ""
for j in ans:
    new += j

print(new.upper())

Failing test case input:
13
XBIRLUXETNQUOWHPDDOHCYSAJK

Expected output:
KOVEYHKRGADHBJUCQQBUPLFNWX


Actual output:
4
8
15
24
18
1
4
11
0
20
23
1
21
3
14
22
10
10
21
14
9
5
25
7
16
17
EIPYSBELAUXBVDOWKKVOJFZHQR


Fixed submission (verdict: Accepted):
n = int(input());
s = input();
ans = []

for i in s:
    num = ord(i) + n;
    
    num = num - ord("A")
    num = num % 26
    ans.append(chr(num  + ord("A")))
    
new = ""
for j in ans:
    new += j

print(new.upper())

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()
fin = ''
for i in range(len(s)):
  t = ord(s[i])-ord('A')+n 
  if (t > 25):
    fin += chr(ord(s[i])+t-26)
  else:
    fin +=chr(ord(s[i])+t)
print(fin)

Failing test case input:
13
ZYJXMUTUEQPGOWSKDEOGBEKSJA

Expected output:
MLWKZHGHRDCTBJFXQRBTORXFWN


Actual output:
fd`bf\Z\VTRZP`XbTVPZPVbX`N


Fixed submission (verdict: Accepted):
n = int(input())
s = input()
fin = ''
for i in range(len(s)):
  t = ord(s[i])-ord('A')+n 
  if (t > 25):
    fin += chr(ord('A')+t-26)
  else:
    fin +=chr(ord('A')+t)
print(fin)

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


n = int(input())
str = input()
alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
str_list=list(str)
alphabet_list=list(alphabet)



i=0
j=0
if n==0:
    pass
else:
 for i in range(len(str)):
    for j in range(len(alphabet)):
        
        
        if str_list[i]==alphabet_list[j]:
            
            
    
    
    
             
             
    
        
        

                str_list[i]=alphabet_list[(n%26+j)%25-1]
                break
        else:
           pass

mojiretu=''.join(str_list)
print(mojiretu)


Failing test case input:
13
YEJXYUUUEPQGOWRKDENGBNSAJK

Expected output:
LRWKLHHHRCDTBJEXQRATOAFNWX


Actual output:
LQVKLHHHQCDSBJEWPQASNAFMVW


Fixed submission (verdict: Accepted):


n = int(input())
str = input()
alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
str_list=list(str)
alphabet_list=list(alphabet)



i=0
j=0
if n==0:
    pass
else:
 for i in range(len(str)):
    for j in range(len(alphabet)):
        
        
     if str_list[i]==alphabet_list[j]:
            
            
           if n%26+j >= 26:
             
             
             str_list[i]=alphabet_list[(n%26+j)%26]
             break
             
             
           else:
                
                

                str_list[i]=alphabet_list[(n%26+j)%26]
                break
     else:
           pass

mojiretu=''.join(str_list)
print(mojiretu)
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=input()

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

Failing test case input:
13
YEJXYUUUEPQGOWRKDEOGBNSAJK

Expected output:
LRWKLHHHRCDTBJEXQRBTOAFNWX


Actual output:
MRWLMIIIRDETCKFXQRCTOBGNWX


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

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

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


Failing test case input:
2
ZXXBDA

Expected output:
BZZDFC


Actual output:
\ZZDFC


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

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

Failing test case input:
0
YBBXAZ

Expected output:
YBBXAZ


Actual output:

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

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
S=input()
S_=[]
T=['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 j in range(len(S)):
    for i in range(len(T)):
        if S[j] == T[i]:
            if i+N>=len(T):
                S_.append(T[i+N-len(T)])
            else:
                S_.append(T[i+N])
            break

print(S_)

Failing test case input:
13
YYJXEUTUEPQGOWRKDEOGBNRAJK

Expected output:
LLWKRHGHRCDTBJEXQRBTOAENWX


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

Fixed submission (verdict: Accepted):
N=int(input())
S=input()
S_=[]
T=['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 j in range(len(S)):
    for i in range(len(T)):
        if S[j] == T[i]:
            if i+N>=len(T):
                S_.append(T[i+N-len(T)])
            else:
                S_.append(T[i+N])
            break

y=""
for x in S_:
    y+=x

print(y)
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()
L = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
A = ''
for i in S:
  N = L.index(i)
  if N == 25:
    N = 0
  else:
    N += 1
  A += L[N]
print(A)

Failing test case input:
13
KJASLCHODDPHWOUQNTEXUYRIBX

Expected output:
XWNFYPUBQQCUJBHDAGRKHLEVOK


Actual output:
LKBTMDIPEEQIXPVROUFYVZSJCY


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
L = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
A = ''
for i in S:
  X = L.index(i) + N
  while X >= 26:
    X -= 26
  A += L[X]
print(A)

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

ans = []
for i in S:
    s = int(ord(i)) + N
    if s > 90:
        ans.append(chr(s % 90 + 65))
    else:
        ans.append(chr(s % 65 + 65))

print(''.join(ans))


Failing test case input:
13
KJSALBHNDDPHWOUQNEURTYXIDX

Expected output:
XWFNYOUAQQCUJBHDARHEGLKVQK


Actual output:
XWGNYOUBQQDUKCIEBRIFHMLVQL


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

ans = []
for i in S:
    s = int(ord(i)) + N
    if s > 90:
        ans.append(chr(s % 91 + 65))
    else:
        ans.append(chr(s % 65 + 65))

print(''.join(ans))

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

splitedInput = list(S)
wordCount = len(splitedInput)
for i in range(wordCount):
    convertAscii = ord(splitedInput[i]) + N
    if convertAscii > ord("Z"):
        convertAscii = convertAscii - ord("Z") + ord("A") - 1
    conversion = chr(convertAscii)
    codePoint.append(conversion)

print(codePoint)

Failing test case input:
13
AIDDEFGOBJKLMNGOQRSTUVWXYZ

Expected output:
NVQQRSTBOWXYZATBDEFGHIJKLM


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

Fixed submission (verdict: Accepted):
N = int(input())
S = input()
codePoint = []

splitedInput = list(S)
wordCount = len(splitedInput)
for i in range(wordCount):
    convertAscii = ord(splitedInput[i]) + N
    if convertAscii > ord("Z"):
        convertAscii = convertAscii - ord("Z") + ord("A") - 1
    conversion = chr(convertAscii)
    codePoint.append(conversion)

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

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = input()
ans = ""
for i in range(len(s)):
    index = ord(s[i]) + n
    if index > ord("Z"):
        index = index - ord("Z") - 1
    
    ans += chr(index)
print(ans)


Failing test case input:
2
ZABXCX

Expected output:
BCDZEZ


Actual output:
CDZEZ


Fixed submission (verdict: Accepted):
n = int(input())
s = input()
ans = ""
for i in range(len(s)):
    index = ord(s[i]) + n
    if index > ord("Z"):
        index = (index - ord("Z") - 1) + (ord("A"))
    
    ans += chr(index)
print(ans)
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



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)

Failing test case input:
13
ZYJXEUTUEQPGOWSKDEOGBMKSJA

Expected output:
MLWKRHGHRDCTBJFXQRBTOZXFWN


Actual output:
NMWLRIHIREDTCKGXQRCTOAXGWN


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 (2.4.0), verdict: Wrong Answer):
import math

n=int(input())
s=input()
t=''
num1=lambda c:chr(c+64)
for i in range(len(s)):
  t+=num1((ord(s[i])-64+n)%26)
print(t)


Failing test case input:
13
AIDDEFGOBJKLMNGOQRSTUVWXYZ

Expected output:
NVQQRSTBOWXYZATBDEFGHIJKLM


Actual output:
NVQQRSTBOWXY@ATBDEFGHIJKLM


Fixed submission (verdict: Accepted):
import math

n=int(input())
s=input()
t=''
num1=lambda c:chr(c+65)
for i in range(len(s)):
  t+=num1((ord(s[i])-65+n)%26)
print(t)

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

A = ord('A')

T = [chr(A + (ord(c) - A + N) % 26) for c in S]

print(T)

Failing test case input:
0
YXAABZ

Expected output:
YXAABZ


Actual output:
Y, X, A, A, B, Z

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

A = ord('A')

T = ''.join([chr(A + (ord(c) - A + N) % 26) for c in S])

print(T)

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
  ans.append(al[num])
print(ans)

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):
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 (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
S=input()
l=[0]*len(S)
for i in range(len(S)):
    if ord(S[i])+2<=90:
        print(ord(S[i]))
        l[i]=chr(ord(S[i])+N)
    else:
        l[i]=chr(ord(S[i])+N-26)
print(''.join(l))


Failing test case input:
13
ZYDWMUTXLQPGNURKJEOGBEESIA

Expected output:
MLQJZHGKYDCTAHEXWRBTORRFVN


Actual output:
68
87
77
85
84
88
76
81
80
71
78
85
82
75
74
69
79
71
66
69
69
83
73
65
MLQdZbaeY^]T[b_XWR\TORR`VN


Fixed submission (verdict: Accepted):
N=int(input())
S=input()
l=[0]*len(S)
for i in range(len(S)):
    if ord(S[i])+N<=90:
        l[i]=chr(ord(S[i])+N)
    else:
        l[i]=chr(ord(S[i])+N-26)
print(''.join(l))
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = input()

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

Failing test case input:
13
YYJXEUTUEQQGOWRKDEOGBNKAJR

Expected output:
LLWKRHGHRDDTBJEXQRBTOAXNWE


Actual output:
ffWeRbabR^^T\d_XQR\TO[XNW_


Fixed submission (verdict: Accepted):
N = int(input())
S = input()
 
S = ''.join([chr(ord('A')+(ord(s)-ord('A')+N)%26) for s in S])
print(S)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
S=input()
Z='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
List=[]
y=0
for i in range(len(S)):
  for j in range(len(Z)):
    if S[i]==Z[j]:
        y=Z[(j+N)%26]
    else:
        pass

  List.append(y)

print(List)

Failing test case input:
13
ABCDEFGGIJKLMNOPQRSTUVWXYZ

Expected output:
NOPQRSTTVWXYZABCDEFGHIJKLM


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

Fixed submission (verdict: Accepted):
N=int(input())
S=input()
Z='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
List=[]
y=0
for i in range(len(S)):
  for j in range(len(Z)):
    if S[i]==Z[j]:
        y=Z[(j+N)%26]
    else:
        pass

  List.append(y)

a=List[0]
for i in range(1,len(S)):
    a=a+List[i]
    
print(a)

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
S=input()
Z='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(S)):
  for j in range(len(Z)):
    if S[i]==Z[j]:
        print(Z[(j+N)%26])
    else:
        pass

Failing test case input:
13
ZYXWUUTSLQOGNMRKJBOGFEEDIA

Expected output:
MLKJHHGFYDBTAZEXWOBTSRRQVN


Actual output:
M
L
K
J
H
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=input()
Z='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
List=[]
y=0
for i in range(len(S)):
  for j in range(len(Z)):
    if S[i]==Z[j]:
        y=Z[(j+N)%26]
    else:
        pass

  List.append(y)

a=List[0]
for i in range(1,len(S)):
    a=a+List[i]
    
print(a)

Problem: p02848
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
num = int(input())

node = input()
table = list(node)


for i in table:
    aaa = ((ord(i)) + num) % 26
    print(chr(aaa))
	



Failing test case input:
13
AIDEEFGOBJKLMNGOQRSTUVWXYZ

Expected output:
NVQRRSTBOWXYZATBDEFGHIJKLM


Actual output:









	



















Fixed submission (verdict: Accepted):
num = int(input())

node = input()
table = list(node)


for i in table:
    aaa = ord('A') + ((ord(i) - (ord('A')) + num) % 26)
    print(chr(aaa), end='')

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=input()
cnt=len(s)
a='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans=''
for i in range(cnt):
  ans=ans+a[(i+n)%26]
print(ans)  
  

Failing test case input:
13
KJASNBGNDDLHWOUQPEURTYXJDY

Expected output:
XWNFAOTAQQYUJBHDCRHEGLKWQL


Actual output:
NOPQRSTUVWXYZABCDEFGHIJKLM


Fixed submission (verdict: Accepted):
n=int(input())
s=input()
cnt=len(s)
a='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans=''
for i in range(cnt):
  
  l=a.index(s[i])
  ans=ans+a[(l+n)%26]
print(ans)
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
kotae=[]
N = int(input())
Sst=input()
S = list(Sst)
L=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','Q','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','Q','V','W','X','Y','Z','A','B','C']

for i in range(len(Sst)):
    for j in range(26):
        if S[i] == L[j]:
            kotae.append(L[j+N])

Sed = "".join(kotae)
print(Sed)

Failing test case input:
13
ZYXWVUTSLQOGNMRKJBOGFEEDIA

Expected output:
MLKJIHGFYDBTAZEXWOBTSRRQVN


Actual output:
MLKJIGFYDHBTAZEXWOBTSRRQVN


Fixed submission (verdict: Accepted):
kotae=[]
N = int(input())
Sst=input()
S = list(Sst)
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','A','B','C']

for i in range(len(Sst)):
    for j in range(26):
        if S[i] == L[j]:
            kotae.append(L[j+N])

Sed = "".join(kotae)
print(Sed)

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

Failing test case input:
0
YABXAZ

Expected output:
YABXAZ


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):
n = int(input());
s = input();
ans = []

for i in s:
    num = ord(i) + n;
    
    num = num - ord("a")
    num = num % 26 
    print(num)
    ans.append(chr(num  + ord("a")))

new = ""
for j in ans:
    new += j

print(new)

Failing test case input:
13
YEJXYTRUEPQUOWHLDDNGBNSAJK

Expected output:
LRWKLGEHRCDHBJUYQQATOAFNWX


Actual output:
5
11
16
4
5
0
24
1
11
22
23
1
21
3
14
18
10
10
20
13
8
20
25
7
16
17
flqefayblwxbvdoskkuniuzhqr


Fixed submission (verdict: Accepted):
n = int(input());
s = input();
ans = []

for i in s:
    num = ord(i) + n;
    
    num = num - ord("A")
    num = num % 26
    ans.append(chr(num  + ord("A")))
    
new = ""
for j in ans:
    new += j

print(new.upper())
Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

def main(N, S):
    base = ord('A')
    res = ''.join(chr((ord(s) - base + N) % 26 + base) for s in S)
    print(res)


if __name__ == "__main__":
    N = int(input('N >'))
    S = input('S >')
    main(N, S)



Failing test case input:
2
ZXBXCA

Expected output:
BZDZEC


Actual output:
N >S >BZDZEC


Fixed submission (verdict: Accepted):

def main(N, S):
    base = ord('A')
    res = ''.join(chr((ord(s) - base + N) % 26 + base) for s in S)
    print(res)


if __name__ == "__main__":
    N = int(input(''))
    S = input('')
    main(N, S)

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

plain = ''

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

print(plain)

Failing test case input:
0
AXYABZ

Expected output:
AXYABZ


Actual output:
ursuvt


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.8.2), verdict: Wrong Answer):
N = int(input())
S = input()

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

Failing test case input:
13
KJASNBGNDDKHWORQPEUUUYXJEY

Expected output:
XWNFAOTAQQXUJBEDCRHHHLKWRL


Actual output:
XWNGBOTBQQXUKCFEDRIIIMLWRM


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

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

Problem: p02848
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
str = [input() for i in range(1)]
STRING=str[0]
enc = ""

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

Failing test case input:
13
RJAKNBGOEDKRWOGPQEUTUEXJYZ

Expected output:
EWNXAOTBRQXEJBTCDRHGHRKWLM


Actual output:
EWNX[OTBRQXEJBTCDRHGHRKWLM


Fixed submission (verdict: Accepted):
N = int(input())
str = [input() for i in range(1)]
STRING=str[0]
enc = ""

for i in list(STRING):
    ASCII = ord(i)
    num = ASCII - 65
    num = (num + N % 26)
    ASCII = num + 65
    if ASCII > 90:
        ASCII -= 26
    enc += chr(ASCII)
print(enc)
Problem: p02848
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
N = int(input())
S = input()
alp = "ABCDEFGHIJKLMNOPQRSTUWVXYZABCDEFGHIJKLMNOPQRSTUWVXYZ"
for s in S:
    sys.stdout.write(alp[ord(s) - 65 + N])

Failing test case input:
13
ABCDEFGGIJKLMNOPQRSTUVWXYZ

Expected output:
NOPQRSTTVWXYZABCDEFGHIJKLM


Actual output:
NOPQRSTTWVXYZABCDEFGHIJKLM

Fixed submission (verdict: Accepted):
import sys
N = int(input())
S = input()
alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
for s in S:
    sys.stdout.write(alp[ord(s) - 65 + N])

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

l = []
for i in range(26):
  if z[i] in s:
    l.append(z[i+n])

print(''.join(l))

Failing test case input:
13
XBIXYERUTNQUOWHPDDNHBLSAJK

Expected output:
KOVKLREHGADHBJUCQQAUOYFNWX


Actual output:
NOQRUVWXYABCDEFGHJKL


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

l = []
for x in s:
  if x in z:
    l.append(z[(z.index(x))+n])

print(''.join(l))

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

ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUWVXYZ'
ALPHABET_LEN = len(ALPHABET)
prceed_val = n % ALPHABET_LEN

def trans(s):
    pos = ALPHABET.index(s)


    newpos = pos + prceed_val


    if newpos > ALPHABET_LEN - 1:
        newpos = abs(ALPHABET_LEN - newpos)




    new_s = ALPHABET[newpos]
    return new_s

new_str= ''.join([trans(_s) for _s in s])

print(new_str)




Failing test case input:
13
KJASLCHNDDPHWOUQNTEXUYRIBX

Expected output:
XWNFYPUAQQCUJBHDAGRKHLEVOK


Actual output:
XVNFYPUAQQCUIBHDAGRKHLEWOK


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

ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ALPHABET_LEN = len(ALPHABET)
prceed_val = n % ALPHABET_LEN

def trans(s):
    pos = ALPHABET.index(s)


    newpos = pos + prceed_val


    if newpos > ALPHABET_LEN - 1:
        newpos = abs(ALPHABET_LEN - newpos)




    new_s = ALPHABET[newpos]
    return new_s

new_str= ''.join([trans(_s) for _s in s])

print(new_str)
Problem: p03909
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
h, w = map(int, input().split())

A = []
t = 0
u = 0
for i in range(h):
    s = list(input().split())
    
    if s.count("snuke") >= 1:
        t = s.index("snuke")
        print(t)
        u = i
        break

print(chr(ord('A') + t) + str(u+1))

Failing test case input:
15 10
snake smake snake knase sneka snake snake snake snake snake
snake snake snake snake snake snake rnake snake snake snake
snake snake ekans snake snake elans sneka snake snake snake
snake snake snake snafk snake snake snake snake snake snake
snake snake snake anske snake snake snake tnake snake snake
sneka snake snake snake snake snake snake snuke snake snake
snakd snake snake snake snake snake snake ekans sneka ekans
snake snake snake sanje snake snake snake snake snake snake
snake snake smake snake snake skane snake snake snake snake
snake snake anske ekans snake snbke snake ekans snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake snake snake
snake snake snake snake snake snake snake snake ekans snake
snake snake snake snake snaje snake snake snake ekans snake
snake snake snake snake snake snake snake snake sneka snake

Expected output:
H6


Actual output:
7
H6


Fixed submission (verdict: Accepted):
h, w = map(int, input().split())

A = []
t = 0
u = 0
for i in range(h):
    s = list(input().split())
    
    if s.count("snuke") >= 1:
        t = s.index("snuke")
        u = i
        break

print(chr(ord('A') + t) + str(u+1))

Problem: p03909
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H, W = map(int, input().split())
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
S = [input() for _ in range(H)]
for i in range(H):
  for j in range(W):
    if S[i][j] == "snuke":
      print("{}{}".format(alpha[j], i+1))

Failing test case input:
15 10
snake smake snake knase sneka snake snake snbke snake snake
snake snake ekans snake snake snake rnake ekans ekans knase
snake akeos ekans snake snake elans sneka snake reakn snake
snake snake sn`ke fnask snake snake ekans snake snake snake
ekans snake snake naske ekans ekans snake tnake snake snake
sneka snake snake snake snake snake snake snuke snake snake
rnakd snake snake snake snake snake snbke ekans sneka snake
snake enaks ekans sanje snake sn`ke snake sn`ke snake snake
snake tnake smake snake snake skane snake knase snake snake
knase sneka anske ekans snake snbke snake ekans snake snake
sanke snake snake snake ekbns snake tnake ekans snake snake
snake snake snake snake seakn snkaf snake soake snble skane
snake snake snake snake snake snake snbke snaje ekans snake
snake snake sndka snake ejans snake snaje sneka ekans snake
snake snake ekans snake sn`ke snake ekans snake sneka snake

Expected output:
H6


Actual output:

Fixed submission (verdict: Accepted):
H, W = map(int, input().split())
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
S = [list(map(str, input().split())) for _ in range(H)]
for i in range(H):
  for j in range(W):
    if S[i][j] == "snuke":
      print("{}{}".format(alpha[j], i+1))
Problem: p03909
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H, W = map(int, input().split())
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
S = [input() for _ in range(H)]
for i in range(H):
  for j in range(W):
    if S[i][j] == "snuke":
      print("{}{}".format(i+1, alpha[j]))

Failing test case input:
15 10
snake smake snake knase sneka snake snake snake snake snake
snake snake ekans snake snake snake rnake ekans snake snake
snake snake ekans snake snake elans sneka snake snake snake
snake snake snake fnask snake snake ekans snake snake snake
ekans snake snake anske ekans snake snake tnake snake snake
sneka snake snake snake snake snake snake snuke snake snake
snakd snake snake snake snake snake snake ekans sneka ekans
snake enaks snake sanje snake snake snake snake snake snake
snake snake smake snake snake skane snake snake snake snake
snake snake anske ekans snake snbke snake ekans snake snake
sanke snake snake snake snake snake snake ekans snake snake
snake snake snake snake snake snake snake snake snale skane
snake snake snake snake snake snake snake snake ekans snake
snake snake snake snake snaje snake snake sneka ekans snake
snake snake ekans snake snake snake snake snake sneka snake

Expected output:
H6


Actual output:

Fixed submission (verdict: Accepted):
H, W = map(int, input().split())
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
S = [list(map(str, input().split())) for _ in range(H)]
for i in range(H):
  for j in range(W):
    if S[i][j] == "snuke":
      print("{}{}".format(alpha[j], i+1))

Problem: p03909
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h, w = map(int, input().split())
ls = [input().split() for _ in range(h)]

for i in range(h):
	for j in range(w):
		if ls[i][j] == 'snuke':
			print(chr(65 + i) + str(j + 1))
			break

Failing test case input:
15 10
snake smake snake knase sneka snake snake snake snake snake
snake snake ekans snake snake snake rnake ekans ekans snake
snake akeos ekans snake snake elans sneka snake rnake snake
snake snake sn`ke fnask snake snake ekans snake snake snake
ekans snake snake naske ekans ekans snake tnake snake snake
sneka snake snake snake snake snake snake snuke snake snake
rnakd snake snake snake snake snake snbke ekans sneka snake
snake enaks ekans sanje snake sn`ke snake snake snake snake
snake tnake smake snake snake skane snake knase snake snake
knase sneka anske ekans snake snbke snake ekans snake snake
sanke snake snake snake ekbns snake tnake ekans snake snake
snake snake snake snake snake snkaf snake soake snale skane
snake snake snake snake snake snake snbke snake ekans snake
snake snake sndka snake ejans snake snaje sneka ekans snake
snake snake ekans snake sn`ke snake snake snake sneka snake

Expected output:
H6


Actual output:
F8


Fixed submission (verdict: Accepted):
h, w = map(int, input().split())
ls = [input().split() for _ in range(h)]

for i in range(h):
	for j in range(w):
		if ls[i][j] == 'snuke':
			print(chr(65 + j) + str(i + 1))
			break