結果

問題 No.1455 拡張ROTN
ユーザー hir355hir355
提出日時 2021-03-31 21:17:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 49 ms / 2,000 ms
コード長 1,025 bytes
コンパイル時間 331 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 70,144 KB
最終ジャッジ日時 2024-05-09 04:38:35
合計ジャッジ時間 2,306 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,224 KB
testcase_01 AC 39 ms
52,224 KB
testcase_02 AC 49 ms
70,144 KB
testcase_03 AC 45 ms
63,360 KB
testcase_04 AC 49 ms
69,760 KB
testcase_05 AC 46 ms
59,648 KB
testcase_06 AC 45 ms
62,464 KB
testcase_07 AC 44 ms
61,568 KB
testcase_08 AC 44 ms
61,440 KB
testcase_09 AC 42 ms
58,752 KB
testcase_10 AC 39 ms
52,096 KB
testcase_11 AC 40 ms
52,736 KB
testcase_12 AC 43 ms
58,368 KB
testcase_13 AC 39 ms
52,480 KB
testcase_14 AC 43 ms
58,368 KB
testcase_15 AC 38 ms
52,096 KB
testcase_16 AC 38 ms
52,480 KB
testcase_17 AC 38 ms
52,452 KB
testcase_18 AC 42 ms
58,880 KB
testcase_19 AC 42 ms
58,496 KB
testcase_20 AC 39 ms
52,352 KB
testcase_21 AC 37 ms
52,224 KB
testcase_22 AC 37 ms
51,712 KB
testcase_23 AC 42 ms
58,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()
n = int(input())
if n < 100:
    for i in range(n):
        t = ''
        for c in s:
            if c == 'z':
                t += 'a'
            elif c == 'Z':
                t += 'A'
            elif c == '9':
                t += 'CpCzNkSuTbEoA'
            else:
                t += chr(ord(c) + 1)
        s = t[:]
else:
    for i in range(10):
        t = ''
        for c in s:
            if c == 'z':
                t += 'a'
            elif c == 'Z':
                t += 'A'
            elif c == '9':
                t += 'CpCzNkSuTbEoA'
            else:
                t += chr(ord(c) + 1)
        s = t[:]
    n -= 10
    t = ''
    for c in s:
        if ord(c) <= ord('Z'):
            x = ord(c) + n % 26
            if ord('Z') < x:
                t += chr(x - 26)
            else:
                t += chr(x)
        else:
            x = ord(c) + n % 26
            if ord('z') < x:
                t += chr(x - 26)
            else:
                t += chr(x)
    s = t[:]
print(s)
0