0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-09 17:18:49 +00:00

B - AND Sorting

https://codeforces.com/contest/1682/submission/158031002
This commit is contained in:
Baoshuo Ren 2022-05-22 23:07:42 +08:00
parent 60c24a78c1
commit b7f96f7879
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

30
Codeforces/1682/B/B.cpp Normal file
View File

@ -0,0 +1,30 @@
#include <algorithm>
#include <iostream>
using std::cin;
using std::cout;
const char endl = '\n';
int t, n;
int main() {
std::ios::sync_with_stdio(false);
cin >> t;
while (t--) {
cin >> n;
int ans = -1;
for (int i = 0, x; i < n; i++) {
cin >> x;
if (x != i) ans &= x;
}
cout << ans << endl;
}
return 0;
}