0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-24 03:28:48 +00:00
OI-codes/Codeforces/1682/B/B.cpp

31 lines
399 B
C++

#include <iostream>
#include <algorithm>
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;
}