Fast Bit Counting

View as PDF

Submit solution

Points: 10 (partial)
Time limit: 0.1s
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