結果

問題 No.1455 拡張ROTN
ユーザー shotoyooshotoyoo
提出日時 2021-03-31 21:10:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 563 bytes
コンパイル時間 1,451 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 76,412 KB
最終ジャッジ日時 2023-08-21 21:43:29
合計ジャッジ時間 4,140 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,152 KB
testcase_01 AC 72 ms
71,232 KB
testcase_02 AC 93 ms
75,948 KB
testcase_03 AC 73 ms
71,224 KB
testcase_04 AC 78 ms
76,412 KB
testcase_05 AC 71 ms
71,328 KB
testcase_06 AC 73 ms
75,112 KB
testcase_07 AC 72 ms
71,240 KB
testcase_08 AC 73 ms
71,252 KB
testcase_09 AC 71 ms
71,232 KB
testcase_10 AC 72 ms
71,204 KB
testcase_11 AC 71 ms
71,192 KB
testcase_12 AC 73 ms
71,224 KB
testcase_13 AC 72 ms
71,252 KB
testcase_14 AC 74 ms
71,240 KB
testcase_15 AC 73 ms
71,332 KB
testcase_16 AC 74 ms
71,280 KB
testcase_17 AC 73 ms
71,228 KB
testcase_18 AC 73 ms
71,112 KB
testcase_19 AC 74 ms
71,276 KB
testcase_20 AC 73 ms
71,028 KB
testcase_21 AC 72 ms
71,244 KB
testcase_22 AC 72 ms
71,160 KB
testcase_23 AC 72 ms
71,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda : sys.stdin.readline().rstrip()

sys.setrecursionlimit(2*10**5+10)
write = lambda x: sys.stdout.write(x+"\n")
debug = lambda x: sys.stderr.write(x+"\n")

s = input()
n = int(input())
def sub(c,n=n):
    if c.isdigit():
        if int(c)+n<=9:
            return str(int(c)+n)
        else:
            return "".join([sub(cc, n-(10-int(c))) for cc in "CpCzNkSuTbEoA"])
    elif c.lower()==c:
        return chr((ord(c)-ord("a")+n)%26 + ord("a"))
    else:
        return chr((ord(c)-ord("A")+n)%26 + ord("A"))
print("".join(map(sub, s)))
0