結果
| 問題 |
No.2486 Don't come next to me
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2023-09-29 21:34:42 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 401 bytes |
| コンパイル時間 | 188 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 38,940 KB |
| 最終ジャッジ日時 | 2024-07-22 15:35:31 |
| 合計ジャッジ時間 | 6,473 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | WA * 20 |
ソースコード
N,M=map(int,input().split())
A=list(map(int,input().split()))
LIST=[]
for i in range(1,len(A)):
LIST.append((A[i]-A[i-1]-1,1))
ANS=M
while LIST:
if LIST[-1][0]<=1:
LIST.pop()
elif LIST[-1][0]%2==0:
LIST.pop()
else:
k=LIST[-1][0]
ko=LIST[-1][1]
ANS+=1*ko
LIST.pop()
l=k//2
LIST.append((l,ko+1))
print(N-ANS)
titia