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 listJun 11, 2021 16:14Dmitry DolgopolovDmitry DolgopolovScore: 175,647Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 11, 2021 16:04175,323929,423,094859,084,48702,183,168
2Jun 11, 2021 16:05175,412928,074,124859,518,10702,183,168
3Jun 11, 2021 16:05175,432918,790,602859,619,06902,179,072
4Jun 11, 2021 16:14175,446919,362,394859,686,01902,179,072
5Jun 11, 2021 16:04175,647937,434,934860,670,21402,174,976
6Jun 11, 2021 16:14175,866929,139,588861,742,38002,183,168
7Jun 11, 2021 16:14178,067931,284,462872,526,17702,297,856
8Jun 11, 2021 16:05178,257933,190,414873,460,55302,187,264
9Jun 11, 2021 16:04179,307947,662,879878,605,01802,174,976