正文
增加 5 行删除 5 行
11 行未改动1213141516171819203 行未改动24252627282930313220 行未改动535455565758596061626364654 行未改动7071727374757677782 行未改动11 行未改动具体来说,把 $0$ 和以下 $7$ 种运算的结果全部收集起来,去重后集合的大小就是答案:- $x$- $y$- $x$ 与 $y$ 的按位与3 行未改动- $x$ 与 $y$ 的按位异或- $x$ 异或上 $x$ 与 $y$ 的按位与- $y$ 异或上 $x$ 与 $y$ 的按位与:::info[证明:为什么结论成立]20 行未改动int main(){ios::sync_with_stdio(0);cin.tie(0);int n;cin>>n;for(int i=0;i<n;i++) cin>>a[i];unordered_set<int>st;st.insert(0);for(int i=1;i<n;i++){int x=a[i],y=a[i-1];4 行未改动st.insert(x^y);st.insert(x^(x&y));st.insert(y^(x&y));}cout<<st.size();return 0;}```2 行未改动11 行未改动1213141516171819203 行未改动24252627282930313220 行未改动535455565758596061626364654 行未改动7071727374757677782 行未改动11 行未改动具体来说,把 $0$ 和以下 $7$ 种运算的结果全部收集起来,去重后集合的大小就是答案:- $x$- $y$- $x$ 与 $y$ 的按位与3 行未改动- $x$ 与 $y$ 的按位异或- $x$ 异或上 $x$ 与 $y$ 的按位与- $y$ 异或上 $x$ 与 $y$ 的按位与:::info[证明:为什么结论成立]20 行未改动int main(){ios::sync_with_stdio(0);cin.tie(0);int n;cin>>n;for(int i=0;i<n;i++) cin>>a[i];unordered_set<int>st;st.insert(0);for(int i=1;i<n;i++){int x=a[i],y=a[i-1];4 行未改动st.insert(x^y);st.insert(x^(x&y));st.insert(y^(x&y));}cout<<st.size();return 0;}```2 行未改动