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 listNov 1, 2022 23:28Bernard TeoBernard TeoScore: 54,349Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 1, 2022 23:2754,290290,714,427264,019,0002,000,0002,392,064
2Nov 1, 2022 23:2854,297286,713,369264,057,0002,000,0002,514,944
3Nov 1, 2022 23:2854,301289,105,665264,077,0002,000,0002,281,472
4Nov 1, 2022 23:2754,309293,063,603265,116,0001,000,0002,273,280
5Nov 1, 2022 23:2854,323290,188,845266,184,00002,396,160
6Nov 1, 2022 23:2754,328291,605,106265,209,0001,000,0002,281,472
7Nov 1, 2022 23:2754,328290,195,328265,206,0001,000,0002,404,352
8Nov 1, 2022 23:2854,334292,591,906265,236,0001,000,0002,281,472
9Nov 1, 2022 23:2754,338290,770,768265,257,0001,000,0002,404,352
10Nov 1, 2022 23:2754,339293,485,035265,266,000997,0002,400,256
11Nov 1, 2022 23:2854,347291,621,898266,300,00002,281,472
12Nov 1, 2022 23:2854,349293,626,320265,307,0001,001,0002,281,472
13Nov 1, 2022 23:2754,349291,142,815265,307,0001,001,0002,281,472
14Nov 1, 2022 23:2854,352290,678,866266,324,00002,400,256
15Nov 1, 2022 23:2854,352299,854,988265,330,000997,0002,281,472
16Nov 1, 2022 23:2754,361289,577,722265,370,000997,0002,404,352
17Nov 1, 2022 23:2754,377291,688,483265,450,000997,0002,281,472
18Nov 1, 2022 23:2854,391294,113,956265,518,000998,0002,392,064
19Nov 1, 2022 23:2854,751344,345,839268,278,03602,273,280
20Nov 1, 2022 23:2754,778336,639,645268,413,89202,260,992
21Nov 1, 2022 23:2754,779331,008,541268,418,50402,265,088
22Nov 1, 2022 23:2854,792333,037,215268,482,57802,256,896
23Nov 1, 2022 23:2754,812332,594,621268,577,08602,265,088
24Nov 1, 2022 23:2856,663336,454,997277,650,55202,265,088