全部评论 3

  • 666

    2026-02-05 来自 浙江

    1
  • 帮忙点个赞吧,谢谢了
    想要罐头

    2026-02-05 来自 浙江

    1
  • #include<bits/stdc++.h>
    using namespace std;

    void solve() {
    int n;
    cin >> n;
    vector<int> v;
    for(int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if(x != i) v.push_back(x);
    }
    int ans = v[0];
    for(int i = 0; i < v.size(); i++) {
    ans = (ans & v[i]);
    }
    cout << ans << endl;
    }

    int main () {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    cin >> t;
    while(t--) solve();
    return 0;
    }

    2026-02-05 来自 浙江

    0

热门讨论