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 13:02Hal FHal FScore: 57,685Success
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 13:0256,445331,919,193276,582,40402,281,472
2Apr 27, 2024 13:0256,615345,837,055277,411,25602,273,280
3Apr 27, 2024 13:0257,592304,605,102280,200,0002,001,0002,289,664
4Apr 27, 2024 13:0257,624309,217,790280,355,0002,002,0002,519,040
5Apr 27, 2024 13:0257,648311,059,976282,473,00002,289,664
6Apr 27, 2024 13:0257,659309,272,274280,524,0002,003,0002,289,664
7Apr 27, 2024 13:0257,685312,506,460280,661,0001,997,0002,531,328
8Apr 27, 2024 13:0258,272317,359,207285,532,00002,289,664
9Apr 27, 2024 13:0258,294311,606,099282,647,0002,996,0002,269,184
10Apr 27, 2024 13:0258,876313,285,699285,497,0002,994,0002,523,136
11Apr 27, 2024 13:0260,905370,936,917298,435,57702,265,088
12Apr 27, 2024 13:0263,059331,429,869305,990,0002,999,0002,289,664