竞赛B班3.22日
Done
IOI
Start at: 2025-3-22 17:30
168
hour(s)
Host:
7
作业是拉萨木数字的部分分、删数问题、金银岛。
#include<bits/stdc++.h>
using namespace std;
const int N=1005;
int a[N][N];
int n,q;
void solve()
{
int cnt=0;
for(int j=0;j<=20;j++) if((n>>j)&1) cnt++;
long long tot=n+1;
while(1)
{
int nowcnt=0;
for(int j=0;j<=20;j++) if((tot>>j)&1) nowcnt++;
if(nowcnt==cnt)
{
cout<<tot<<endl;
return ;
}
tot++;
}
}
int main()
{
while(1)
{
cin>>n;
if(n==0) return 0;
else solve();
}
}
- Status
- Done
- Rule
- IOI
- Problem
- 4
- Start at
- 2025-3-22 17:30
- End at
- 2025-3-29 17:30
- Duration
- 168 hour(s)
- Host
- Partic.
- 7