結果
| 問題 |
No.2486 Don't come next to me
|
| ユーザー |
sotanishy
|
| 提出日時 | 2023-09-29 21:09:45 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 107 ms / 2,000 ms |
| コード長 | 258 bytes |
| コンパイル時間 | 179 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 105,876 KB |
| 最終ジャッジ日時 | 2024-07-22 15:05:16 |
| 合計ジャッジ時間 | 2,970 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
import sys
input = sys.stdin.readline
N, M = map(int, input().split())
ans = 0
A = list(map(int, input().split()))
for i in range(M-1):
d = A[i+1]-A[i]-1
c = 1
while d > 1 and d % 2 == 1:
d //= 2
c *= 2
ans += c*d
print(ans)
sotanishy