mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-24 12:48:49 +00:00
31 lines
399 B
C++
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;
|
||
|
}
|