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 25, 2021 04:00evgenikwtevgenikwtScore: 174,629Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 25, 2021 03:54174,313923,008,123854,134,50402,248,704
2Oct 25, 2021 03:49174,321930,350,755854,171,28202,244,608
3Oct 25, 2021 03:54174,364916,132,633854,382,39402,244,608
4Oct 25, 2021 04:00174,593945,430,038855,507,70902,248,704
5Oct 25, 2021 03:49174,629928,609,840855,682,90502,240,512
6Oct 25, 2021 04:00174,864915,526,814856,834,92502,240,512
7Oct 25, 2021 03:49174,865916,266,239856,838,60302,244,608
8Oct 25, 2021 03:54175,401919,146,878859,463,66102,248,704
9Oct 25, 2021 04:00175,975913,922,686862,278,21702,244,608