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 listDec 26, 2023 10:39matsuoka-601matsuoka-601Error
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 26, 2023 10:3900000Error: expected "560379772477 ", got "-7269677864447596965 19985019714011360 -8475195890471617985 0 0 0 302 136 121 "
2Dec 26, 2023 10:4000000Error: expected "560365680447 ", got "-4606414445946196814 17451555932012559 4160587661470121851 0 0 0 297 159 180 "
3Dec 26, 2023 10:4900000Error: expected "560381443214 ", got "-2957025283861571614 65865402261111013 7169253772496013799 0 0 0 289 134 112 "
4Dec 26, 2023 10:5000000Error: expected "560377793210 ", got "7165464501556199105 65021539971760135 5161990643811078632 0 0 0 291 126 158 "
5Dec 26, 2023 10:5600000Error: expected "560373784121 ", got "6373350062932273247 17452234541563971 7732531917122639865 0 0 0 289 199 99 "
6Dec 26, 2023 11:1100000Error: expected "560379515594 ", got "-6056284925039771516 65020865653309516 -7689316066382665852 0 0 0 289 172 223 "