Format integers Sergey Svistunov

Compute a checksum over the decimal representations of binary integers as fast as possible.

Input: 250 000 000 uint32 values in little-endian binary on STDIN (4 bytes each).

Output: A uint64 checksum computed as:

CRC = sum of number_crc(n) for each n

where number_crc(n) converts n to its decimal string and sums ascii(digit) * position over each digit (0-indexed from the left).

Example: For n = 42, the decimal string is "42", so number_crc(42) = ascii('4') * 0 + ascii('2') * 1 = 52 * 0 + 50 * 1 = 50.

Back to listOct 4, 2022 15:55Robert BurkeRobert BurkeScore: 55,408Success
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 4, 2022 15:5552,972324,860,983259,561,16402,187,264
2Oct 4, 2022 15:5552,995331,131,822259,677,91102,179,072
3Oct 4, 2022 15:5555,140329,747,873270,185,26402,179,072
4Oct 4, 2022 15:5555,373291,410,377270,326,0001,001,0002,281,472
5Oct 4, 2022 15:5555,394297,154,830269,434,0001,995,0002,445,312
6Oct 4, 2022 15:5555,403296,955,882270,476,0001,001,0002,441,216
7Oct 4, 2022 15:5555,408297,727,136270,503,000998,0002,437,120
8Oct 4, 2022 15:5555,432293,504,845269,619,0001,997,0002,445,312
9Oct 4, 2022 15:5555,447298,295,376269,691,0001,997,0002,445,312
10Oct 4, 2022 15:5555,797299,453,390272,403,0001,001,0002,281,472
11Oct 4, 2022 15:5555,814300,921,920272,486,0001,001,0002,281,472
12Oct 4, 2022 15:5555,990294,922,872273,351,0001,001,0002,535,424