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:48Hal FHal FScore: 56,524Success
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:4854,553333,717,850267,309,84102,285,568
2Apr 27, 2024 16:4855,321338,236,871271,074,28002,285,568
3Apr 27, 2024 16:4856,429307,509,005274,500,0002,003,0002,289,664
4Apr 27, 2024 16:4856,453304,638,387274,622,0001,997,0002,289,664
5Apr 27, 2024 16:4856,461303,447,861274,663,0001,997,0002,289,664
6Apr 27, 2024 16:4856,476304,086,472274,735,0001,998,0002,289,664
7Apr 27, 2024 16:4856,524302,426,862273,968,0002,999,0002,289,664
8Apr 27, 2024 16:4856,609299,980,519275,382,0002,002,0002,289,664
9Apr 27, 2024 16:4856,812307,695,129276,375,0002,002,0002,289,664
10Apr 27, 2024 16:4857,515303,480,888278,827,0002,998,0002,289,664
11Apr 27, 2024 16:4857,600306,855,361279,237,0003,002,0002,269,184
12Apr 27, 2024 16:48170,490905,394,013835,402,12502,273,280