0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-05 13:38:47 +00:00
OI-codes/Codeforces/1682/B/B.cpp

31 lines
399 B
C++

#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;
}