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 23, 2022 05:39Bernard TeoBernard TeoScore: 63,546Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 23, 2022 05:3958,479339,105,766286,546,94602,269,184
2Oct 23, 2022 05:3958,510346,868,164286,698,05202,273,280
3Oct 23, 2022 05:3960,910364,907,012298,458,61802,273,280
4Oct 23, 2022 05:3963,451332,687,950309,911,000999,0002,281,472
5Oct 23, 2022 05:3963,493332,726,786310,114,0001,000,0002,281,472
6Oct 23, 2022 05:3963,521336,038,197310,255,0001,000,0002,281,472
7Oct 23, 2022 05:3963,546341,788,803311,373,00002,396,160
8Oct 23, 2022 05:3963,555339,569,703310,417,0001,001,0002,281,472
9Oct 23, 2022 05:3963,569338,882,349310,491,000998,0002,281,472
10Oct 23, 2022 05:3963,582340,552,014309,557,0001,997,0002,482,176
11Oct 23, 2022 05:3963,597336,805,721310,628,000998,0002,281,472
12Oct 23, 2022 05:3963,625336,102,852309,763,0001,998,0002,400,256