版本比较
!✨3.13总结✨!
正文
增加 8 行删除 8 行
3 行未改动45678891011124 行未改动1718192021212223242526272829293031323312 行未改动4647484950505152535458 行未改动1131141151161171171181191201217 行未改动12913013113213313313413513613713 行未改动15115215315415515515615715815916016016116216316479 行未改动3 行未改动### 错误代码🐎:```cpp#include<bits/stdc++.h>using namespace std;int t; int t;int main(){ cin>>t; while(t--){ int n,m;4 行未改动 cout<<"YES\n"; } } return 0;} }```### 错误原因:只算了一种yes可能……### 正确代码🐎:```cpp#include<bits/stdc++.h>using namespace std;int t; int t;int main(){ cin>>t; while(t--){ int n,m;12 行未改动 } } } return 0;} }```## 2 - P14664 [KenOI 2025] 异或题### 简单15分暴力代码🐎```cpp58 行未改动### 错误代码🐎:```cpp#include<bits/stdc++.h>using namespace std;int t,a[100005],b[100005]; int t,a[100005],b[100005];int main(){ cin>>t; while(t--){ int n;7 行未改动 for(int j=1;j<n;j++){ int l=0; for(int h=1;h<=n;h++){ if(h==j){
}else{ l^=a[h]; } }13 行未改动```### 错误原因:暴力报错### 正确思路:首先要满足条件a≤a⊕b≤b,那么a,b最高位要不同,不然就比他们都小,然后第2个b的1要异或掉,期间只能有0,后面随便我们发现,如果n是奇数,那么只要搞一遍,后面都不变,偶数则只要做k mod 2次就可以了### 正确代码🐎:```cpp#include<bits/stdc++.h>using namespace std;long long t,a[100005],b[100005]; long long t,a[100005],b[100005];int main(){ cin>>t; while(t--){ long long n;79 行未改动