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 4, 2022 12:19Robert BurkeRobert BurkeScore: 55,395Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 4, 2022 12:1952,998329,558,958259,691,38002,191,360
2Oct 4, 2022 12:1953,103325,629,200260,203,01002,179,072
3Oct 4, 2022 12:1955,363296,030,927270,278,0001,001,0002,441,216
4Oct 4, 2022 12:1955,363291,686,713270,279,0001,001,0002,269,184
5Oct 4, 2022 12:1955,375295,127,850270,337,0001,001,0002,441,216
6Oct 4, 2022 12:1955,380293,933,517270,361,0001,001,0002,281,472
7Oct 4, 2022 12:1955,395296,634,152270,434,0001,001,0002,441,216
8Oct 4, 2022 12:1955,751302,837,460273,182,00002,281,472
9Oct 4, 2022 12:1955,854293,824,899271,688,0001,997,0002,445,312
10Oct 4, 2022 12:1955,932298,127,841272,069,0002,000,0002,281,472
11Oct 4, 2022 12:1956,619337,230,044277,433,80002,170,880
12Oct 4, 2022 12:1956,790301,427,067278,273,00002,281,472