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:48Robert BurkeRobert BurkeScore: 61,617Success
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:4859,021351,277,782289,202,25402,183,168
2Oct 4, 2022 11:4859,074350,660,315289,461,50402,183,168
3Oct 4, 2022 11:4859,306357,015,751290,597,86502,183,168
4Oct 4, 2022 11:4861,578326,735,994299,732,0001,998,0002,281,472
5Oct 4, 2022 11:4861,617327,048,980299,922,0001,999,0002,441,216
6Oct 4, 2022 11:4861,617326,996,165299,925,0001,999,0002,449,408
7Oct 4, 2022 11:4861,617325,339,938299,925,0001,999,0002,273,280
8Oct 4, 2022 11:4861,619325,076,538299,932,0001,999,0002,445,312
9Oct 4, 2022 11:4861,620325,727,686299,938,0001,999,0002,441,216
10Oct 4, 2022 11:4861,794323,753,821300,793,0001,998,0002,281,472
11Oct 4, 2022 11:4862,070325,056,763303,142,0001,000,0002,281,472
12Oct 4, 2022 11:4862,998336,450,910307,693,000999,0002,281,472