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 18:48Hal FHal FScore: 62,394Success
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 18:4862,114376,423,813304,357,62402,281,472
2Apr 27, 2024 18:4862,140375,072,473304,487,99402,285,568
3Apr 27, 2024 18:4862,216367,405,117304,857,67002,273,280
4Apr 27, 2024 18:4862,327339,320,574303,402,0002,002,0002,273,280
5Apr 27, 2024 18:4862,379327,394,089302,662,0002,996,0002,367,488
6Apr 27, 2024 18:4862,382333,258,881303,674,0001,997,0002,527,232
7Apr 27, 2024 18:4862,394331,814,750302,736,0002,997,0002,269,184
8Apr 27, 2024 18:4862,403327,546,483302,776,0002,997,0002,273,280
9Apr 27, 2024 18:4862,545334,395,392304,468,0002,003,0002,289,664
10Apr 27, 2024 18:4862,686333,720,657304,159,0003,001,0002,289,664
11Apr 27, 2024 18:4863,054334,057,180306,964,0001,999,0002,289,664
12Apr 27, 2024 18:4863,145334,976,630307,407,0002,002,0002,269,184