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 listSep 3, 2022 23:31Eugene ZhydzetskiEugene ZhydzetskiScore: 355,662Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 3, 2022 23:28355,5861,799,440,1121,742,371,09802,215,936
2Sep 3, 2022 23:31355,6081,801,808,1311,742,478,63302,199,552
3Sep 3, 2022 23:28355,6481,802,083,8051,742,673,59002,211,840
4Sep 3, 2022 23:31355,6621,819,548,6891,742,743,11202,207,744
5Sep 3, 2022 23:31355,6671,805,018,9281,742,767,80802,211,840
6Sep 3, 2022 23:28355,6831,808,520,1581,742,846,84002,215,936