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 15:51Robert BurkeRobert BurkeScore: 55,389Success
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 15:5152,968325,388,684259,544,03902,179,072
2Oct 4, 2022 15:5153,073326,094,573260,055,55802,179,072
3Oct 4, 2022 15:5153,155340,898,568260,461,89502,183,168
4Oct 4, 2022 15:5155,371293,135,553270,319,0001,001,0002,441,216
5Oct 4, 2022 15:5155,373303,542,320270,328,0001,001,0002,281,472
6Oct 4, 2022 15:5155,376292,879,901270,341,0001,001,0002,281,472
7Oct 4, 2022 15:5155,389299,947,034270,405,0001,001,0002,281,472
8Oct 4, 2022 15:5155,439294,595,900269,653,0001,997,0002,535,424
9Oct 4, 2022 15:5155,852294,708,890271,679,0001,997,0002,281,472
10Oct 4, 2022 15:5155,880297,866,320271,814,0001,998,0002,281,472
11Oct 4, 2022 15:5155,947295,012,110273,142,0001,000,0002,445,312
12Oct 4, 2022 15:5156,783300,698,742277,238,0001,000,0002,449,408