結果
| 問題 | No.539 インクリメント |
| コンテスト | |
| ユーザー |
mkawa2
|
| 提出日時 | 2020-01-04 12:08:01 |
| 言語 | Python3 (3.14.2 + numpy 2.4.0 + scipy 1.16.3) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 612 bytes |
| 記録 | |
| コンパイル時間 | 138 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-11-22 20:09:19 |
| 合計ジャッジ時間 | 841 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | RE * 3 |
ソースコード
import sys
def II(): return int(sys.stdin.buffer.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=sys.stdin.buffer.readline()[:-1]
n=len(s)
for i,c in enumerate(s[::-1]):
if c.isdigit():
r=n-i
break
else:
print(s)
continue
for j,c in enumerate(s[r-1::-1]):
if not c.isdigit():
l=n-i-j
break
else:l=0
print(s[:l]+plus1(s[l:r])+s[r:])
main()
mkawa2