結果

問題 No.539 インクリメント
ユーザー H3PO4H3PO4
提出日時 2020-09-16 21:32:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 232 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 10,616 KB
実行使用メモリ 9,440 KB
最終ジャッジ日時 2023-09-04 03:58:58
合計ジャッジ時間 955 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
9,072 KB
testcase_01 AC 130 ms
9,440 KB
testcase_02 RE -
testcase_03 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import re

T = int(input())
regex = re.compile(r'([0-9]+)([^0-9]*$)')


def func(m):
    num_str = m.group(1)
    return str(int(num_str) + 1).zfill(len(num_str)) + m.group(2)


for _ in range(T):
    print(regex.sub(func, input()))
0