結果
問題 | No.2486 Don't come next to me |
ユーザー |
![]() |
提出日時 | 2023-09-29 21:33:04 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 114 ms / 2,000 ms |
コード長 | 264 bytes |
コンパイル時間 | 374 ms |
コンパイル使用メモリ | 82,328 KB |
実行使用メモリ | 105,868 KB |
最終ジャッジ日時 | 2024-07-22 15:33:53 |
合計ジャッジ時間 | 3,942 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
''' 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)