結果

問題 No.2486 Don't come next to me
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2023-09-29 22:10:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 188 bytes
コンパイル時間 460 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 109,048 KB
最終ジャッジ日時 2023-09-29 22:10:31
合計ジャッジ時間 4,438 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
104,256 KB
testcase_01 AC 114 ms
100,520 KB
testcase_02 AC 83 ms
82,924 KB
testcase_03 AC 98 ms
96,760 KB
testcase_04 AC 138 ms
100,684 KB
testcase_05 AC 100 ms
96,200 KB
testcase_06 AC 112 ms
95,932 KB
testcase_07 AC 79 ms
78,568 KB
testcase_08 AC 80 ms
83,984 KB
testcase_09 AC 117 ms
99,748 KB
testcase_10 AC 103 ms
96,724 KB
testcase_11 AC 97 ms
88,516 KB
testcase_12 AC 80 ms
80,256 KB
testcase_13 AC 129 ms
109,048 KB
testcase_14 AC 96 ms
85,380 KB
testcase_15 AC 96 ms
96,560 KB
testcase_16 AC 74 ms
78,960 KB
testcase_17 AC 79 ms
83,896 KB
testcase_18 AC 83 ms
82,868 KB
testcase_19 AC 83 ms
84,192 KB
testcase_20 AC 60 ms
71,104 KB
testcase_21 AC 63 ms
71,300 KB
testcase_22 AC 59 ms
71,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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