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 listApr 27, 2024 11:37Hal FHal FScore: 59,012Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 27, 2024 11:3757,220353,339,218280,379,18302,281,472
2Apr 27, 2024 11:3757,279337,728,386280,669,00702,273,280
3Apr 27, 2024 11:3757,319335,121,175280,862,46102,273,280
4Apr 27, 2024 11:3758,787314,868,432286,057,0002,000,0002,273,280
5Apr 27, 2024 11:3758,907315,014,440285,649,0002,996,0002,289,664
6Apr 27, 2024 11:3758,960313,058,436286,905,0001,999,0002,289,664
7Apr 27, 2024 11:3759,012315,484,552286,157,0003,001,0002,273,280
8Apr 27, 2024 11:3759,025315,671,501286,222,0003,002,0002,289,664
9Apr 27, 2024 11:3759,275322,058,902288,443,0002,003,0002,289,664
10Apr 27, 2024 11:3759,335315,101,515288,744,0001,998,0002,289,664
11Apr 27, 2024 11:3759,649320,172,709290,280,0002,001,0002,289,664
12Apr 27, 2024 11:3759,842317,514,862291,226,0002,001,0002,289,664