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 10:43Hal FHal FScore: 57,308Success
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 10:4357,020306,975,704278,396,0001,001,0002,281,472
2Apr 27, 2024 10:4357,113302,611,840276,857,0002,998,0002,285,568
3Apr 27, 2024 10:4357,186307,049,025277,207,0003,002,0002,289,664
4Apr 27, 2024 10:4357,186302,439,934278,209,0002,001,0002,289,664
5Apr 27, 2024 10:4357,275310,986,297278,652,0001,997,0002,289,664
6Apr 27, 2024 10:4357,300304,587,059278,772,0001,998,0002,289,664
7Apr 27, 2024 10:4357,308302,778,567277,811,0002,997,0002,265,088
8Apr 27, 2024 10:4357,404339,747,076281,280,82202,281,472
9Apr 27, 2024 10:4357,404303,788,461279,277,0002,001,0002,523,136
10Apr 27, 2024 10:4357,411341,416,722281,313,34402,281,472
11Apr 27, 2024 10:4357,461335,762,880281,560,42602,269,184
12Apr 27, 2024 10:4394,047498,417,807458,833,0001,999,0002,523,136