__builtin_popcountll() :
相当于
int res = 0,x = 0; cin >> x; for (int i = 0;i < n;i ++ ) res += x >> i & 1; cout << res << '\n';