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 8, 2021 20:12Dmitry DolgopolovDmitry DolgopolovScore: 186,614Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 8, 2021 20:08183,802971,604,679900,631,83402,174,976
2Jun 8, 2021 20:12183,965955,498,816901,426,81802,183,168
3Jun 8, 2021 20:12184,134954,694,250902,256,25802,301,952
4Jun 8, 2021 20:12184,539965,290,362904,243,46802,174,976
5Jun 8, 2021 20:08186,614971,606,933914,409,41102,174,976
6Jun 8, 2021 20:12188,442986,754,723923,364,21902,183,168
7Jun 8, 2021 20:12188,534988,577,698923,814,29202,174,976
8Jun 8, 2021 20:08188,666988,394,365924,463,72102,174,976
9Jun 8, 2021 20:12193,2111,015,888,775946,735,17102,174,976