結果
問題 |
No.539 インクリメント
|
ユーザー |
![]() |
提出日時 | 2019-05-20 23:10:27 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 407 bytes |
コンパイル時間 | 122 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,444 KB |
最終ジャッジ日時 | 2024-09-17 06:44:26 |
合計ジャッジ時間 | 848 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 1 RE * 2 |
ソースコード
import re N = int(input()) ptn = '[0-9]+' for i in range(N): S = str(input()) o = re.search(ptn, S[::-1]) if o == None: print(S) else: num = int(o.group()[::-1]) + 1 l = o.end() - o.start() if o.start() == 0: print(S[: - o.end()] + str(num).zfill(l)) else: print(S[: - o.end()] + str(num).zfill(l) + S[-o.start():])