社区讨论
80pts求条
P13686 【MX-X16-T4】「DLESS-3」XOR and Split参与者 3已保存回复 5
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 5 条
- 当前快照
- 1 份
- 快照标识符
- @mhjhxgbn
- 此快照首次捕获于
- 2025/11/04 02:51 4 个月前
- 此快照最后确认于
- 2025/11/04 02:51 4 个月前
CPP
#include<bits/stdc++.h>
using namespace std;
const int N=403;
bool dp[N][N][4*N+5];
int maxx[N];
inline void out(__int128 n)
{
if(n>=10)
{
out(n/10);
}
putchar(n%10+'0');
}
int main()
{
ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
int T;
cin>>T;
while(T--)
{
long long n;
cin>>n;
if(n==(n&(-n))) cout<<n+((n/2)%2)<<'\n';
else
{
__int128 x=1;
if(n==3) cout<<2<<'\n';
else
{
for(int i=1;i<=log2(n)+1;i++) x*=2;
x--;
out(x);
cout<<'\n';
}
}
}
return 0;
}
回复
共 5 条回复,欢迎继续交流。
正在加载回复...