結果

問題 No.539 インクリメント
ユーザー kokoa1046kokoa1046
提出日時 2017-10-11 15:32:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 594 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 13,056 KB
最終ジャッジ日時 2024-04-28 16:06:21
合計ジャッジ時間 872 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,880 KB
testcase_01 AC 32 ms
12,928 KB
testcase_02 RE -
testcase_03 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

n= int(input())
li=[input() for _ in range(n)]
for i in li:
    flag=False
    j=len(i)-1
    while True:
        if j<0:
            print(i)
            break
        if not i[j].isdigit():
            j-=1
            continue
        else:
            k=j
            while 0<=k<len(i) and i[k].isdigit():
                k-=1
            numlen=len(i[k+1:j+1])
            num=int(i[k+1:j+1])+1
            numincedstr=str(num).zfill(numlen)
            i=i[:k+1]+numincedstr+i[j+1:]
            j-=len(numincedstr)
            print(i)
            break
            
            
        
0