#include<iostream>
using namespace std;
int main()
{
long int n, t, i, j;
cin >> t;
for(i = 1; i <= t; i++)
{
cin >> n;
j = n;
while(j++)
{
if(__builtin_popcount(n) != __builtin_popcount(j))
{
continue;
}
else
cout << "Case " << i << ": " << j << endl;
break;
}
}
return 0;
}
ahmed shuvo969
using namespace std;
int main()
{
long int n, t, i, j;
cin >> t;
for(i = 1; i <= t; i++)
{
cin >> n;
j = n;
while(j++)
{
if(__builtin_popcount(n) != __builtin_popcount(j))
{
continue;
}
else
cout << "Case " << i << ": " << j << endl;
break;
}
}
return 0;
}
ahmed shuvo969
Is that code is efficient?? or Are you got ac or not??Because i use the
উত্তরমুছুন__builtin_popcount() function but it's show TLE
ha ha ha
উত্তরমুছুন