結果

問題 No.539 インクリメント
ユーザー mitsuomitsuo
提出日時 2018-08-22 10:40:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 544 bytes
コンパイル時間 221 ms
コンパイル使用メモリ 10,972 KB
実行使用メモリ 13,416 KB
最終ジャッジ日時 2023-08-25 01:06:36
合計ジャッジ時間 1,728 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import re

def partsolve(l):
    match_list = re.findall("[0-9]+", l)
    if match_list:
        last = match_list[-1]
        size = len(last)
        replace = ("{:0" + str(size) + "}").format(int(last) + 1)
        data = re.sub(last[::-1], replace[::-1], l[::-1], count=1)
        return data[::-1]
    else:
        return l

def solve(N, lines):
    ret = []
    for l in lines:
        ret.append(partsolve(l))
    return ret

if __name__ == "__main__":
    N = int(input())
    [print(s) for s in solve(N, [input() for _ in range(N)])]
0