結果
問題 |
No.539 インクリメント
|
ユーザー |
![]() |
提出日時 | 2019-05-20 21:21:50 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 312 bytes |
コンパイル時間 | 96 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 11,392 KB |
最終ジャッジ日時 | 2024-09-17 06:42:30 |
合計ジャッジ時間 | 1,437 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 1 RE * 2 |
ソースコード
import re N = int(input()) ptn = '[0-9]+' for i in range(N): S = str(input()) lst = re.findall(ptn, S) if len(lst) == 0: print(S) else: n1 = lst[len(lst) - 1] n2 = int(n1) + 1 print(S[:S.rindex(n1)] + str(n2).zfill(len(n1)) + S[S.rindex(n1) + len(n1):])