結果

問題 No.539 インクリメント
コンテスト
ユーザー Chihaya_chan
提出日時 2020-06-14 20:08:57
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 492 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 566 ms
コンパイル使用メモリ 85,280 KB
実行使用メモリ 72,320 KB
最終ジャッジ日時 2026-03-15 23:59:16
合計ジャッジ時間 1,517 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 1 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys

def II(): return int(sys.stdin.readline())

def main():
    def plus1(s):
        n=len(s)
        num=str(int(s)+1).zfill(n)
        return num

    t=II()
    for _ in range(t):
        s=input()
        n=len(s)
        for r in range(n,0,-1):
            if s[r-1].isdigit():break
        else:
            print(s)
            continue
        for l in range(r,0,-1):
            if not s[l-1].isdigit():break
        else:l=0
        print(s[:l]+plus1(s[l:r])+s[r:])

main()
0