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 listApr 27, 2024 16:44Hal FHal FScore: 59,203Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 27, 2024 16:4458,737309,809,151285,811,0001,998,0002,289,664
2Apr 27, 2024 16:4458,743317,642,687284,841,0002,998,0002,289,664
3Apr 27, 2024 16:4458,749313,557,892284,870,0002,998,0002,289,664
4Apr 27, 2024 16:4458,791310,779,177285,077,0003,000,0002,289,664
5Apr 27, 2024 16:4458,949315,306,643285,854,0002,998,0002,523,136
6Apr 27, 2024 16:4458,970315,456,259285,954,0002,999,0002,289,664
7Apr 27, 2024 16:4459,203313,337,275287,095,0003,001,0002,265,088
8Apr 27, 2024 16:4459,223357,828,055290,192,47602,285,568
9Apr 27, 2024 16:4459,224314,938,978288,195,0002,001,0002,289,664
10Apr 27, 2024 16:4459,381361,059,493290,968,39902,277,376
11Apr 27, 2024 16:4459,392315,321,780288,020,0003,000,0002,523,136
12Apr 27, 2024 16:4462,197368,059,960304,764,10202,273,280