結果
| 問題 | No.539 インクリメント |
| コンテスト | |
| ユーザー |
Chihaya_chan
|
| 提出日時 | 2020-06-14 19:33:07 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 444 bytes |
| 記録 | |
| コンパイル時間 | 542 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 21,564 KB |
| 最終ジャッジ日時 | 2026-03-15 19:27:39 |
| 合計ジャッジ時間 | 2,539 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | RE * 3 |
コンパイルメッセージ
Main.py:6: SyntaxWarning: "\d" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\d"? A raw string is also an option.
D = re.split('\d+', s)
ソースコード
# yukicoder
import re
T = int(input())
for _ in range(T):
s = input()
D = re.split('\d+', s)
E = re.split("[^][0-9]+", s)
F = []
while E and E[-1] == "":
E.pop()
if E:
E[-1] = str(int(E[-1])+1).zfill(len(E[-1]))
F = []
for some in E:
if some != "":
F.append(some)
ans = ""
for _ in range(len(F)):
ans += D[_]
ans += F[_]
ans += D[-1]
print(ans)
Chihaya_chan