結果

問題 No.2486 Don't come next to me
ユーザー ntudantuda
提出日時 2023-10-01 15:43:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 268 bytes
コンパイル時間 367 ms
コンパイル使用メモリ 87,168 KB
実行使用メモリ 107,740 KB
最終ジャッジ日時 2023-10-01 15:44:04
合計ジャッジ時間 4,594 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
103,480 KB
testcase_01 AC 124 ms
99,584 KB
testcase_02 AC 92 ms
82,840 KB
testcase_03 AC 108 ms
96,472 KB
testcase_04 AC 124 ms
99,740 KB
testcase_05 AC 109 ms
96,312 KB
testcase_06 AC 113 ms
96,184 KB
testcase_07 AC 82 ms
78,700 KB
testcase_08 AC 96 ms
83,772 KB
testcase_09 AC 126 ms
98,932 KB
testcase_10 AC 108 ms
95,972 KB
testcase_11 AC 97 ms
88,044 KB
testcase_12 AC 84 ms
80,272 KB
testcase_13 AC 135 ms
107,740 KB
testcase_14 AC 90 ms
85,088 KB
testcase_15 AC 106 ms
95,812 KB
testcase_16 AC 80 ms
79,212 KB
testcase_17 AC 90 ms
83,892 KB
testcase_18 AC 88 ms
82,948 KB
testcase_19 AC 87 ms
83,796 KB
testcase_20 AC 67 ms
71,332 KB
testcase_21 AC 72 ms
71,512 KB
testcase_22 AC 68 ms
71,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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