题解
2025-08-11 17:03:52
发布于:浙江
8阅读
0回复
0点赞
注意到对于任意 ,,并且肯定无法异或出 。所以答案是 。
诶我超我好像没特判
#include <iostream>
#include <cstdio>
#define int long long
using namespace std;
void solve(){
int n;
cin >> n;
while(n != (n & (-n))) n += (n & (-n));
cout << n << '\n';
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int t;
cin >> t;
while(t--) solve();
return 0;
}
这里空空如也
有帮助,赞一个