0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 03:31:59 +00:00

B - Patchouli's Magical Talisman

https://codeforces.com/contest/1688/submission/159633612
This commit is contained in:
Baoshuo Ren 2022-06-07 09:01:39 +08:00
parent e937f5acca
commit 4b4a4f1b2c
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

39
Codeforces/1688/B/B.cpp Normal file
View File

@ -0,0 +1,39 @@
#include <iostream>
#include <algorithm>
using std::cin;
using std::cout;
const char endl = '\n';
const int N = 2e5 + 5;
int t, n, a[N];
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> t;
while (t--) {
int ans = 0;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
a[i] = __builtin_ffs(a[i]) - 1;
}
ans = std::max(*std::min_element(a + 1, a + 1 + n) - 1, 0);
for (int i = 1; i <= n; i++) {
if (a[i] > 0) ans++;
}
cout << ans << endl;
}
return 0;
}