結果

問題 No.1455 拡張ROTN
ユーザー 👑 rin204
提出日時 2021-08-05 18:10:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 390 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 82,100 KB
実行使用メモリ 59,776 KB
最終ジャッジ日時 2024-09-16 15:22:09
合計ジャッジ時間 1,919 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
n = int(input())

def f(s, n):
    if s.isdigit():
        s = int(s)
        if s + n < 10:
            return str(s + n)
        else:
            return "".join(f(t, s + n - 10) for t in "CpCzNkSuTbEoA")
    elif s.islower():
        return chr((ord(s) - 97 + n) % 26 + 97)
    else:
        return chr((ord(s) - 65 + n) % 26 + 65)
        
print("".join(f(s, n) for s in S))
0