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 5, 2021 17:26Dmitry KashtanovDmitry KashtanovScore: 2,722,161Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 5, 2021 17:262,631,83212,966,141,72712,895,978,45502,183,168
2May 5, 2021 17:262,634,09512,972,832,54612,907,065,83502,310,144
3May 5, 2021 17:262,700,32813,329,895,80713,231,608,08302,314,240
4May 5, 2021 17:262,722,16113,404,824,69113,338,588,68002,183,168
5May 5, 2021 17:262,735,24613,468,261,37613,402,703,87702,306,048
6May 5, 2021 17:262,833,08613,941,762,07413,882,122,26902,191,360