結果
問題 | No.539 インクリメント |
ユーザー |
![]() |
提出日時 | 2024-02-06 08:36:12 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 1,835 ms / 2,000 ms |
コード長 | 616 bytes |
コンパイル時間 | 89 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 14,720 KB |
最終ジャッジ日時 | 2024-09-28 11:54:40 |
合計ジャッジ時間 | 4,206 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 3 |
ソースコード
import syssys.set_int_max_str_digits(0)T=int(input())for tests in range(T):S=input()A=[]flag=0last=-1B=""f=-1for i in range(len(S)-1,-1,-1):if flag==0 and 48<=ord(S[i])<=57:flag=1f=iif flag==0:A.append(S[i])if flag==1:if 48<=ord(S[i])<=57:passelse:last=ibreakif last>=0:B=S[:last+1]C=S[last+1:f+1]if C:X=str(int(C)+1).zfill(len(C))else:X=""print(B+X+"".join(A[::-1]))