結果

問題 No.539 インクリメント
ユーザー mitsuo
提出日時 2018-08-22 10:40:13
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 544 bytes
コンパイル時間 270 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 14,976 KB
最終ジャッジ日時 2024-12-23 12:48:43
合計ジャッジ時間 1,826 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 1 RE * 2
権限があれば一括ダウンロードができます

ソースコード

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