結果

問題 No.2486 Don't come next to me
コンテスト
ユーザー aaaaaaaaaa2230
提出日時 2023-09-29 22:10:26
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 188 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 286 ms
コンパイル使用メモリ 84,816 KB
実行使用メモリ 113,920 KB
最終ジャッジ日時 2026-04-03 09:57:42
合計ジャッジ時間 2,534 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n,m = map(int,input().split())
A = list(map(int,input().split()))
ans = 0
for a,na in zip(A,A[1:]):
	d = na-a-1
	num = 1
	while d%2 and d > 2:
		d //= 2
		num *= 2
	ans += d*num
print(ans)
0