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 4, 2021 18:12Ivan PodogovIvan PodogovScore: 2,473,880Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 4, 2021 18:122,380,13011,726,062,57911,662,637,62802,265,088
2May 4, 2021 18:122,390,57111,775,173,40211,713,796,48802,265,088
3May 4, 2021 18:122,415,69611,901,199,93211,836,909,41302,252,800
4May 4, 2021 18:122,473,88012,179,083,07812,122,009,73402,248,704
5May 4, 2021 18:122,476,76712,189,196,98512,136,158,65802,260,992
6May 4, 2021 18:122,578,77912,698,070,17512,636,019,06902,256,896