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 listDec 26, 2024 02:26Joad NacerJoad NacerScore: 159,399Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 26, 2024 02:27159,007806,747,572779,132,00002,531,328
2Dec 26, 2024 02:27159,062801,610,984777,407,0001,998,0002,514,944
3Dec 26, 2024 02:27159,077800,861,880777,481,0001,998,0002,424,832
4Dec 26, 2024 02:27159,080806,942,232778,492,000999,0002,269,184
5Dec 26, 2024 02:27159,100804,717,280777,592,0001,998,0002,531,328
6Dec 26, 2024 02:26159,108804,940,520778,628,000999,0002,433,024
7Dec 26, 2024 02:27159,350804,710,612779,818,000999,0002,531,328
8Dec 26, 2024 02:26159,354804,934,142779,835,000999,0002,531,328
9Dec 26, 2024 02:26159,357803,807,689779,849,000999,0002,269,184
10Dec 26, 2024 02:27159,378803,360,154779,955,000999,0002,531,328
11Dec 26, 2024 02:26159,399808,959,042781,054,00002,531,328
12Dec 26, 2024 02:27159,443804,302,417779,271,0001,998,0002,269,184
13Dec 26, 2024 02:26159,446806,301,550781,283,00002,428,928
14Dec 26, 2024 02:27159,454811,612,741780,328,000999,0002,531,328
15Dec 26, 2024 02:26159,463806,558,644779,373,0001,998,0002,531,328
16Dec 26, 2024 02:26159,468805,724,305781,395,00002,531,328
17Dec 26, 2024 02:26159,482804,810,689780,461,000999,0002,531,328
18Dec 26, 2024 02:27159,491806,328,451780,506,000999,0002,531,328
19Dec 26, 2024 02:26159,640810,057,639782,235,00002,424,832
20Dec 26, 2024 02:27163,579828,512,045800,538,000999,0002,269,184
21Dec 26, 2024 02:27181,979911,738,682889,698,0001,999,0002,531,328