mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-23 18:48:48 +00:00
B - Patchouli's Magical Talisman
https://codeforces.com/contest/1688/submission/159633612
This commit is contained in:
parent
e937f5acca
commit
4b4a4f1b2c
39
Codeforces/1688/B/B.cpp
Normal file
39
Codeforces/1688/B/B.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user