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 listMay 24, 2021 07:32alex3dalex3dScore: 667,329Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 24, 2021 07:32566,8852,837,122,0412,777,736,39102,277,376
2May 24, 2021 07:32566,9442,840,181,4382,778,027,09802,265,088
3May 24, 2021 07:32567,0612,845,858,8082,778,599,00402,281,472
4May 24, 2021 07:32667,3293,335,248,7873,269,912,51002,265,088
5May 24, 2021 07:32669,1873,357,222,5443,279,013,93102,265,088
6May 24, 2021 07:32673,7863,361,510,8683,301,552,68502,269,184