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 listNov 16, 2024 18:29Dan StolyarovDan StolyarovScore: 706,465Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 16, 2024 18:29705,3683,480,876,4283,342,360,000113,944,0002,510,848
2Nov 16, 2024 18:29705,8373,485,279,3883,349,677,000108,924,0002,281,472
3Nov 16, 2024 18:29705,9283,492,102,3353,342,115,000116,934,0002,281,472
4Nov 16, 2024 18:29705,9393,487,028,3733,342,165,000116,935,0002,281,472
5Nov 16, 2024 18:29706,4653,491,889,7153,346,756,000114,922,0002,285,568
6Nov 16, 2024 18:29706,4693,485,632,0923,340,777,000120,919,0002,285,568
7Nov 16, 2024 18:29706,4893,492,137,5683,344,870,000116,925,0002,453,504
8Nov 16, 2024 18:29706,5533,495,699,8483,346,175,000115,936,0002,469,888
9Nov 16, 2024 18:29706,6943,487,169,5353,344,874,000117,925,0002,301,952