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 listSep 5, 2024 04:09matsuoka-601matsuoka-601Score: 52,671Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 5, 2024 04:0952,602285,224,689255,750,0001,998,0002,330,624
2Sep 5, 2024 04:0952,614280,124,033255,813,0001,998,0002,281,472
3Sep 5, 2024 04:0952,628282,816,368255,878,0001,999,0002,326,528
4Sep 5, 2024 04:0952,654280,323,482256,005,0002,000,0002,281,472
5Sep 5, 2024 04:0952,671281,133,256256,090,0002,000,0002,281,472
6Sep 5, 2024 04:0952,709278,802,791257,275,0001,001,0002,428,928
7Sep 5, 2024 04:0953,149286,623,258259,428,0001,001,0002,424,832
8Sep 5, 2024 04:0953,632281,335,776260,799,0001,998,0002,326,528
9Sep 5, 2024 04:0953,653286,601,144260,899,0001,999,0002,281,472