結果

問題 No.1455 拡張ROTN
ユーザー roarisroaris
提出日時 2021-03-31 22:12:22
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 636 bytes
コンパイル時間 645 ms
コンパイル使用メモリ 87,260 KB
実行使用メモリ 77,944 KB
最終ジャッジ日時 2023-08-22 02:18:29
合計ジャッジ時間 4,077 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
71,600 KB
testcase_01 AC 91 ms
71,568 KB
testcase_02 AC 114 ms
77,564 KB
testcase_03 AC 110 ms
77,944 KB
testcase_04 AC 112 ms
77,864 KB
testcase_05 AC 101 ms
77,260 KB
testcase_06 AC 112 ms
77,844 KB
testcase_07 AC 111 ms
77,780 KB
testcase_08 AC 110 ms
77,684 KB
testcase_09 AC 109 ms
77,908 KB
testcase_10 AC 96 ms
76,540 KB
testcase_11 AC 99 ms
77,332 KB
testcase_12 AC 100 ms
77,284 KB
testcase_13 AC 93 ms
71,584 KB
testcase_14 AC 103 ms
77,548 KB
testcase_15 AC 93 ms
71,528 KB
testcase_16 AC 101 ms
77,424 KB
testcase_17 AC 108 ms
77,508 KB
testcase_18 AC 109 ms
77,664 KB
testcase_19 AC 109 ms
77,564 KB
testcase_20 AC 108 ms
77,820 KB
testcase_21 AC 101 ms
77,248 KB
testcase_22 AC 90 ms
71,640 KB
testcase_23 AC 101 ms
77,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

def forward(s):
    if '0'<=s<'9':
        return str((int(s)+1))
    elif s=='9':
        return 'CpCzNkSuTbEoA'
    elif 'a'<=s<='z':
        return chr((ord(s)-ord('a')+1)%26+ord('a'))
    else:
        return chr((ord(s)-ord('A')+1)%26+ord('A'))

S = input()[:-1]
N = int(input())

for _ in range(min(15, N)):
    T = []
    
    for i in range(len(S)):
        T.append(forward(S[i]))
    
    S = ''.join(T)

if N>15:
    S = list(S)
    
    for i in range(len(S)):
        for j in range((N-15)%26):
            S[i] = forward(S[i])
            
print(''.join(S))
0