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 14, 2021 18:05Andrey TsvetkovAndrey TsvetkovScore: 613,264Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 14, 2021 18:05613,2443,064,909,5663,004,893,18202,199,552
2Jun 16, 2021 21:48613,2513,067,292,4513,004,928,82602,199,552
3Jun 16, 2021 21:48613,2613,078,872,9243,004,977,76602,195,456
4Jun 16, 2021 21:48613,2643,068,437,3873,004,995,56502,191,360
5Jun 14, 2021 18:05613,2673,071,110,9243,005,008,33202,195,456
6Jun 14, 2021 18:05613,2933,063,869,1033,005,136,08302,195,456