Fast Bit Counting

View as PDF

Submit solution

Points: 10 (partial)
Time limit: 0.5s
Memory limit: 64M

Author:
Problem type
Allowed languages
C, C++

Given 64-bit unsigned integers, count the bits set in each one.

Implementation

One function:

int setbits(unsigned long long);

Your function may be called up to 10^8 times.

Constraints

Your code must be less than 560 characters in length. 560 characters is plenty for any sane solution. Otherwise, only half of the points are awarded.


Comments


  • 25
    d  commented on April 23, 2020, 2:34 p.m.

    • -13
      wleung_bvg  commented on June 15, 2020, 4:36 p.m.

      This comment is hidden due to too much negative feedback. Click here to view it.