結果

問題 No.1455 拡張ROTN
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-03-31 22:26:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 667 bytes
コンパイル時間 386 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 76,612 KB
最終ジャッジ日時 2023-08-22 02:43:46
合計ジャッジ時間 3,781 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,448 KB
testcase_01 AC 75 ms
71,272 KB
testcase_02 AC 81 ms
76,352 KB
testcase_03 AC 77 ms
71,148 KB
testcase_04 AC 82 ms
76,612 KB
testcase_05 AC 77 ms
71,148 KB
testcase_06 AC 82 ms
76,280 KB
testcase_07 AC 81 ms
71,248 KB
testcase_08 AC 78 ms
71,468 KB
testcase_09 AC 76 ms
71,204 KB
testcase_10 AC 74 ms
71,020 KB
testcase_11 AC 79 ms
71,152 KB
testcase_12 AC 73 ms
71,356 KB
testcase_13 AC 75 ms
70,976 KB
testcase_14 AC 76 ms
71,144 KB
testcase_15 AC 76 ms
71,472 KB
testcase_16 AC 74 ms
71,140 KB
testcase_17 AC 76 ms
71,272 KB
testcase_18 AC 79 ms
71,380 KB
testcase_19 AC 75 ms
71,476 KB
testcase_20 AC 76 ms
71,288 KB
testcase_21 AC 82 ms
71,248 KB
testcase_22 AC 76 ms
71,268 KB
testcase_23 AC 75 ms
70,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
n = int(input())
C = "CpCzNkSuTbEoA"
ans = ""
"123456789"
a = [chr(i+ord("a")) for i in range(26)]
A = [chr(i+ord("A")) for i in range(26)]

for s in S:
    if s in a:
        ind = a.index(s)
        ans += a[(ind+n)%26]
    elif s in A:
        ind = A.index(s)
        ans += A[(ind+n)%26]
    else:
        s = int(s)
        if s+n <= 9:
            ans += str(s+n)
        else:
            nn = n+s-10
            for c in C:
                if c in a:
                    ind = a.index(c)
                    ans += a[(ind+nn)%26]
                if c in A:
                    ind = A.index(c)
                    ans += A[(ind+nn)%26]
print(ans)
0