結果
| 問題 |
No.539 インクリメント
|
| コンテスト | |
| ユーザー |
Mr.Fuku
|
| 提出日時 | 2018-08-15 15:48:08 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 475 ms / 2,000 ms |
| コード長 | 702 bytes |
| コンパイル時間 | 95 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 13,524 KB |
| 最終ジャッジ日時 | 2024-09-24 09:25:00 |
| 合計ジャッジ時間 | 2,241 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 3 |
ソースコード
n=int(input())
lst = ["0","1","2","3","4","5","6","7","8","9"]
for i in range(n):
s = list(input())
for j in range(len(s)-1,-1,-1):
if s[j] in lst:
if s[j]!="9":
s[j]=str(int(s[j])+1)
else:
while True:
s[j]="0"
j-=1
if j<0 or s[j] not in lst:
s.insert(j+1,"1")
break
else:
if s[j]=="9":
continue
else:
s[j]=str(int(s[j])+1)
break
break
print("".join(s))
Mr.Fuku