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 11:51Robert BurkeRobert BurkeScore: 61,669Success
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 11:5159,047349,508,767289,330,82802,269,184
2Oct 4, 2022 11:5159,184361,410,318290,002,10702,269,184
3Oct 4, 2022 11:5159,267343,357,695290,406,38502,265,088
4Oct 4, 2022 11:5161,625328,807,921300,962,000999,0002,285,568
5Oct 4, 2022 11:5161,651327,484,051302,088,00002,285,568
6Oct 4, 2022 11:5161,658334,481,536301,124,0001,000,0002,400,256
7Oct 4, 2022 11:5161,669329,612,592301,177,0001,000,0002,285,568
8Oct 4, 2022 11:5161,671330,500,193302,187,00002,285,568
9Oct 4, 2022 11:5161,709332,120,720302,372,00002,404,352
10Oct 4, 2022 11:5162,114329,680,548304,361,00002,285,568
11Oct 4, 2022 11:5162,760333,527,269306,521,0001,001,0002,404,352
12Oct 4, 2022 11:5163,088333,129,099309,133,00002,285,568