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 25, 2024 22:15Hal FHal FScore: 56,064Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 25, 2024 22:1555,522295,167,042269,059,0003,000,0002,285,568
2Apr 25, 2024 22:1555,572295,597,786269,300,0003,003,0002,285,568
3Apr 25, 2024 22:1555,797301,096,944270,411,0002,993,0002,285,568
4Apr 25, 2024 22:1555,842296,704,096270,633,0002,995,0002,269,184
5Apr 25, 2024 22:1555,909299,941,067271,957,0001,999,0002,285,568
6Apr 25, 2024 22:1556,059302,533,477271,694,0002,996,0002,285,568
7Apr 25, 2024 22:1556,064303,677,929272,718,0001,997,0002,523,136
8Apr 25, 2024 22:1556,261300,986,911272,681,0002,996,0002,527,232
9Apr 25, 2024 22:1556,269305,228,579273,721,0001,997,0002,285,568
10Apr 25, 2024 22:1557,105358,302,357279,814,46202,265,088
11Apr 25, 2024 22:1557,703362,109,515282,742,81802,281,472
12Apr 25, 2024 22:1557,857355,863,946283,499,45102,273,280