voidsolve() { cin >> n >> k; b.clear(); for (int i = 0; i < n; i ++ ) cin >> a[i]; for (int i = 1; i < n; i ++ ) b.push_back(abs(a[i] - a[i - 1])); sort(b.begin(), b.end()); int ans = 0; for (int i = 0; i < n - k; i ++ ) ans += b[i]; cout << ans << endl; }
voidsolve() { cin >> n; for (int i = 0; i < n; i ++ ) cin >> a[i]; int ans = 0, temp = 0; for (int i = 0; i < n; i ++ ) { if (temp == 0) temp = a[i]; else temp = a[i] & temp;
if (temp == 0) ans ++ ; } if (ans == 0) ans = 1; cout << ans << endl; }