結果

問題 No.539 インクリメント
ユーザー Ikazuchis_diary
提出日時 2017-07-04 22:04:54
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 499 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 12,928 KB
最終ジャッジ日時 2024-10-05 16:14:22
合計ジャッジ時間 1,015 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other WA * 1 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

import re

T = int(input())
S = []
for i in range(T):
    S.append(input())

for s in S:
    pattern = r'\d+'
    iterator = re.finditer(pattern, s)
    match = 0
    longest = 0
    for i in iterator:
        if len(i.group()) >= longest:
            match = i
            longest = len(i.group())
    if match == 0:
        print(s)
        continue
    ans = s[:match.start()]
    ans += ('%0' + str(len(match.group())) + 'd') % (int(match.group()) + 1)
    ans += s[match.end():]
    print(ans)
0