結果

問題 No.1455 拡張ROTN
コンテスト
ユーザー NatsubiSogan
提出日時 2021-03-31 21:30:59
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 605 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 56 ms
コンパイル使用メモリ 15,104 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2026-10-04 02:55:24
合計ジャッジ時間 1,959 ms
ジャッジサーバーID
(参考情報)
judge4_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

s = input()
n = int(input())
ans = ""
for i in s:
    if i.isdigit():
        now = "CpCzNkSuTbEoA"
        shift = (n - (10 - int(i))) % 26
        new = ""
        for j in now:
            if j.islower():
                new += chr((ord(j) - ord("a") + shift) % 26 + ord("a"))
            else:
                new += chr((ord(j) - ord("A") + shift) % 26 + ord("A"))
        ans += new
    elif i.islower():
        shift = n % 26
        ans += chr((ord(i) - ord("a") + shift) % 26 + ord("a"))
    else:
        shift = n % 26
        ans += chr((ord(i) - ord("A") + shift) % 26 + ord("A"))
print(ans)
0