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

31 lines
399 B
C++
Raw Normal View History

#include <iostream>
2022-06-01 01:45:41 +00:00
#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;
}