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 18:04Robert BurkeRobert BurkeScore: 55,410Success
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 18:0452,915317,745,527259,281,71202,183,168
2Oct 4, 2022 18:0452,952326,137,293259,466,30602,187,264
3Oct 4, 2022 18:0453,041327,980,193259,900,10802,187,264
4Oct 4, 2022 18:0455,363297,272,748270,276,0001,001,0002,437,120
5Oct 4, 2022 18:0455,390293,053,472270,412,0001,001,0002,281,472
6Oct 4, 2022 18:0455,392297,332,725270,421,0001,001,0002,449,408
7Oct 4, 2022 18:0455,410292,841,969270,506,0001,001,0002,531,328
8Oct 4, 2022 18:0455,821295,604,304271,529,0001,996,0002,281,472
9Oct 4, 2022 18:0455,924298,675,823273,027,0001,000,0002,281,472
10Oct 4, 2022 18:0455,924295,393,223272,028,0002,000,0002,281,472
11Oct 4, 2022 18:0455,931293,459,390272,061,0002,000,0002,281,472
12Oct 4, 2022 18:0455,968297,700,212272,251,0001,994,0002,281,472