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 22:03Hal FHal FScore: 54,313Success
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 22:0353,522341,350,282262,255,35202,273,280
2Apr 27, 2024 22:0353,827341,202,671263,750,35902,273,280
3Apr 27, 2024 22:0353,881327,070,819264,015,24902,285,568
4Apr 27, 2024 22:0354,268291,408,484262,915,0002,999,0002,289,664
5Apr 27, 2024 22:0354,275297,205,770262,948,0002,999,0002,289,664
6Apr 27, 2024 22:0354,299290,693,063263,065,0003,000,0002,289,664
7Apr 27, 2024 22:0354,313290,023,337263,132,0003,001,0002,383,872
8Apr 27, 2024 22:0354,329295,371,051264,211,0002,001,0002,289,664
9Apr 27, 2024 22:0354,499291,194,891264,044,0003,000,0002,289,664
10Apr 27, 2024 22:0354,749294,659,234266,270,0002,002,0002,289,664
11Apr 27, 2024 22:0355,054296,447,980266,768,0002,997,0002,289,664
12Apr 27, 2024 22:0362,840333,005,088305,916,0001,999,0002,289,664