結果

問題 No.1455 拡張ROTN
ユーザー convexineqconvexineq
提出日時 2021-05-05 20:50:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 819 ms
コンパイル使用メモリ 86,848 KB
実行使用メモリ 76,104 KB
最終ジャッジ日時 2023-10-11 14:52:49
合計ジャッジ時間 4,520 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
70,924 KB
testcase_01 AC 71 ms
71,324 KB
testcase_02 AC 84 ms
76,060 KB
testcase_03 AC 77 ms
75,844 KB
testcase_04 AC 79 ms
76,104 KB
testcase_05 AC 78 ms
75,860 KB
testcase_06 AC 82 ms
75,644 KB
testcase_07 AC 81 ms
75,872 KB
testcase_08 AC 82 ms
75,636 KB
testcase_09 AC 80 ms
75,780 KB
testcase_10 AC 75 ms
71,376 KB
testcase_11 AC 80 ms
76,072 KB
testcase_12 AC 77 ms
76,000 KB
testcase_13 AC 71 ms
70,920 KB
testcase_14 AC 76 ms
75,772 KB
testcase_15 AC 72 ms
71,260 KB
testcase_16 AC 72 ms
71,324 KB
testcase_17 AC 79 ms
75,772 KB
testcase_18 AC 77 ms
75,908 KB
testcase_19 AC 77 ms
75,772 KB
testcase_20 AC 74 ms
75,856 KB
testcase_21 AC 75 ms
75,956 KB
testcase_22 AC 71 ms
71,260 KB
testcase_23 AC 78 ms
75,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def rot(x,c):
    if x.islower():
        return chr((ord(x)+c-97)%26+97)
    elif x.isupper():
        return chr((ord(x)+c-65)%26+65)
    elif x=="9":
        return "CpCzNkSuTbEoA"
    else:
        return str((int(x)+c)%10)
        
def f(s,c):
    return "".join([rot(i,c) for i in s])

s = input()
n = int(input())
for i in range(min(n,12)):
    s = f(s,1)
    n -= 1
if n: s = f(s,n%26)
print(s)
0