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 24, 2021 07:27a-poptsova-poptsovScore: 2,639,370Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 24, 2021 07:272,525,88012,428,107,52912,376,812,21102,228,224
2May 24, 2021 07:272,526,82312,435,963,08712,381,432,98602,224,128
3May 24, 2021 07:272,528,38912,445,173,29612,389,105,19602,232,320
4May 24, 2021 07:272,639,37012,995,767,51912,932,914,90802,224,128
5May 24, 2021 07:272,646,13413,019,712,46612,966,057,81502,236,416
6May 24, 2021 07:272,646,57413,027,594,22512,968,213,61802,224,128