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 listJul 21, 2022 06:04Robert BurkeRobert BurkeScore: 82,207Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 21, 2022 06:0478,546444,123,927384,877,63502,285,568
2Jul 21, 2022 06:0478,547439,735,496384,880,79602,289,664
3Jul 21, 2022 06:0478,547449,131,040384,882,18202,289,664
4Jul 21, 2022 06:0482,171424,006,601400,638,0001,998,0002,519,040
5Jul 21, 2022 06:0482,176430,517,483401,663,000999,0002,281,472
6Jul 21, 2022 06:0482,201429,650,844401,785,000999,0002,424,832
7Jul 21, 2022 06:0482,207426,272,378401,816,000999,0002,433,024
8Jul 21, 2022 06:0482,208424,929,001401,818,000999,0002,281,472
9Jul 21, 2022 06:0482,213427,515,554401,844,000999,0002,281,472
10Jul 21, 2022 06:0482,216421,854,746401,859,000999,0002,441,216
11Jul 21, 2022 06:0482,292420,308,123403,231,00002,514,944
12Jul 21, 2022 06:0482,315428,489,173403,342,00002,281,472