結果
| 問題 |
No.539 インクリメント
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2024-02-06 08:36:44 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 831 ms / 2,000 ms |
| コード長 | 616 bytes |
| コンパイル時間 | 273 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 90,212 KB |
| 最終ジャッジ日時 | 2024-09-28 11:54:43 |
| 合計ジャッジ時間 | 2,774 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 3 |
ソースコード
import sys
sys.set_int_max_str_digits(0)
T=int(input())
for tests in range(T):
S=input()
A=[]
flag=0
last=-1
B=""
f=-1
for i in range(len(S)-1,-1,-1):
if flag==0 and 48<=ord(S[i])<=57:
flag=1
f=i
if flag==0:
A.append(S[i])
if flag==1:
if 48<=ord(S[i])<=57:
pass
else:
last=i
break
if 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]))
titia