problem_id
stringlengths 6
6
| buggy_code
stringlengths 8
526k
⌀ | fixed_code
stringlengths 12
526k
⌀ | labels
listlengths 0
15
⌀ | buggy_submission_id
int64 1
1.54M
⌀ | fixed_submission_id
int64 2
1.54M
⌀ | user_id
stringlengths 10
10
⌀ | language
stringclasses 9
values |
|---|---|---|---|---|---|---|---|
p02848
|
k=int(input())
s=input()
n=len(s)
temp=""
for i in range(n):
z=ord(s[i])+k
if z>122:
z-=26
temp+=chr(z)
print(temp)
|
k=int(input())
s=input()
n=len(s)
temp=""
for i in range(n):
z=ord(s[i])+k
if z>90:
z-=26
temp+=chr(z)
print(temp)
|
[
"literal.number.integer.change",
"control_flow.branch.if.condition.change"
] | 654,628
| 654,629
|
u185405877
|
python
|
p02848
|
k=int(input())
s=input()
n=len(s)
temp=""
for i in range(n):
z=ord(s[i])+k
if z>123:
z-=27
temp+=chr(z)
print(temp)
|
k=int(input())
s=input()
n=len(s)
temp=""
for i in range(n):
z=ord(s[i])+k
if z>90:
z-=26
temp+=chr(z)
print(temp)
|
[
"literal.number.integer.change",
"control_flow.branch.if.condition.change"
] | 654,630
| 654,629
|
u185405877
|
python
|
p02848
|
# -*- coding: utf-8 -*-
import sys
import fractions
import copy
import bisect
import math
import numpy as np
import itertools
from itertools import combinations_with_replacement
#import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
from operator import itemgetter
from sys import stdin
#input = sys.stdin.readline#こっちの方が入力が早いが使える時に使っていこう
from operator import mul
from functools import reduce
from collections import Counter
#from collections import deque
#input = stdin.readline
j=0
k=0
n=3
r=1
a=[0]
#n=int(input())
#r=int(input())
#print(M)
#A=int(input())
#B=int(input())
#print(N)
"1行1つの整数を入力を取得し、整数と取得する"
#number_list=list(map(int, input().split(" ")))#数字の時
#print(number_list)
"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
#メモ
for i in number_list:#こっちの方がrage使うより早いらしい
print(number_list[i-1])#
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''
x=[]
y=[]
for i in range(N):
x1, y1=[int(i) for i in input().split()]
x.append(x1)
y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''
'''
mixlist=[]
for i in range(N):
a,b=input().split()
mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ,今回はリスト一つで処理している"
'''
'''
#array=[input().split()for i in range(N)]
#print(type(array[0][0]))
#print(array)
"正方行列にstr型の値を入力"
'''
#brray=[list(map(int, input().split(" ")))for i in range(N)]
#print(type(brray[0][0]))
#print(brray)
'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"
#以下に別解を記載
#N, M = [int(i) for i in input().split()]
'''
table = [[int(i) for i in input().split()] for m in range(m)]
print(type(N))
print(N)
print(type(M))
print(M)
print(type(table))
print(table)
'''
#s=input()
#a=[int(i) for i in s]
#print(a[0])
#print([a])
#単数値.桁ごとに分割したい.入力と出力は以下の通り
#イメージとして1桁ごとにリストに値を入れているかんじ
#intを取ると文字列分解に使える
'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''
'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''
'''
A, B, C=stdin.readline().rstrip().split()#str style 何個でもいけることが多い
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''
#a= stdin.readline().rstrip()
#print(a.upper())
"aという変数に入っているものを大文字にして出力"
#a,b=map(int, input().split()) #int style 複数数値入力 「A B」みたいなスペース空いた入力のとき
#なんかうまく入力されるけど
#a=[[int(i) for i in 1.strip()]for 1 in sys.stdin]
#a = [[int(c) for c in l.strip()] for l in sys.stdin]]
#print(a)
#複数行の数値を入力して正方行列を作成
##############################################################################################
##############################################################################################
#under this line explains example calculation
'''
コンビネーションの組み合わせの中身を出力する形式
for i in itertools.combinations(brray, 2)
combinationsをpermutationsにすれば順列になる
今回なら(abc133B)
入力
1 2
5 5
-2 8
出力
[[1, 2], [5, 5], [-2, 8]]
もちろん一次元リストでも使えるし
何よりiもリストのように使えるので便利
'''
#nCr combination
'''
def cmb(n,r):
#When n < r , this function isn't valid
r= min(n-r,r)
#print(n,r)
if r == 0: return 1
over = reduce(mul, range(n, n-r, -1))
#flochart mul(n,n-1)=x
#next mul(x,n-2)........(n-r+1,n-r)
#mul read a,b and returns a*b
under = reduce(mul, range(1, r+1))
#print(over, under)
#reduce is applied mul(1,2)=2
#next mul(2,3)=6
#next mul(6,4)=4.........last(r!,r+1)=r+1!
return over // under
#// is integer divide
#calc example 5C2
#over=5*4*3
#under=3*2*1
a = cmb(n, r)
#print(a)
'''
'''
import itertools
from itertools import combinations_with_replacement
combinationについて
以下の違いを意識しよう
combinations() p, r 長さrのタプル列、ソートされた順で重複なし
combinations_with_replacement() p, r 長さrのタプル列、ソートされた順で重複あり
使用例 出力
combinations('ABCD', 2) AB AC AD BC BD CD
combinations_with_replacement('ABCD', 2) AA AB AC AD BB BC BD CC CD DD
'''
'''
#集計
#example
#a=[2,2,2,3,4,3,1,2,1,3,1,2,1,2,2,1,2,1]
#a=Counter(a)
for i in a.most_common(n):print(i)
#most_common()メソッドは、出現回数が多い要素順にCounterオブジェクトを並び替えます。
#引数にint型の数字nを設定した場合は、出現回数が高い上位n個の要素を返します。
#何も設定しなければ、コンテナ型にあるすべての要素を出現回数の順番に並び替えたタプル型オブジェクトを返します。
#out put
#(2, 8)
#(1, 6)
#(3, 3)
#(4, 1)
'''
#二部探索(binary search)
#A = [1, 2, 3, 3, 3, 4, 4, 6, 6, 6, 6]
#print(A)
#index = bisect.bisect_left(A, 5) # 7 最も左(前)の挿入箇所が返ってきている
#A.insert(index, 5)
#print(index)
#print(A)
'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''
'''
素数の判定
'''
def is_prime(n):
if n == 1: return False
for k in range(2, int(np.sqrt(n)) + 1):
#sqrt(n)+1以上は考えて約数はないので却下
if n % k == 0:
return False
#割り切れたらFalse
return True
'''
npのmaxとmaximumの違い
xs = np.array([1, -2, 3])
np.max(xs, 0)
この出力は3となります.[1, -2, 3]と0の4つの数字のうち,最も大きい値を出力します.
一方で,[max(1, 0), max(-2, 0), max(3, 0)]を出力したい時があります.
その時は,numpyのmaximum関数を用います.
xs = np.array([1, -2, 3])
np.maximum(xs, 0) # [1, 0, 3]
'''
def factorial(x, mod=10**9+7):
# x!
# 階乗
# ex) factorial(5) = 120
tmp = 1
for i in range(1, x+1):
tmp = (tmp * i) % mod
return tmp
'''
Basically, when you do a**d % n, you actually have to calculate a**d, which could be quite large.
But there are ways of computing a**d % n without having to compute a**d itself, and that is what pow does.
'''
########################################################################
########################################################################
#b2=a[:] #1次元のときはコピーはこれで良い
#print(b2)
#a= [[0]*3 for i in range(5)] #2次元配列はこう準備、[[0]*3]*5だとだめ
#b3=copy.deepcopy(a) #2次元配列はこうコピーする
#print(b3)
def main():
n=3
steps=0
state=0
w=1
j=0
k=0
n=int(input())
s=input()
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
#a,b=input().split(" ")#a,bがともに文字列のとき
#a,b=map(int, input().split(" "))
#mapでとってもstrで変換すればappend可能
#nl=list(map(int, input().split(" ")))#数字の時
#s=input()
a=[i for i in ascii_uppercase]#int取るとstrでも行ける
b=[i for i in s]#int取るとstrでも行ける
c=[]
a.insert(0, 'AAAAA')
#print(a)
for i in range(len(b)):
x=a.index(b[i])
c.append(a[(x+n)%26])
print(''.join(c))
#print(a)
#brray=[list(map(int, input().split(" ")))for i in range(N)
#print(brray)
for i in range(1,n+1,2):#これで1個飛ばしループになる
pass
#print(i)
l = ['aaa', 'bbb', 'ccc']
#s = ''.join(l)
#print(s)
# aaabbbccc
#if state in known_states and not flag: # state => 2 steps => 5
#こうやってある要素がリストの中にあるか探すのか
#print(f'steps: {steps}, state: {state}')
#こう書いてあるとデバックしやすい
#dp= [[0]*3 for i in range(5)]#列 行
#dp用の0の入ったやつ
#dp= [[0]*(w+1) for i in range(n+1)]#0からwまでのw+1回計算するから
#print(dp)#初期条件が入る分計算回数+1列分必要(この場合は判断すべきものの数)
DP = np.zeros(w+1, dtype=int)#これでも一次元リストが作れる
exdp=np.zeros((3,4)) # 3×4の2次元配列を生成。2次元ならこう
#dtypeは指定しないとfloatになる
#for i in range(n):#ちょっとした入力に便利
# a, b = map(int, input().split())
#dp[i][0] += [a]
#これだとintとlistをつなぐことになって不適
# dp[i] += [a]
# dp[i] += [b]
#これはうまくいく
#やり方はいろいろあるということ
#print(dp)
#brray=[list(map(int, input().split(" ")))for i in range(N)
#print(brray)
'''
入力
1234
出力
[1, 2, 3, 4]
'''
pin_l=["x" for i in range(10)]#内包表記に慣れろ
#print(pin_l)
ls = ["a", "b", "c", "d", "e"]
#print(ls[2:5])
#スライスでの取得
#print(ls[:-3])
#一番左端から右から3番目より左まで取得
#print(ls[:4:2])
#スライスで1個飛ばしで取得
#ないときは左端スタート
#始点のインデックス番号 : 終点のインデックス番号 : スキップする数+1
#print(ls[::2])
'''
lsというリストの場合に、1つ飛びの値を取得したい場合には
ls[::2]
のようにします。こうすると、
["a", "c", "d"]と出力される
'''
if __name__ == "__main__":
main()
|
# -*- coding: utf-8 -*-
import sys
import fractions
import copy
import bisect
import math
import numpy as np
import itertools
from itertools import combinations_with_replacement
#import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
from operator import itemgetter
from sys import stdin
#input = sys.stdin.readline#こっちの方が入力が早いが使える時に使っていこう
from operator import mul
from functools import reduce
from collections import Counter
#from collections import deque
#input = stdin.readline
j=0
k=0
n=3
r=1
a=[0]
#n=int(input())
#r=int(input())
#print(M)
#A=int(input())
#B=int(input())
#print(N)
"1行1つの整数を入力を取得し、整数と取得する"
#number_list=list(map(int, input().split(" ")))#数字の時
#print(number_list)
"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
#メモ
for i in number_list:#こっちの方がrage使うより早いらしい
print(number_list[i-1])#
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''
x=[]
y=[]
for i in range(N):
x1, y1=[int(i) for i in input().split()]
x.append(x1)
y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''
'''
mixlist=[]
for i in range(N):
a,b=input().split()
mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ,今回はリスト一つで処理している"
'''
'''
#array=[input().split()for i in range(N)]
#print(type(array[0][0]))
#print(array)
"正方行列にstr型の値を入力"
'''
#brray=[list(map(int, input().split(" ")))for i in range(N)]
#print(type(brray[0][0]))
#print(brray)
'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"
#以下に別解を記載
#N, M = [int(i) for i in input().split()]
'''
table = [[int(i) for i in input().split()] for m in range(m)]
print(type(N))
print(N)
print(type(M))
print(M)
print(type(table))
print(table)
'''
#s=input()
#a=[int(i) for i in s]
#print(a[0])
#print([a])
#単数値.桁ごとに分割したい.入力と出力は以下の通り
#イメージとして1桁ごとにリストに値を入れているかんじ
#intを取ると文字列分解に使える
'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''
'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''
'''
A, B, C=stdin.readline().rstrip().split()#str style 何個でもいけることが多い
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''
#a= stdin.readline().rstrip()
#print(a.upper())
"aという変数に入っているものを大文字にして出力"
#a,b=map(int, input().split()) #int style 複数数値入力 「A B」みたいなスペース空いた入力のとき
#なんかうまく入力されるけど
#a=[[int(i) for i in 1.strip()]for 1 in sys.stdin]
#a = [[int(c) for c in l.strip()] for l in sys.stdin]]
#print(a)
#複数行の数値を入力して正方行列を作成
##############################################################################################
##############################################################################################
#under this line explains example calculation
'''
コンビネーションの組み合わせの中身を出力する形式
for i in itertools.combinations(brray, 2)
combinationsをpermutationsにすれば順列になる
今回なら(abc133B)
入力
1 2
5 5
-2 8
出力
[[1, 2], [5, 5], [-2, 8]]
もちろん一次元リストでも使えるし
何よりiもリストのように使えるので便利
'''
#nCr combination
'''
def cmb(n,r):
#When n < r , this function isn't valid
r= min(n-r,r)
#print(n,r)
if r == 0: return 1
over = reduce(mul, range(n, n-r, -1))
#flochart mul(n,n-1)=x
#next mul(x,n-2)........(n-r+1,n-r)
#mul read a,b and returns a*b
under = reduce(mul, range(1, r+1))
#print(over, under)
#reduce is applied mul(1,2)=2
#next mul(2,3)=6
#next mul(6,4)=4.........last(r!,r+1)=r+1!
return over // under
#// is integer divide
#calc example 5C2
#over=5*4*3
#under=3*2*1
a = cmb(n, r)
#print(a)
'''
'''
import itertools
from itertools import combinations_with_replacement
combinationについて
以下の違いを意識しよう
combinations() p, r 長さrのタプル列、ソートされた順で重複なし
combinations_with_replacement() p, r 長さrのタプル列、ソートされた順で重複あり
使用例 出力
combinations('ABCD', 2) AB AC AD BC BD CD
combinations_with_replacement('ABCD', 2) AA AB AC AD BB BC BD CC CD DD
'''
'''
#集計
#example
#a=[2,2,2,3,4,3,1,2,1,3,1,2,1,2,2,1,2,1]
#a=Counter(a)
for i in a.most_common(n):print(i)
#most_common()メソッドは、出現回数が多い要素順にCounterオブジェクトを並び替えます。
#引数にint型の数字nを設定した場合は、出現回数が高い上位n個の要素を返します。
#何も設定しなければ、コンテナ型にあるすべての要素を出現回数の順番に並び替えたタプル型オブジェクトを返します。
#out put
#(2, 8)
#(1, 6)
#(3, 3)
#(4, 1)
'''
#二部探索(binary search)
#A = [1, 2, 3, 3, 3, 4, 4, 6, 6, 6, 6]
#print(A)
#index = bisect.bisect_left(A, 5) # 7 最も左(前)の挿入箇所が返ってきている
#A.insert(index, 5)
#print(index)
#print(A)
'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''
'''
素数の判定
'''
def is_prime(n):
if n == 1: return False
for k in range(2, int(np.sqrt(n)) + 1):
#sqrt(n)+1以上は考えて約数はないので却下
if n % k == 0:
return False
#割り切れたらFalse
return True
'''
npのmaxとmaximumの違い
xs = np.array([1, -2, 3])
np.max(xs, 0)
この出力は3となります.[1, -2, 3]と0の4つの数字のうち,最も大きい値を出力します.
一方で,[max(1, 0), max(-2, 0), max(3, 0)]を出力したい時があります.
その時は,numpyのmaximum関数を用います.
xs = np.array([1, -2, 3])
np.maximum(xs, 0) # [1, 0, 3]
'''
def factorial(x, mod=10**9+7):
# x!
# 階乗
# ex) factorial(5) = 120
tmp = 1
for i in range(1, x+1):
tmp = (tmp * i) % mod
return tmp
'''
Basically, when you do a**d % n, you actually have to calculate a**d, which could be quite large.
But there are ways of computing a**d % n without having to compute a**d itself, and that is what pow does.
'''
########################################################################
########################################################################
#b2=a[:] #1次元のときはコピーはこれで良い
#print(b2)
#a= [[0]*3 for i in range(5)] #2次元配列はこう準備、[[0]*3]*5だとだめ
#b3=copy.deepcopy(a) #2次元配列はこうコピーする
#print(b3)
def main():
n=3
steps=0
state=0
w=1
j=0
k=0
n=int(input())
s=input()
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
#a,b=input().split(" ")#a,bがともに文字列のとき
#a,b=map(int, input().split(" "))
#mapでとってもstrで変換すればappend可能
#nl=list(map(int, input().split(" ")))#数字の時
#s=input()
a=[i for i in ascii_uppercase]#int取るとstrでも行ける
b=[i for i in s]#int取るとstrでも行ける
c=[]
a.insert(0, 'Z')
#print(a)
for i in range(len(b)):
x=a.index(b[i])
c.append(a[(x+n)%26])
print(''.join(c))
#print(a)
#brray=[list(map(int, input().split(" ")))for i in range(N)
#print(brray)
for i in range(1,n+1,2):#これで1個飛ばしループになる
pass
#print(i)
l = ['aaa', 'bbb', 'ccc']
#s = ''.join(l)
#print(s)
# aaabbbccc
#if state in known_states and not flag: # state => 2 steps => 5
#こうやってある要素がリストの中にあるか探すのか
#print(f'steps: {steps}, state: {state}')
#こう書いてあるとデバックしやすい
#dp= [[0]*3 for i in range(5)]#列 行
#dp用の0の入ったやつ
#dp= [[0]*(w+1) for i in range(n+1)]#0からwまでのw+1回計算するから
#print(dp)#初期条件が入る分計算回数+1列分必要(この場合は判断すべきものの数)
DP = np.zeros(w+1, dtype=int)#これでも一次元リストが作れる
exdp=np.zeros((3,4)) # 3×4の2次元配列を生成。2次元ならこう
#dtypeは指定しないとfloatになる
#for i in range(n):#ちょっとした入力に便利
# a, b = map(int, input().split())
#dp[i][0] += [a]
#これだとintとlistをつなぐことになって不適
# dp[i] += [a]
# dp[i] += [b]
#これはうまくいく
#やり方はいろいろあるということ
#print(dp)
#brray=[list(map(int, input().split(" ")))for i in range(N)
#print(brray)
'''
入力
1234
出力
[1, 2, 3, 4]
'''
pin_l=["x" for i in range(10)]#内包表記に慣れろ
#print(pin_l)
ls = ["a", "b", "c", "d", "e"]
#print(ls[2:5])
#スライスでの取得
#print(ls[:-3])
#一番左端から右から3番目より左まで取得
#print(ls[:4:2])
#スライスで1個飛ばしで取得
#ないときは左端スタート
#始点のインデックス番号 : 終点のインデックス番号 : スキップする数+1
#print(ls[::2])
'''
lsというリストの場合に、1つ飛びの値を取得したい場合には
ls[::2]
のようにします。こうすると、
["a", "c", "d"]と出力される
'''
if __name__ == "__main__":
main()
|
[
"literal.string.change",
"call.arguments.change"
] | 654,631
| 654,632
|
u007886915
|
python
|
p02848
|
N = int(input())
S = str(input())
ans = []
lst = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
for i in range(len(S)):
tmp = lst.index(S[i])
tmp += N
if tmp > 25:
tmp -= 25
ans.append(lst[tmp])
print(''.join(ans))
|
N = int(input())
S = str(input())
ans = []
lst = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
for i in range(len(S)):
tmp = lst.index(S[i])
tmp += N
if tmp > 25:
tmp -= 26
ans.append(lst[tmp])
print(''.join(ans))
|
[
"literal.number.integer.change"
] | 654,633
| 654,634
|
u166621202
|
python
|
p02848
|
n=int(input())
s=input()
ans=''
for ss in s:
if ord(ss)+n<=ord('z'):
ss=chr(ord(ss)+n)
else:
ss=chr(ord(ss)+n-26)
ans+=ss
print(ans)
|
n=int(input())
s=input()
ans=''
for ss in s:
if ord(ss)+n<=ord('Z'):
ss=chr(ord(ss)+n)
else:
ss=chr(ord(ss)+n-26)
ans+=ss
print(ans)
|
[
"literal.string.change",
"literal.string.case.change",
"control_flow.branch.if.condition.change"
] | 654,639
| 654,640
|
u932868243
|
python
|
p02848
|
import string
N=int(input())
S=list(str(input()))
Alphabet_List=list(string.ascii_uppercase)
Alphabet_List.extend(2*Alphabet_List)
for i in range(len(S)):
for j in range(len(Alphabet_List)):
if S[i]==Alphabet_List[j]:
S[i]=Alphabet_List[j+13]
break
print(("").join(S))
|
import string
N=int(input())
S=list(str(input()))
Alphabet_List=list(string.ascii_uppercase)
Alphabet_List.extend(2*Alphabet_List)
for i in range(len(S)):
for j in range(len(Alphabet_List)):
if S[i]==Alphabet_List[j]:
S[i]=Alphabet_List[j+N]
break
print(("").join(S))
|
[
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 654,647
| 654,648
|
u847165882
|
python
|
p02848
|
N=int(input())
S=input()
L='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans=''
for i in range(len(S)):
a=S[i]
index=L.find(a)
b=L[index+N]
ans=ans+b
prin(ans)
|
N=int(input())
S=input()
L='ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans=''
for i in range(len(S)):
a=S[i]
index=L.find(a)
b=L[index+N]
ans=ans+b
print(ans)
|
[
"identifier.change",
"call.function.change"
] | 654,649
| 654,650
|
u830162518
|
python
|
p02848
|
n = int(input())
moji = 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"]
lst = list(moji)
for i in range(len(lst)):
num = alphabet.index(lst[i])
if i + n > 25:
lst[i] = alphabet[i+n-26]
else:
lst[i] = alphabet[i+n]
ans = ""
for j in range(len(lst)):
ans += lst[j]
print(ans)
|
n = int(input())
moji = 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"]
lst = list(moji)
for i in range(len(lst)):
num = alphabet.index(lst[i])
if num + n >= 26:
lst[i] = alphabet[num+n-26]
else:
lst[i] = alphabet[num+n]
ans = ""
for j in range(len(lst)):
ans += lst[j]
print(ans)
|
[
"identifier.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"assignment.value.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 654,666
| 654,667
|
u383450070
|
python
|
p02848
|
n = int(input())
s = input()
so = ''
for i in range(len(s)):
ni = ord(s[i]) + n
if ni > 122:
ni -= 26
so += chr(ni)
print(so)
|
n = int(input())
s = input()
so = ''
for i in range(len(s)):
ni = ord(s[i]) + n
if ni > ord('Z'):
ni -= 26
so += chr(ni)
print(so)
|
[
"identifier.replace.add",
"literal.replace.remove",
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"call.arguments.add"
] | 654,668
| 654,669
|
u303739137
|
python
|
p02848
|
n = int(input())
s = inuput()
alfha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ''
for i in s:
a += alfha[(alfha.index(i)+n) % 26]
print(ans)
|
n = int(input())
s = input()
alfha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ans = ''
for i in s:
ans += alfha[(alfha.index(i)+n) % 26]
print(ans)
|
[
"assignment.value.change",
"identifier.change",
"call.function.change"
] | 654,674
| 654,675
|
u455957070
|
python
|
p02848
|
class RotN:
def __init__(self):
self.alphabet = [a for a in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ']
def calculate(self, N, S):
result_list =[]
for s in S:
num = self.alphabet.index(s)
# アルファベットがZより大きくなる場合
if num + N > 25:
tmp = 25 - (num + N)
result_list.append(self.alphabet[tmp])
# アルファベットがZより大きくならない場合
else:
tmp = num + N
result_list.append(self.alphabet[tmp])
return result_list
if __name__ == '__main__':
N = int(input())
S = [s for s in input()]
rn = RotN()
result_list = rn.calculate(N, S)
result = ''
for x in result_list:
result += x
print(result)
|
class RotN:
def __init__(self):
self.alphabet = [a for a in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ']
def calculate(self, N, S):
result_list =[]
for s in S:
num = self.alphabet.index(s)
# アルファベットがZより大きくなる場合
if num + N > 25:
tmp = 25 - (num + N)
result_list.append(self.alphabet[abs(tmp)-1])
# アルファベットがZより大きくならない場合
else:
tmp = num + N
result_list.append(self.alphabet[tmp])
return result_list
if __name__ == '__main__':
N = int(input())
S = [s for s in input()]
rn = RotN()
result_list = rn.calculate(N, S)
result = ''
for x in result_list:
result += x
print(result)
|
[
"call.add"
] | 654,694
| 654,695
|
u189604332
|
python
|
p02848
|
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)
|
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)
|
[
"assignment.change"
] | 654,700
| 654,701
|
u137913818
|
python
|
p02848
|
#import string
n = int(input())
s = input()
a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
print(a)
x = ""
for i in s:
x += a[a.index(i)+n]
print(x)
|
#import string
n = int(input())
s = input()
a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
x = ""
for i in s:
x += a[a.index(i)+n]
print(x)
|
[
"call.remove"
] | 654,708
| 654,709
|
u207799478
|
python
|
p02848
|
import sys
input=sys.stdin.readline
n=int(input())
L=input()
F=[]
for i in range(len(L)):
A=ord(L[i])+n
if A>=91:
A=A-91+65
F.append(chr(A))
print("".join(F))
|
import sys
input=sys.stdin.readline
n=int(input())
L=input()[:-1]
F=[]
for i in range(len(L)):
A=ord(L[i])+n
if A>=91:
A=A-91+65
F.append(chr(A))
print("".join(F))
|
[] | 654,721
| 654,722
|
u690037900
|
python
|
p02848
|
n = int(input())
s = input()
lenlen = len(s)
a = ''
for i in range(lenlen):
c = ord(s[i]) + n
print(c)
if 91 <= c:
c = c - 26
a = a + chr(c)
print(a)
|
n = int(input())
s = input()
lenlen = len(s)
a = ''
for i in range(lenlen):
c = ord(s[i]) + n
if 91 <= c:
c = c - 26
a = a + chr(c)
print(a)
|
[
"call.remove"
] | 654,725
| 654,726
|
u357867755
|
python
|
p02848
|
n=int(input())
s = list(input())
for l in s:
m = ((ord(l)-64)+n)%26+64
s = chr(m)
print(s,end="",sep="")
|
n=int(input())
s = list(input())
for l in s:
m = ((ord(l)-65)+n)%26+65
j = chr(m)
print(j,end="",sep="")
|
[
"literal.number.integer.change",
"assignment.value.change",
"expression.operation.binary.change",
"identifier.change",
"call.arguments.change",
"io.output.change"
] | 654,727
| 654,728
|
u127499732
|
python
|
p02848
|
#146 b
n=int(input())
s=input()
ans=""
for x in s:
num=(ord(x)+n)
if num>90:
num=65+num%90
ans+=chr(num)
print(ans)
|
#146 b
n=int(input())
s=input()
ans=""
for x in s:
num=(ord(x)+n)
if num>90:
num=64+num%90
ans+=chr(num)
print(ans)
|
[
"literal.number.integer.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 654,729
| 654,730
|
u723583932
|
python
|
p02848
|
N = int(input())
S = input()
ANS = ""
for MOJI in S:
i = ord(MOJI) + N
if i > 90:
i = i - 26
ANS.append(chr(i))
|
N = int(input())
S = input()
ANS = ""
for MOJI in S:
i = ord(MOJI) + N
if i > 90:
i = i - 26
ANS = ANS + chr(i)
print(ANS)
|
[
"call.add"
] | 654,737
| 654,738
|
u270467412
|
python
|
p02848
|
D = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
n = int(input())
S = list(input())
for i in range(len(S)):
S[i] = D[(D.index(S[i]) + 1) % 26]
print("".join(S))
|
# B - ROT N
D = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
n = int(input())
S = list(input())
for i in range(len(S)):
S[i] = D[(D.index(S[i]) + n) % 26]
print("".join(S))
|
[
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 654,739
| 654,740
|
u949876708
|
python
|
p02848
|
N = int(input())
S = list(input())
stack = ""
mi = ord('A')
mx = ord('Z')
for i in S :
if ord(i)+N < mx:
stack = stack + chr(ord(i)+N)
else:
mem = ord(i)+N
while mem >= mx:
mem = mem-26
stack = stack + chr(mem)
print(stack)
|
N = int(input())
S = list(input())
stack = ""
mi = ord('A')
mx = ord('Z')
for i in S :
if ord(i)+N <= mx:
stack = stack + chr(ord(i)+N)
else:
mem = ord(i)+N
while mem > mx:
mem = mem-26
stack = stack + chr(mem)
print(stack)
|
[
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.condition.change"
] | 654,751
| 654,750
|
u716660050
|
python
|
p02848
|
N = int(input())
S = list(input())
stack = ""
mi = ord('A')
mx = ord('Z')
for i in S :
if ord(i)+N < mx:
stack = stack + chr(ord(i)+N)
else:
mem = ord(i)+N
while mem >= mx:
mem = mem-26
print(mem)
stack = stack + chr(mem)
print(stack)
|
N = int(input())
S = list(input())
stack = ""
mi = ord('A')
mx = ord('Z')
for i in S :
if ord(i)+N <= mx:
stack = stack + chr(ord(i)+N)
else:
mem = ord(i)+N
while mem > mx:
mem = mem-26
stack = stack + chr(mem)
print(stack)
|
[
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"control_flow.loop.condition.change",
"call.remove"
] | 654,752
| 654,750
|
u716660050
|
python
|
p02848
|
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 = '')
|
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 = '')
|
[] | 654,765
| 654,766
|
u692054751
|
python
|
p02848
|
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)
|
n = int(input())
s = input()
al = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
str = ""
for i in range(len(s)):
str += al[(al.find(s[i])+n)%26]
print(str)
|
[
"identifier.replace.add",
"literal.replace.remove",
"variable_access.subscript.index.change",
"expression.operation.binary.change",
"expression.operation.binary.remove"
] | 654,767
| 654,768
|
u414458988
|
python
|
p02848
|
n = int(input())
s = input()
al = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
str = ""
for i in range(len(s)):
str += al[(al.find(s[i])+1)%26]
print(str)
|
n = int(input())
s = input()
al = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
str = ""
for i in range(len(s)):
str += al[(al.find(s[i])+n)%26]
print(str)
|
[
"identifier.replace.add",
"literal.replace.remove",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 654,769
| 654,768
|
u414458988
|
python
|
p02848
|
N = int(input())
S = list(input())
upper = [chr(i) for i in range(65, 65+26)]
new_upper = []
for i in S:
Index = upper.index(i) + N
if Index >= 26:
Index =- 26
new_upper.append(upper[Index])
else:
new_upper.append(upper[Index])
print(''.join(new_upper))
|
N = int(input())
S = list(input())
upper = [chr(i) for i in range(65, 65+26)]
new_upper = []
for i in S:
Index = upper.index(i) + N
if Index >= 26:
Index -= 26
new_upper.append(upper[Index])
else:
new_upper.append(upper[Index])
print(''.join(new_upper))
|
[
"assignment.value.change",
"expression.operation.unary.arithmetic.remove"
] | 654,772
| 654,773
|
u877428733
|
python
|
p02848
|
al = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
N = int(input())
S = list(input())
for i in range(len(S)):
x = al.index(S[i])
c = x+N
if c <= 25:
S[i] = al[c]
else:
S[i] = al[c-25]
print("".join(S))
|
al = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
N = int(input())
S = list(input())
for i in range(len(S)):
x = al.index(S[i])
c = x+N
if c <= 25:
S[i] = al[c]
else:
S[i] = al[c-26]
print("".join(S))
|
[
"literal.number.integer.change",
"assignment.value.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 654,774
| 654,775
|
u699089116
|
python
|
p02848
|
al = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
N = int(input())
S = list(input())
for i in range(len(S)):
x = al.index(S[i])
c = x+N
if c < 25:
S[i] = al[c]
else:
S[i] = al[c-25]
print("".join(S))
|
al = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
N = int(input())
S = list(input())
for i in range(len(S)):
x = al.index(S[i])
c = x+N
if c <= 25:
S[i] = al[c]
else:
S[i] = al[c-26]
print("".join(S))
|
[
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"literal.number.integer.change",
"assignment.value.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 654,776
| 654,775
|
u699089116
|
python
|
p02848
|
n=int(input())
s=str(input())
for i in range(len(s)):
tmp=ord(s[i])
tmp+=n
if tmp>90:
tmp=tmp-90+66
print(chr(tmp),end="")
print()
|
n=int(input())
s=str(input())
for i in range(len(s)):
tmp=ord(s[i])
tmp+=n
if tmp>90:
tmp=(tmp%90)+64
print(chr(tmp),end="")
print()
|
[
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change",
"literal.number.integer.change"
] | 654,780
| 654,781
|
u758831502
|
python
|
p02848
|
n = int(input())
s = str(input())
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
rot = []
for i in s:
pos = alphabet.find(i)
pos = int(pos) + n
if pos > 26:
pos = int(pos) - 26
rot.append(alphabet[pos])
strout = "".join(rot)
print(strout)
|
n = int(input())
s = str(input())
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
rot = []
for i in s:
pos = alphabet.find(i)
pos = int(pos) + n
if pos >= 26:
pos = int(pos) - 26
rot.append(alphabet[pos])
strout = "".join(rot)
print(strout)
|
[
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 654,782
| 654,783
|
u366185462
|
python
|
p02848
|
a=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
b=int(input())
s=input()
for i in s:
b=a.index(i)+N
if b<=25:
print(a[b],end="")
else:
print(a[b-26],end="")
|
a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S = input()
for i in S:
b = a.index(i) + N
if b <= 25:
print(a[b], end="")
else:
print(a[b-26], end="")
|
[
"assignment.variable.change",
"identifier.change"
] | 654,789
| 654,790
|
u444722572
|
python
|
p02848
|
N=int(input())
S=input()
abc_list="abcdefghijklmnopqrstuvwxyz"
L=len(abc_list)
ans= " "
for i in S:
ans += abc_list[(abc_list.index(i)+N) % L]
print(ans)
|
N=int(input())
S=input()
abc_list="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
L=len(abc_list)
ans= " "
for i in S:
ans += abc_list[(abc_list.index(i)+N) % L]
print(ans)
|
[
"literal.string.change",
"literal.string.case.change",
"assignment.value.change"
] | 654,797
| 654,798
|
u216752093
|
python
|
p02848
|
alpha = 'ABCDEFGHIJKLMNOPQRSTUvWXYZ'
n = int(input())
s = input()
ans = ''
for x in s:
ans += alpha[(alpha.find(x) + n) % 26]
print(ans)
|
alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
n = int(input())
s = input()
ans = ''
for x in s:
ans += alpha[(alpha.find(x) + n) % 26]
print(ans)
|
[
"literal.string.change",
"literal.string.case.change",
"assignment.value.change"
] | 654,799
| 654,800
|
u866769581
|
python
|
p02848
|
ls = ["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":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}
n = int(input())
s = input()
ans = ""
for i in range(len(s)):
ans += ls[dic[s[i]]+n-1]
print(ans)
|
ls = ["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":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}
n = int(input())
s = input()
ans = ""
for i in range(len(s)):
ans += ls[(dic[s[i]]+n-1) % 26]
print(ans)
|
[
"expression.operation.binary.add"
] | 654,803
| 654,804
|
u333139319
|
python
|
p02848
|
n = int(input())
s = list(input())
alp = [chr(ord('A') + i) for i in range(26)]
ans = []
for a in s:
i = (alp.index(a) + 2) % 26
ans.append(alp[i])
print(''.join(ans))
|
n = int(input())
s = list(input())
alp = [chr(ord('A') + i) for i in range(26)]
ans = []
for a in s:
i = (alp.index(a) + n) % 26
ans.append(alp[i])
print(''.join(ans))
|
[
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove",
"expression.operation.binary.change"
] | 654,810
| 654,811
|
u157020659
|
python
|
p02848
|
a = int(input())
b = input()
chr_a = 0
ans = ''
for i in range(len(b)):
if ord(b[i]) + a <= 90:
chr_a = ord(b[i]) + a
else:
chr_a = ord(b[i]) + a -25
ans += chr(chr_a)
print(ans)
|
a = int(input())
b = input()
chr_a = 0
ans = ''
for i in range(len(b)):
if ord(b[i]) + a <= 90:
chr_a = ord(b[i]) + a
else:
chr_a = ord(b[i]) + a -26
ans += chr(chr_a)
print(ans)
|
[
"literal.number.integer.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 654,816
| 654,817
|
u224554402
|
python
|
p02848
|
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))
|
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))
|
[
"literal.number.integer.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 654,818
| 654,819
|
u526094365
|
python
|
p02848
|
n = int(input())
ls = list(map(str,input()))
r = len(ls)
print(ls)
for i in range(r):
if ord(ls[i]) + n <= 90:
ls[i] = chr(ord(ls[i]) + n)
else:
ls[i] = chr((ord(ls[i]) + n)%90+64)
a = "".join(ls)
print(a)
|
n = int(input())
ls = list(map(str,input()))
r = len(ls)
for i in range(r):
if ord(ls[i]) + n <= 90:
ls[i] = chr(ord(ls[i]) + n)
else:
ls[i] = chr((ord(ls[i]) + n)%90+64)
a = "".join(ls)
print(a)
|
[
"call.remove"
] | 654,822
| 654,823
|
u247830763
|
python
|
p02848
|
N=int(input())
S=input()
ANS=""
for i in range(len(S)):
ANS+=chr(64+((ord(S[i])+N)-64)%26)
print(ANS)
|
N=int(input())
S=input()
ANS=""
for i in range(len(S)):
ANS+=chr(65+((ord(S[i])+N)-65)%26)
print(ANS)
|
[
"literal.number.integer.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 654,834
| 654,835
|
u419963262
|
python
|
p02848
|
n = int(input())
s = input()
s = sorted(s)
ans = []
t = n%26
li1 = {0:"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"}
li2 = {"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 range(len(s)):
temp = li2[s[i]]
temp += t
if temp > 25:
temp -= 26
ans.append(li1[temp])
print("".join(ans))
|
n = int(input())
s = input()
ans = []
t = n%26
li1 = {0:"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"}
li2 = {"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 range(len(s)):
temp = li2[s[i]]
temp += t
if temp > 25:
temp -= 26
ans.append(li1[temp])
print("".join(ans))
|
[
"assignment.remove"
] | 654,836
| 654,837
|
u346395915
|
python
|
p02848
|
n = int(input())
s = input()
alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","M","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
ans = ""
for i in range(len(s)):
num = (alphabet.index(s[i]) + n) % len(alphabet)
ans += alphabet[num]
print(ans)
|
n = int(input())
s = 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"]
ans = ""
for i in range(len(s)):
num = (alphabet.index(s[i]) + n) % len(alphabet)
ans += alphabet[num]
print(ans)
|
[
"literal.string.change",
"assignment.value.change"
] | 654,838
| 654,839
|
u573234244
|
python
|
p02848
|
n = int(input())
s = input()
alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","M","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
ans = ""
for i in range(len(s)):
num = ( alphabet.index(s[i]) + n ) % len(alphabet)
ans += alphabet[num]
print(ans)
|
n = int(input())
s = 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"]
ans = ""
for i in range(len(s)):
num = (alphabet.index(s[i]) + n) % len(alphabet)
ans += alphabet[num]
print(ans)
|
[
"literal.string.change",
"assignment.value.change"
] | 654,840
| 654,839
|
u573234244
|
python
|
p02848
|
n = int(input())
s = input()
x = 0
ans = ""
c = ""
for i in s:
x = ord(i) + n
if x > 90:
x = x - 26
c = chr((x))
ans = ans + c
print(x)
print(ans)
|
n = int(input())
s = input()
x = 0
ans = ""
c = ""
for i in s:
x = ord(i) + n
if x > 90:
x = x - 26
c = chr((x))
ans = ans + c
print(ans)
|
[
"call.remove"
] | 654,844
| 654,845
|
u106181248
|
python
|
p02848
|
n=int(input())
s=input()
num=len(s)
new=""
for i in range(num):
a=ord(s[i])
b=a+n
if b>90:
new+=chr(b-24)
else:
new+=chr(b)
print(new)
|
n=int(input())
s=input()
num=len(s)
new=""
for i in range(num):
a=ord(s[i])
b=a+n
if b>90:
new+=chr(b-26)
else:
new+=chr(b)
print(new)
|
[
"literal.number.integer.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 654,858
| 654,859
|
u460386402
|
python
|
p02848
|
A = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','S','Y','X','Z']
N = int(input())
S = list(input())
B = []
for i in range(len(S)):
for j in range(26):
if S[i] == A[j]:
if j+N > 25:
B.append(A[j+N-25])
else:
B.append(A[j+N])
print(''.join(B))
|
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())
S = list(input())
B = []
for i in range(len(S)):
for j in range(26):
if S[i] == A[j]:
if j+N > 25:
B.append(A[j+N-26])
else:
B.append(A[j+N])
print(''.join(B))
|
[
"literal.string.change",
"assignment.value.change",
"literal.number.integer.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 654,862
| 654,863
|
u514118270
|
python
|
p02848
|
import sys
import os
def main():
if os.getenv("LOCAL"):
sys.stdin = open("input.txt", "r")
N = int(sys.stdin.buffer.readline())
S = sys.stdin.buffer.readline().decode()
ret = []
for s in S:
n = ord(s) + N
if n > 90:
ret.append(chr(n - 26))
else:
ret.append(chr(n))
print("".join(ret), end="")
if __name__ == '__main__':
main()
|
import sys
import os
def main():
if os.getenv("LOCAL"):
sys.stdin = open("input.txt", "r")
N = int(sys.stdin.buffer.readline())
S = sys.stdin.buffer.readline().decode().rstrip()
ret = []
for s in S:
n = ord(s) + N
if n > 90:
ret.append(chr(n - 26))
else:
ret.append(chr(n))
print("".join(ret), end="")
if __name__ == '__main__':
main()
|
[
"call.add"
] | 654,879
| 654,880
|
u634079249
|
python
|
p02848
|
N = int(input())
S = str(input())
ans =""
for c in S:
tmp=ord(c)+N
if(tmp>90):
tmp=tmp-90+65
ans+=chr(tmp)
print(ans)
|
N = int(input())
S = str(input())
ans =""
for c in S:
tmp=ord(c)+N
if(tmp>90):
tmp=tmp-90+64
ans+=chr(tmp)
print(ans)
|
[
"literal.number.integer.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 654,881
| 654,882
|
u765758367
|
python
|
p02848
|
shift = int(input())
X = input()
ans=''
#print(X)
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}
#print(DIC)
for i in X:
ans += LIST[(DIC[i] + 2) % 26]
print (ans)
|
shift = int(input())
X = input()
ans=''
#print(X)
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}
#print(DIC)
for i in X:
ans += LIST[(DIC[i] + shift) % 26]
print (ans)
|
[
"identifier.replace.add",
"literal.replace.remove",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 654,892
| 654,893
|
u401341173
|
python
|
p02848
|
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))
|
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))
|
[
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 654,896
| 654,897
|
u998262711
|
python
|
p02848
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from EmurateInput import input
N, S = int(input()), input()
def rot_encode(n):
from string import ascii_lowercase as lc, ascii_uppercase as uc
lookup = str.maketrans(lc + uc, lc[n:] + lc[:n] + uc[n:] + uc[:n])
return lambda s: s.translate(lookup)
print(rot_encode(N)(S))
|
N, S = int(input()), input()
def rot_encode(n):
from string import ascii_lowercase as lc, ascii_uppercase as uc
lookup = str.maketrans(lc + uc, lc[n:] + lc[:n] + uc[n:] + uc[:n])
return lambda s: s.translate(lookup)
print(rot_encode(N)(S))
|
[] | 654,900
| 654,901
|
u643817184
|
python
|
p02848
|
n = int(input())
s = input()
t=str()
for i in s:
x = chr(ord(i) + n)
if ord(t) > ord('Z'):
x = chr(ord(x) - ord('Z') + ord('A')-1)
ss += x
print(t)
|
n = int(input())
s = input()
ss=str()
for i in s:
t = chr(ord(i) + n)
if ord(t) > ord('Z'):
t = chr(ord(t) - ord('Z') + ord('A')-1)
ss += t
print(ss)
|
[
"assignment.variable.change",
"identifier.change",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 654,904
| 654,905
|
u274635633
|
python
|
p02848
|
n=int(input())
s=input()
s_len=len(s)
ans=""
for i in range(s_len):
char=97+(ord(s[i])+n-97)%26
ans+=chr(char)
print(ans)
|
n=int(input())
s=input()
s_len=len(s)
ans=""
for i in range(s_len):
char=65+(ord(s[i])+n-65)%26
ans+=chr(char)
print(ans)
|
[
"literal.number.integer.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 654,914
| 654,915
|
u217627525
|
python
|
p02848
|
n=int(input())
s=input()
s_len=len(s)
ans=""
for i in range(s_len):
char=97+(ord(s)+n)%26
ans+=chr(char)
print(ans)
|
n=int(input())
s=input()
s_len=len(s)
ans=""
for i in range(s_len):
char=65+(ord(s[i])+n-65)%26
ans+=chr(char)
print(ans)
|
[
"literal.number.integer.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 654,916
| 654,915
|
u217627525
|
python
|
p02848
|
n=int(input())
s=list(input())
ans=""
for i in s:
q=ord(i)-65
ans+=chr((q+n)%26)
print(ans)
|
n=int(input())
s=list(input())
ans=""
for i in s:
q=ord(i)-65
ans+=chr((q+n)%26+65)
print(ans)
|
[
"expression.operation.binary.add"
] | 654,919
| 654,920
|
u023229441
|
python
|
p02848
|
N = int(input())
S = input()
arr = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
c = ""
for s in S:
c = c + arr[arr.find(s)+2:arr.find(s)+3]
print(c)
|
N = int(input())
S = input()
arr = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
c = ""
for s in S:
c = c + arr[arr.find(s)+N:arr.find(s)+N+1]
print(c)
|
[
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 654,921
| 654,922
|
u536560967
|
python
|
p02848
|
n= int(input())
s = input()
al='ABCDEFGHIJKLMNOPQRSTUVXXYZ'
print(''.join([al[-len(al)+al.index(i)+n] for i in s]))
|
n= int(input())
s = input()
al='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
print(''.join([al[-len(al)+al.index(i)+n] for i in s]))
|
[
"literal.string.change",
"assignment.value.change"
] | 654,925
| 654,926
|
u035445296
|
python
|
p02848
|
n = int(input())
s = input()
l = len(s)
ans = ""
z = ord("Z") - 1
for i in range(l):
k = ord(s[i]) + n
if k > z:
k = k - z + ord("A")
ans = ans + chr(k)
print(ans)
|
n = int(input())
s = input()
l = len(s)
ans = ""
z = ord("Z")
for i in range(l):
k = ord(s[i]) + n
if k > z:
k = k - z + (ord("A") - 1)
ans = ans + chr(k)
print(ans)
|
[
"expression.operation.binary.remove"
] | 654,927
| 654,928
|
u977193988
|
python
|
p02848
|
N = int(input())
S = input()
ans = ""
for s in S:
ans += chr((ord(s) + N)%26 + 65)
print(ans)
|
N = int(input())
S = input()
ans = ""
for s in S:
ans += chr((ord(s) + N-65)%26 + 65)
print(ans)
|
[
"expression.operation.binary.add"
] | 654,929
| 654,930
|
u985963315
|
python
|
p02848
|
N = int(input())
S = input()
ans = ""
for s in S:
ans += chr((ord(S) + N - 65)%26 + 65)
print(ans)
|
N = int(input())
S = input()
ans = ""
for s in S:
ans += chr((ord(s) + N-65)%26 + 65)
print(ans)
|
[
"misc.typo",
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 654,931
| 654,930
|
u985963315
|
python
|
p02848
|
N = int(input())
st = input()
ans_st = ""
for i in range(N):
ch_ord = ord(st[i])
if ch_ord + N > 122:
ans_st += chr(ch_ord + N - 26)
else:
ans_st += chr(ch_ord + N)
print(ans_st)
|
N = int(input())
st = input()
ans_st = ""
for i in range(len(st)):
ch_ord = ord(st[i])
if ch_ord + N > 90:
ans_st += chr(ch_ord + N - 26)
else:
ans_st += chr(ch_ord + N)
print(ans_st)
|
[
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change",
"call.arguments.add",
"literal.number.integer.change",
"control_flow.branch.if.condition.change"
] | 654,932
| 654,933
|
u667084803
|
python
|
p02848
|
n = int(input())
s = input()
d = "ABCDEFGHIJKLMNOPQRSTUVXYZ"
print(''.join([d[(d.index(i) + n) % 26] for i in s]))
|
n = int(input())
s = input()
d = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
print(''.join([d[(d.index(i) + n) % 26] for i in s]))
|
[
"literal.string.change",
"assignment.value.change"
] | 654,934
| 654,935
|
u700805562
|
python
|
p02848
|
n = int(input())
s = input()
d = "ABCDEFGHIJKLMNOPQRSTUVXYZ"
print("".join([d[(d.index(i)+n)%26] for i in s]))
|
n = int(input())
s = input()
d = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
print(''.join([d[(d.index(i) + n) % 26] for i in s]))
|
[
"literal.string.change",
"assignment.value.change",
"call.arguments.change",
"io.output.change"
] | 654,936
| 654,935
|
u700805562
|
python
|
p02848
|
n = int(input())
s = input()
S = []
for i in s:
S.append(chr((ord(i) - ord('A') + n - 26 + ord('A'))))
print(S,sep='')
|
n = int(input())
s = input()
S = []
for i in s:
S.append(chr(((ord(i) - ord('A') + n) % 26 + ord('A'))))
print(*S,sep='')
|
[
"call.arguments.change",
"expression.operation.binary.change"
] | 654,939
| 654,940
|
u411255472
|
python
|
p02848
|
N = int(input())
S = input()
ans=''
for x in S:
nc=ord(N[x])
nc+=N
if nc>90:
nc-=26
ans+=chr(nc)
print(ans)
|
N = int(input())
S = input()
ans=""
for x in S:
nc=ord(x)
nc+=N
if nc>90:
nc-=26
ans+=chr(nc)
print(ans)
|
[
"literal.string.change",
"assignment.value.change",
"call.arguments.change"
] | 654,946
| 654,947
|
u735175408
|
python
|
p02848
|
n=int(input())
s=input()
ans=[]
for i in range(len(s)):
num=ord(s[i])+n
if num>90:
num-=25
ans.append(chr(num))
ans="".join(ans)
print(ans)
|
n=int(input())
s=input()
ans=[]
for i in range(len(s)):
num=ord(s[i])+n
if num>90:
num-=26
ans.append(chr(num))
ans="".join(ans)
print(ans)
|
[
"literal.number.integer.change"
] | 654,963
| 654,964
|
u954153335
|
python
|
p02848
|
n=int(input())
s=input()
ans=[]
for i in range(n):
num=ord(s[i])+2
if num>90:
num-=90
ans.append(chr(num))
ans="".join(ans)
print(ans)
|
n=int(input())
s=input()
ans=[]
for i in range(len(s)):
num=ord(s[i])+n
if num>90:
num-=26
ans.append(chr(num))
ans="".join(ans)
print(ans)
|
[
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change",
"call.arguments.add",
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove",
"expression.operation.binary.change",
"literal.number.integer.change"
] | 654,965
| 654,964
|
u954153335
|
python
|
p02848
|
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="")
|
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="")
|
[
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove",
"expression.operation.binary.change"
] | 654,966
| 654,967
|
u500376440
|
python
|
p02848
|
num = int(input())
node = input()
table = list(node)
for i in table:
aaa = ord('A') + ((ord(i) - (ord('A')) + num) % 26)
print(chr(aaa))
|
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='')
|
[
"call.arguments.add"
] | 654,970
| 654,971
|
u073606136
|
python
|
p02848
|
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)
|
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)
|
[
"expression.operation.binary.add"
] | 654,978
| 654,979
|
u355853184
|
python
|
p02848
|
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 1
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()
n = k()
S = list(v())
for i in range(len(S)):
a = AL.index(S[i])
ans = a+2
if ans >= 26:
ans = (a+2)-26
S[i] = AL[ans]
print("".join(S))
|
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 1
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"
AL = al.upper()
n = k()
S = list(v())
for i in range(len(S)):
a = AL.index(S[i])
ans = a+n
if ans >= 26:
ans = (a+n)-26
S[i] = AL[ans]
print("".join(S))
|
[
"assignment.value.change",
"identifier.replace.add",
"literal.replace.remove",
"expression.operation.binary.change"
] | 654,989
| 654,990
|
u750651325
|
python
|
p02848
|
n = int(input())
s = input()
t = ""
for i in s:
a = ord(i) + n
if a > ord("Z"):
a = a - 26
t += chr(a)
|
n = int(input())
s = input()
t = ""
for i in s:
a = ord(i) + n
if a > ord("Z"):
a = a - 26
t += chr(a)
print(t)
|
[
"call.add"
] | 654,995
| 654,996
|
u468972478
|
python
|
p02848
|
N=int(input())
S=list(map(str, input()))
li=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','W','X','Y','Z']
answer=[]
for i in range(len(S)):
for j in range(len(li)):
if S[i]==li[j] and j<len(li)-N:
answer.append(li[j+N])
elif S[i]==li[j] and j>=len(li)-N:
answer.append(li[j+N-len(li)])
print("".join(answer))
|
N=int(input())
S=list(map(str, input()))
li=['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']
answer=[]
for i in range(len(S)):
for j in range(len(li)):
if S[i]==li[j] and j<len(li)-N:
answer.append(li[j+N])
elif S[i]==li[j] and j>=len(li)-N:
answer.append(li[j+N-len(li)])
print("".join(answer))
|
[] | 654,997
| 654,998
|
u005977014
|
python
|
p02848
|
n = int(input())
S = input()
tmp = []
for s in S:
if ord(s)+n > ord('Z'):
tmp.append(ord('A')+(ord(s)+n)%ord('Z'))
else:
tmp.append(ord(s)+n)
ans = ''
for i in tmp:
ans += chr(i)
print(ans)
|
n = int(input())
S = input()
tmp = []
for s in S:
if ord(s)+n > ord('Z'):
tmp.append(ord('A')+(ord(s)+n)%ord('Z')-1)
else:
tmp.append(ord(s)+n)
ans = ''
for i in tmp:
ans += chr(i)
print(ans)
|
[
"expression.operation.binary.add"
] | 655,009
| 655,010
|
u363421241
|
python
|
p02848
|
n=int(input())
s=input()
l=[]
for a in s:
moji=ord(a)
moji+=n
print(moji)
if int(moji)>90:
moji-=26
l.append(chr(moji))
print(''.join(l))
|
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))
|
[
"call.remove"
] | 655,011
| 655,012
|
u087118202
|
python
|
p02848
|
N = int(input())
S = list(input())
ans = []
print(S)
for s in S:
ord_plus = ord(s)+N
if ord_plus > 90:
ord_plus -= 26
ans.append(chr(ord_plus))
print("".join(ans))
|
N = int(input())
S = list(input())
ans = []
for s in S:
ord_plus = ord(s)+N
if ord_plus > 90:
ord_plus -= 26
ans.append(chr(ord_plus))
print("".join(ans))
|
[
"call.remove"
] | 655,019
| 655,020
|
u760961723
|
python
|
p02848
|
n = int(input())
s = input()
x = []
import string
a = list(string.ascii_uppercase)
for i in s:
b = a.index(i)
x.append(a[b + n])
print(''.join(x))
|
n = int(input())
s = input()
x = []
import string
a = list(string.ascii_uppercase)*2
#print(a)
for i in s:
b = a.index(i)
x.append(a[b + n])
print(''.join(x))
|
[
"assignment.change"
] | 655,021
| 655,022
|
u680851063
|
python
|
p02848
|
N = input()
S = input()
N = int(N)
A = ""
num = 0
for s in S:
num = (ord(s) + N) if ord(s) + N < 90 else (ord(s) + N - 25)
A += chr(num)
print(A)
|
N = input()
S = input()
N = int(N)
A = ""
num = 0
for s in S:
num = (ord(s) + N) if ord(s) + N < 91 else (ord(s) + N - 26)
A += chr(num)
print(A)
|
[
"literal.number.integer.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 655,027
| 655,028
|
u510434738
|
python
|
p02848
|
N = input()
S = input()
N = int(N)
A = ""
num = 0
for s in S:
num = (ord(s) + N) if ord(s) + N <= 90 else (ord(s) + N - 25)
A += chr(num)
print(A)
|
N = input()
S = input()
N = int(N)
A = ""
num = 0
for s in S:
num = (ord(s) + N) if ord(s) + N < 91 else (ord(s) + N - 26)
A += chr(num)
print(A)
|
[
"literal.number.integer.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 655,029
| 655,028
|
u510434738
|
python
|
p02848
|
n = int(input())
s = input()
list = []
for i in s:
if ord(i)+N > 90:
list.append(chr(ord(i)+N-26))
else:
list.append(chr(ord(i)+N))
ans = "".join(list)
print(ans)
|
n = int(input())
s = input()
list = []
for i in s:
if ord(i)+n > 90:
list.append(chr(ord(i)+n-26))
else:
list.append(chr(ord(i)+n))
ans = "".join(list)
print(ans)
|
[
"identifier.change",
"control_flow.branch.if.condition.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 655,039
| 655,040
|
u825842302
|
python
|
p02848
|
N = int(input())
S = input()
alphabet = "ABCDEFGHIJKLMNOPQUSTUVWXYZ"
newS = S.translate(str.maketrans(alphabet, alphabet[N:]+alphabet[:N]))
print(newS)
|
N = int(input())
S = input()
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
newS = S.translate(str.maketrans(alphabet, alphabet[N:]+alphabet[:N]))
print(newS)
|
[
"literal.string.change",
"assignment.value.change"
] | 655,045
| 655,046
|
u450983668
|
python
|
p02848
|
N = int(input())
S = list(input())
lst = [chr(ord('a') + i) for i in range(26)]
lst_up = list(map(str.upper,lst))
for i in range(len(S)):
if int(lst_up.index(S[i])+N) <= len(lst_up):
S[i] = lst_up[lst_up.index(S[i])+N]
elif int(lst_up.index(S[i])+N) > len(lst_up):
S[i] = lst_up[lst_up.index(S[i])+N-26]
lst_2 = "".join(S)
print(lst_2)
|
N = int(input())
S = list(input())
lst = [chr(ord('a') + i) for i in range(26)]
lst_up = list(map(str.upper,lst))
for i in range(len(S)):
if int(lst_up.index(S[i])+N+1) <= len(lst_up):
S[i] = lst_up[lst_up.index(S[i])+N]
elif int(lst_up.index(S[i])+N+1) > len(lst_up):
S[i] = lst_up[lst_up.index(S[i])+N-26]
lst_2 = "".join(S)
print(lst_2)
|
[
"control_flow.branch.if.condition.change",
"control_flow.loop.for.condition.change",
"misc.off_by_one"
] | 655,056
| 655,057
|
u972658925
|
python
|
p02848
|
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))
|
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))
|
[
"literal.string.change",
"assignment.value.change"
] | 655,058
| 655,059
|
u027675217
|
python
|
p02848
|
KEY = int(input())
s = input()
ans = ""
for i in range(len(s)):
num = ord(s[i])
num = num + (KEY % 26)
if ord("Z") < num:
num = ord("A") + num - ord("Z")
ans += chr(num)
print(ans)
|
KEY = int(input())
s = input()
ans = ""
for i in range(len(s)):
num = ord(s[i])
num = num + (KEY % 26)
if ord("Z") < num:
num = ord("A") + num - ord("Z") - 1
ans += chr(num)
print(ans)
|
[
"assignment.change"
] | 655,062
| 655,063
|
u652057333
|
python
|
p02848
|
N = int(input())
S = 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']
A = []
for c in S:
i = L.find(c)
A.append(L[(i + n)%26])
print(''.join(A))
|
N = int(input())
S = 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']
A = []
for c in S:
i = L.index(c)
A.append(L[(i + N)%26])
print(''.join(A))
|
[
"assignment.value.change",
"identifier.change",
"variable_access.subscript.index.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 655,066
| 655,067
|
u963468276
|
python
|
p02848
|
N = int(input())
S = 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']
A = []
for c in S:
i = Alphabet.find(c)
A.append(Alphabet[(i + n)%26])
print(''.join(A))
|
N = int(input())
S = 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']
A = []
for c in S:
i = L.index(c)
A.append(L[(i + N)%26])
print(''.join(A))
|
[
"assignment.variable.change",
"identifier.change",
"assignment.value.change",
"call.arguments.change",
"variable_access.subscript.index.change",
"expression.operation.binary.change"
] | 655,068
| 655,067
|
u963468276
|
python
|
p02848
|
N = int(input())
S = input()
ans = ""
for i in range(len(S)):
ans += chr(ord("A") + (ord(S[i]) + N) % ord("A") % (ord("Z") - ord("A")))
print(ans)
|
N = int(input())
S = input()
ans = ""
for i in range(len(S)):
ans += chr(ord("A") + (ord(S[i]) + N) % ord("A") % (ord("Z") - ord("A") + 1))
print(ans)
|
[
"expression.operation.binary.add"
] | 655,071
| 655,072
|
u589432040
|
python
|
p02848
|
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())
li=list(input())
for i in li:
num=a.index(i)+N
if num > 26:
num-=26
print(a[num],end="")
|
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())
li=list(input())
for i in li:
num=a.index(i)+N
if num >= 26:
num-=26
print(a[num],end="")
|
[
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 655,078
| 655,079
|
u627283301
|
python
|
p02848
|
n = int(input())
s = str(input())
alp = 'abcdefghijklmnopqrstuvwxyz' * 2
ss = ''
for i in range(len(s)):
ss += str(alp[alp.index(s[i])+n])
print(ss)
|
n = int(input())
s = str(input())
alp = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
ss = ''
for i in range(len(s)):
ss += str(alp[alp.index(s[i])+n])
print(ss)
|
[
"literal.string.change",
"assignment.value.change",
"expression.operation.binary.change",
"expression.operation.binary.remove"
] | 655,090
| 655,091
|
u506587641
|
python
|
p02848
|
def q2(in_num, in_str):
o_str = ""
letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(in_str)):
o_str += (letters[(letters.index(in_str[i])+int(in_num))%26])
return o_str
q2(input(),input())
|
def q2(in_num, in_str):
o_str = ""
letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(in_str)):
o_str += (letters[(letters.index(in_str[i])+int(in_num))%26])
return o_str
print(q2(input(),input()))
|
[
"call.add",
"call.arguments.change"
] | 655,094
| 655,095
|
u382687823
|
python
|
p02848
|
import string
N = int(input())
S = list(input())
lis = list(string.ascii_uppercase)
answer = []
for s in S:
index = lis.index(s)
slide_index = index + N
if slide_index > 25:
slide_index -= 26
new_s = lis[slide_index]
answer.append(new_s)
answer = list(answer)
print(answer)
|
import string
N = int(input())
S = list(input())
lis = list(string.ascii_uppercase)
answer = []
for s in S:
index = lis.index(s)
slide_index = index + N
if slide_index > 25:
slide_index -= 26
new_s = lis[slide_index]
answer.append(new_s)
answer = ''.join(answer)
print(answer)
|
[
"assignment.value.change"
] | 655,101
| 655,102
|
u379535139
|
python
|
p02848
|
N = int(input())
S = input()
alphabet = 'ZABCDEFGHIJKLMNOPQRSTUVWXY'
alphabet_num = {st: num for num, st in enumerate(alphabet)}
alphabet_list = [st for st in alphabet]
for s in S:
num = (alphabet_num[s] + N) % 26
print(alphabet_list[num], end+'')
|
N = int(input())
S = input()
alphabet = 'ZABCDEFGHIJKLMNOPQRSTUVWXY'
alphabet_num = {st: num for num, st in enumerate(alphabet)}
alphabet_list = [st for st in alphabet]
for s in S:
num = (alphabet_num[s] + N) % 26
print(alphabet_list[num], end='')
|
[
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 655,103
| 655,104
|
u661977789
|
python
|
p02848
|
N = int(input())
S = input()
li = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
sli = list(S)
for i in range(len(sli)):
for j in range(26):
if li[j] == sli[i]:
sli[i] == li[j+N]
print("".join(sli))
|
N = int(input())
S = input()
li = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
sli = list(S)
for i in range(len(sli)):
for j in range(26):
if li[j] == sli[i]:
sli[i] = li[j+N]
break
print("".join(sli))
|
[
"expression.operation.compare.replace.remove",
"assignment.replace.add",
"misc.typo",
"control_flow.break.add"
] | 655,106
| 655,107
|
u249218227
|
python
|
p02848
|
S = input()
N = input()
li = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
sli = list(S)
for i in range(len(sli)):
for j in range(26):
if li[j] == sli[i]:
sli[i] == li[j+N]
break
print("".join(sli))
|
N = int(input())
S = input()
li = list("ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ")
sli = list(S)
for i in range(len(sli)):
for j in range(26):
if li[j] == sli[i]:
sli[i] = li[j+N]
break
print("".join(sli))
|
[
"assignment.variable.change",
"identifier.change",
"call.add",
"assignment.value.change",
"expression.operation.compare.replace.remove",
"assignment.replace.add",
"misc.typo"
] | 655,108
| 655,107
|
u249218227
|
python
|
p02848
|
# coding: utf-8
import string
alphabet = string.ascii_uppercase + string.ascii_uppercase
n_steps = int(input())
row_text = input()
processed_tuple = (alphabet[alphabet.index(x)+n_steps] for x in row_text)
print(*processed_tuple)
|
# coding: utf-8
import string
alphabet = string.ascii_uppercase + string.ascii_uppercase
n_steps = int(input())
row_text = input()
processed_tuple = (alphabet[alphabet.index(x)+n_steps] for x in row_text)
print(*processed_tuple, sep = '')
|
[
"call.arguments.add"
] | 655,116
| 655,117
|
u511824539
|
python
|
p02848
|
n = int(input())
s = list(input())
for i in range(len(s)):
s[i] = chr((ord(s[i])-65+n)%26+65)
print("".join(s[i]))
|
n = int(input())
s = list(input())
for i in range(len(s)):
s[i] = chr((ord(s[i])-65+n)%26+65)
print("".join(s))
|
[] | 655,122
| 655,123
|
u351480677
|
python
|
p02848
|
alp_list = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S_list = list(input())
Slen = len(S_list)
S_return_list = []
print(Slen)
for i in range(0,Slen):
S_return_list.append(alp_list[(alp_list.index(S_list[i])+N)%26])
S_return="".join(S_return_list)
print('{}'.format(S_return))
|
alp_list = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S_list = list(input())
Slen = len(S_list)
S_return_list = []
for i in range(0,Slen):
S_return_list.append(alp_list[(alp_list.index(S_list[i])+N)%26])
S_return="".join(S_return_list)
print('{}'.format(S_return))
|
[
"call.remove"
] | 655,126
| 655,127
|
u730321398
|
python
|
p02848
|
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))
|
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))
|
[
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"expression.operation.binary.remove"
] | 655,137
| 655,138
|
u582663624
|
python
|
p02848
|
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))
|
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))
|
[
"expression.operator.compare.change",
"control_flow.branch.if.condition.change"
] | 655,139
| 655,138
|
u582663624
|
python
|
p02848
|
N = int(input())
S = input()
ret = ""
for s in list(S):
a = ord(s)
max_z_a = a - 25 if a + N > 90 else a
ret += chr(max_z_a + N)
print(ret)
|
N = int(input())
S = input()
ret = ""
for s in list(S):
a = ord(s)
max_z_a = a - 26 if a + N > 90 else a
ret += chr(max_z_a + N)
print(ret)
|
[
"literal.number.integer.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 655,141
| 655,142
|
u105302073
|
python
|
p02848
|
n=int(input())
s=list(input())
a=""
for c in s:
a+=chr((ord(c)-ord(a)+n)%26+ord(a))
print(a)
|
n=int(input())
s=list(input())
a=""
for c in s:
a+=chr((ord(c)-ord("A")+n)%26+ord("A"))
print(a)
|
[
"call.arguments.change",
"expression.operation.binary.change"
] | 655,149
| 655,150
|
u118642796
|
python
|
p02848
|
N = int(input())
S = list(input())
# ordで文字からunicode数字を返す
# chrでunicode数字から文字を返す
def chr_change(chr, N):
""" print("chr is", chr)
print("N is", N)
print("ord(chr) is ", ord(chr))
"""
Num_AtoZ = ord("Z") - ord("A")
if ord(chr) + N > ord("Z"):
chg_chr = ord(chr) + N - Num_AtoZ -1
else:
chg_chr = ord(chr) + N
#print("chg_chr is", chg_chr)
return chg_chr
for i in range(N):
tmp_chr = S[i]
print(chr(chr_change(tmp_chr, N)), end = "")
print("\n")
|
N = int(input())
S = list(input())
# ordで文字からunicode数字を返す
# chrでunicode数字から文字を返す
def chr_change(chr, N):
""" print("chr is", chr)
print("N is", N)
print("ord(chr) is ", ord(chr))
"""
Num_AtoZ = ord("Z") - ord("A")
if ord(chr) + N > ord("Z"):
chg_chr = ord(chr) + N - Num_AtoZ -1
else:
chg_chr = ord(chr) + N
#print("chg_chr is", chg_chr)
return chg_chr
for i in range(len(S)):
tmp_chr = S[i]
print(chr(chr_change(tmp_chr, N)), end = "")
print("\n")
|
[
"call.arguments.change",
"control_flow.loop.range.bounds.upper.change",
"call.arguments.add"
] | 655,156
| 655,157
|
u121161758
|
python
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.