版本比较
2026/3/13 蒋
正文
增加 26 行删除 26 行
10 行未改动111213141516171819202122232425262728293031323334353637383940414221 行未改动64656667686970717273747576777879808113 行未改动959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113231 行未改动1641651661671681691701711721731741751761771781791801811821835 行未改动18919019119219319419519619719819920020120220320420520620720823 行未改动2322332342352362372382392407 行未改动2482492502512522532542552562572582592602615 行未改动2672682692702712722732742754 行未改动10 行未改动#include<bits/stdc++.h>using namespace std;int t, n, m;void solve(){cin >> n >> m;if(m % 2 != 0){if(n == 0){cout << "No" << "\n";return ;}cout << "Yes" << "\n";}else{if(n != 0){cout << "No" << "\n";return ;}cout << "Yes" << "\n";}}21 行未改动## 代码:```cpp#include<bits/stdc++.h>#define int long longusing namespace std;int t, n;void solve(){cin >> n;string sa = "", sb = "";int o = 0;for(int i = 30; i >= 0; i--){13 行未改动}}else{if(o < 2){sa += '0';sb += '0';}else{sa += '1';sb += '1';}}}int a = 0, b = 0, chang = 1;for(int i = 0; i < sa.size(); i++){a = a * 2 + (sa[i] - '0');b = b * 2 + (sb[i] - '0');}cout << a + b << "\n";return ;}signed main(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin >> t;while(t--){solve();31 行未改动for(int i = 1; i <= n; i++){cin >> a[i];}int o = a[1];for(int i = 2; i <= n; i++){o ^= a[i];}for(int i = 1; i <= n; i++){a[i] ^= o;}if(n % 2 == 1){for(int i = 1; i <= n; i++){5 行未改动if(k % 2 == 1){for(int i = 1; i <= n; i++){cout << a[i] << " ";}}else{for(int i = 1; i <= n; i++){cout << (a[i] ^ o) << " ";}}}cout << "\n";}return 0;}23 行未改动for(int i = 1; i <= n; i++){cin >> s[i];}int maxi = -1e9;for(int i = 0; i < s[1].size(); i++){int ans1 = 0, ans0 = 0;7 行未改动{ans1++;}}if(ans1 >= 2 && ans0 >= 1){continue;}if(ans1 >= 2){maxi = max(maxi, 1);}5 行未改动{maxi = max(maxi, 2 - ans1 + 1);}}if(maxi == -1e9){maxi = 0;}4 行未改动10 行未改动111213141516171819202122232425262728293031323334353637383940414221 行未改动64656667686970717273747576777879808113 行未改动959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113231 行未改动1641651661671681691701711721731741751761771781791801811821835 行未改动18919019119219319419519619719819920020120220320420520620720823 行未改动2322332342352362372382392407 行未改动2482492502512522532542552562572582592602615 行未改动2672682692702712722732742754 行未改动10 行未改动#include<bits/stdc++.h>using namespace std;int t, n, m;void solve(){cin >> n >> m;if(m % 2 != 0){if(n == 0){cout << "No" << "\n";return ;}cout << "Yes" << "\n";}else{if(n != 0){cout << "No" << "\n";return ;}cout << "Yes" << "\n";}}21 行未改动## 代码:```cpp#include<bits/stdc++.h>#define int long longusing namespace std;int t, n;void solve(){cin >> n;string sa = "", sb = "";int o = 0;for(int i = 30; i >= 0; i--){13 行未改动}}else{if(o < 2){sa += '0';sb += '0';}else{sa += '1';sb += '1';}}}int a = 0, b = 0, chang = 1;for(int i = 0; i < sa.size(); i++){a = a * 2 + (sa[i] - '0');b = b * 2 + (sb[i] - '0');}cout << a + b << "\n";return ;}signed main(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin >> t;while(t--){solve();31 行未改动for(int i = 1; i <= n; i++){cin >> a[i];}int o = a[1];for(int i = 2; i <= n; i++){o ^= a[i];}for(int i = 1; i <= n; i++){a[i] ^= o;}if(n % 2 == 1){for(int i = 1; i <= n; i++){5 行未改动if(k % 2 == 1){for(int i = 1; i <= n; i++){cout << a[i] << " ";}}else{for(int i = 1; i <= n; i++){cout << (a[i] ^ o) << " ";}}}cout << "\n";}return 0;}23 行未改动for(int i = 1; i <= n; i++){cin >> s[i];}int maxi = -1e9;for(int i = 0; i < s[1].size(); i++){int ans1 = 0, ans0 = 0;7 行未改动{ans1++;}}if(ans1 >= 2 && ans0 >= 1){continue;}if(ans1 >= 2){maxi = max(maxi, 1);}5 行未改动{maxi = max(maxi, 2 - ans1 + 1);}}if(maxi == -1e9){maxi = 0;}4 行未改动