2進数表記時の1の個数を返す
__builtin_popcountll(x) ( long long 型に対応)
long long x;
cin >> x;
cout << __builtin_popcountll(x) << endl;
Go to list of users who liked
More than 1 year has passed since last update.
2進数表記時の1の個数を返す
__builtin_popcountll(x) ( long long 型に対応)
long long x;
cin >> x;
cout << __builtin_popcountll(x) << endl;
Register as a new user and use Qiita more conveniently
Go to list of users who liked