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 listMay 16, 2021 07:15Dmitry DolgopolovDmitry DolgopolovScore: 6,291,561Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 16, 2021 07:156,165,00530,289,909,34330,208,525,47402,260,992
2May 16, 2021 07:156,166,66830,282,006,36730,216,673,08602,244,608
3May 16, 2021 07:156,169,72930,289,623,24630,231,671,87802,260,992
4May 16, 2021 07:156,291,56130,892,380,04830,828,649,36402,260,992
5May 16, 2021 07:156,292,64230,912,484,86730,833,943,84802,244,608
6May 16, 2021 07:156,294,41030,905,827,69730,842,609,92002,252,800