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 listAug 31, 2024 16:32TuetuopayTuetuopayScore: 562,941Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Aug 23, 2024 17:38554,2132,785,826,5952,715,644,81902,232,320
2Aug 23, 2024 17:38554,3892,786,248,8222,716,507,92002,228,224
3Aug 23, 2024 17:38556,0352,790,672,6332,724,571,58002,228,224
4Aug 31, 2024 16:32562,9412,789,493,9992,757,410,000999,0002,281,472
5Aug 31, 2024 16:32564,7332,804,552,9332,765,194,0001,998,0002,375,680
6Aug 31, 2024 16:32564,9192,791,043,3592,767,104,000999,0002,375,680