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 20:08Hal FHal FScore: 81,983Success
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 20:0881,775425,225,139398,701,0001,998,0002,281,472
2Apr 25, 2024 20:0881,827422,984,327398,954,0001,999,0002,285,568
3Apr 25, 2024 20:0881,881424,971,700398,218,0003,001,0002,285,568
4Apr 25, 2024 20:0881,890435,081,376400,263,0001,000,0002,285,568
5Apr 25, 2024 20:0881,893425,334,500398,280,0002,994,0002,285,568
6Apr 25, 2024 20:0881,899423,613,854398,301,0003,002,0002,285,568
7Apr 25, 2024 20:0881,983426,923,628399,719,0001,998,0002,273,280
8Apr 25, 2024 20:0882,028425,849,029400,936,000999,0002,281,472
9Apr 25, 2024 20:0882,095433,664,473399,273,0002,994,0002,285,568
10Apr 25, 2024 20:0883,132487,137,642407,349,13702,281,472
11Apr 25, 2024 20:0883,166476,394,935407,512,87602,265,088
12Apr 25, 2024 20:0883,600469,980,289409,642,23102,277,376