結果

問題 No.1455 拡張ROTN
ユーザー 萩3萩3
提出日時 2021-05-01 09:34:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 682 bytes
コンパイル時間 667 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 77,828 KB
最終ジャッジ日時 2023-09-26 22:05:16
合計ジャッジ時間 4,749 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,748 KB
testcase_01 AC 92 ms
71,576 KB
testcase_02 AC 106 ms
77,820 KB
testcase_03 AC 99 ms
77,024 KB
testcase_04 AC 105 ms
77,828 KB
testcase_05 AC 98 ms
76,548 KB
testcase_06 AC 102 ms
77,112 KB
testcase_07 AC 102 ms
77,048 KB
testcase_08 AC 99 ms
77,264 KB
testcase_09 AC 99 ms
76,504 KB
testcase_10 AC 96 ms
76,712 KB
testcase_11 AC 97 ms
76,720 KB
testcase_12 AC 98 ms
76,568 KB
testcase_13 AC 92 ms
71,384 KB
testcase_14 AC 97 ms
76,636 KB
testcase_15 AC 96 ms
76,616 KB
testcase_16 AC 96 ms
76,356 KB
testcase_17 AC 91 ms
71,664 KB
testcase_18 AC 99 ms
76,784 KB
testcase_19 AC 97 ms
76,548 KB
testcase_20 AC 99 ms
76,764 KB
testcase_21 AC 99 ms
76,352 KB
testcase_22 AC 92 ms
71,664 KB
testcase_23 AC 98 ms
76,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
def resolve():
    s = input()
    n = int(input())
    trans = [None]*256
    trans[ord('9')] = [ord(c) for c in 'CpCzNkSuTbEoA']
    trans[ord('z')] = [ord('a')]
    trans[ord('Z')] = [ord('A')]
    for i in range(9):
        trans[ord(str(i))] = [ord(str(i+1))]
    
    ord_a = ord('a')
    ord_A = ord('A')
    for i in range(25):
        trans[ord_a+i] = [ord_a+i+1]
        trans[ord_A+i] = [ord_A+i+1]

    deq = collections.deque([ord(c) for c in s])
    loop = n if n<=9 else 10 + (n-10)%26
    for _ in range(loop):
        for _ in range(len(deq)):
            deq.extend(trans[deq.popleft()])

    print(*[chr(code) for code in deq],sep='')
resolve()
0