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 1, 2024 23:58Joad NacerJoad NacerScore: 631,909Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 1, 2024 23:57627,6653,136,440,3103,075,559,47002,277,376
2May 1, 2024 23:57627,6863,146,229,7333,075,663,44102,269,184
3May 1, 2024 23:58627,7073,140,036,0983,075,762,43802,285,568
4May 1, 2024 23:57631,9093,155,631,2183,096,352,47402,269,184
5May 1, 2024 23:58631,9113,169,313,3833,096,361,48502,281,472
6May 1, 2024 23:58631,9873,170,603,2373,096,737,27802,273,280