結果
| 問題 | No.2486 Don't come next to me |
| コンテスト | |
| ユーザー |
mymelochan
|
| 提出日時 | 2023-09-29 23:23:05 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
WJ
不安定
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 649 bytes |
| 記録 | |
| 最終ジャッジ日時 | 2026-08-23 10:49:33 |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
ソースコード
#############################################################
import sys
sys.setrecursionlimit(10**7)
from heapq import heappop,heappush
from collections import deque,defaultdict,Counter
from bisect import bisect_left, bisect_right
from itertools import product,combinations,permutations
ipt = sys.stdin.readline
def iin():
return int(ipt())
def lmin():
return list(map(int,ipt().split()))
#############################################################
N,M = lmin()
A = lmin()
ans = 0
for i in range(M-1):
v = A[i+1]-A[i]-1
ans += v
t = 1
while v%2 and v>=3:
ans -= t
v //= 2
t <<= 1
print(ans)
mymelochan