結果

問題 No.1455 拡張ROTN
ユーザー 👑 rin204rin204
提出日時 2021-08-05 18:10:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 390 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 86,792 KB
実行使用メモリ 76,376 KB
最終ジャッジ日時 2023-10-14 21:38:45
合計ジャッジ時間 3,358 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,328 KB
testcase_01 AC 81 ms
71,176 KB
testcase_02 AC 103 ms
76,024 KB
testcase_03 AC 79 ms
71,348 KB
testcase_04 AC 88 ms
76,168 KB
testcase_05 AC 79 ms
71,476 KB
testcase_06 AC 82 ms
75,948 KB
testcase_07 AC 79 ms
71,344 KB
testcase_08 AC 82 ms
76,376 KB
testcase_09 AC 77 ms
71,472 KB
testcase_10 AC 77 ms
71,384 KB
testcase_11 AC 75 ms
71,176 KB
testcase_12 AC 78 ms
71,472 KB
testcase_13 AC 76 ms
71,280 KB
testcase_14 AC 79 ms
71,248 KB
testcase_15 AC 78 ms
71,172 KB
testcase_16 AC 78 ms
71,132 KB
testcase_17 AC 76 ms
71,044 KB
testcase_18 AC 77 ms
71,188 KB
testcase_19 AC 77 ms
71,116 KB
testcase_20 AC 78 ms
71,136 KB
testcase_21 AC 77 ms
71,384 KB
testcase_22 AC 76 ms
71,300 KB
testcase_23 AC 79 ms
71,356 KB
権限があれば一括ダウンロードができます

ソースコード

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