用了简单的做法 lower_bound看了他们暴力枚举才知道二分的使用意义 就是在查询能否在数组中找到-c这个值 #include <bits/stdc++.h> using namespace std; const int N = 1010; int a[N]; int n, x; bool find(int c) { return c == *lower_bound(a, a+n, c); } int main() { cin >> n >> x; for (int i = 0; i < n; i ++) cin >...