結果

問題 No.2486 Don't come next to me
ユーザー nikoro256nikoro256
提出日時 2023-09-29 21:33:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 264 bytes
コンパイル時間 841 ms
コンパイル使用メモリ 86,796 KB
実行使用メモリ 107,520 KB
最終ジャッジ日時 2023-09-29 21:33:09
合計ジャッジ時間 4,510 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
103,100 KB
testcase_01 AC 108 ms
99,008 KB
testcase_02 AC 79 ms
82,888 KB
testcase_03 AC 96 ms
95,984 KB
testcase_04 AC 107 ms
99,444 KB
testcase_05 AC 96 ms
95,900 KB
testcase_06 AC 101 ms
95,924 KB
testcase_07 AC 82 ms
78,244 KB
testcase_08 AC 78 ms
83,624 KB
testcase_09 AC 109 ms
98,508 KB
testcase_10 AC 99 ms
95,836 KB
testcase_11 AC 89 ms
87,792 KB
testcase_12 AC 77 ms
80,252 KB
testcase_13 AC 122 ms
107,520 KB
testcase_14 AC 81 ms
85,016 KB
testcase_15 AC 96 ms
95,880 KB
testcase_16 AC 71 ms
78,848 KB
testcase_17 AC 80 ms
83,636 KB
testcase_18 AC 99 ms
82,576 KB
testcase_19 AC 79 ms
83,720 KB
testcase_20 AC 58 ms
71,132 KB
testcase_21 AC 58 ms
71,080 KB
testcase_22 AC 59 ms
71,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

'''
8の時
4 1 3
oooo-o*o
3 1 4
o*o-oooo

'''
N,M=map(int,input().split())
A=list(map(int,input().split()))
ans=0
for i in range(1,M):
    tmp=A[i]-A[i-1]-1
    count=1
    while tmp!=1 and tmp%2!=0:
        tmp//=2
        count*=2
    ans+=count*tmp
print(ans)
0