mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-23 22:28:48 +00:00
B - AND Sorting
https://codeforces.com/contest/1682/submission/158031002
This commit is contained in:
parent
60c24a78c1
commit
b7f96f7879
30
Codeforces/1682/B/B.cpp
Normal file
30
Codeforces/1682/B/B.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user