結果
| 問題 |
No.2486 Don't come next to me
|
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2023-09-29 21:27:03 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 291 bytes |
| コンパイル時間 | 494 ms |
| コンパイル使用メモリ | 82,464 KB |
| 実行使用メモリ | 106,312 KB |
| 最終ジャッジ日時 | 2024-07-22 15:25:48 |
| 合計ジャッジ時間 | 3,847 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | WA * 20 |
ソースコード
'''
8の時
4 1 3
oooo-o*o
3 1 4
o*o-oooo
6の時
3 1 2
o*o-oo
oo-o*o
'''
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+=1
ans+=count*tmp
print(ans)
nikoro256