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 26, 2021 20:59Mikhail DektyarevMikhail DektyarevScore: 233,869Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 26, 2021 20:57233,6791,196,042,2351,145,026,91702,293,760
2May 26, 2021 20:57233,6811,201,339,4281,145,035,03502,297,856
3May 26, 2021 20:59233,6841,192,165,9711,145,050,40002,293,760
4May 26, 2021 20:59233,8691,210,252,6731,145,960,31402,297,856
5May 26, 2021 20:59234,2451,191,852,1081,147,800,75202,306,048
6May 26, 2021 20:57234,3421,191,599,6671,148,275,82802,293,760