版本比较
题解:P14664 [KenOI 2025] 异或题
正文
增加 6 行删除 6 行
18 行未改动1920212223232425262728292829303132334 行未改动383940414242434445464 行未改动5152535455555657585859606118 行未改动 cin>>T; while(T--){ ll n; cin>>n;
if(n==0){//特判 cout<<"0\n"; continue; }
ll first=1;//找到最高位 while (first*2<=n){ first<<=1; }4 行未改动 while (second*2<=cnt){ second<<=1; } }
//构造a&b的最大值 ll ans=0; if(second>0){ ll mask=first-1;4 行未改动 ans|=i; } } }
cout<<n+2*ans<<"\n"; }
return 0;}```