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 listJul 9, 2021 13:29Yuriy LyfenkoYuriy LyfenkoScore: 149,573Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 9, 2021 13:29149,376757,151,148728,941,0002,999,0002,334,720
2Jul 9, 2021 13:29149,439760,589,062727,252,0005,001,0002,334,720
3Jul 9, 2021 13:29149,467763,272,045728,392,0003,996,0002,478,080
4Jul 9, 2021 13:29149,488757,991,815729,491,0003,002,0002,334,720
5Jul 9, 2021 13:29149,539762,193,274731,740,000999,0002,334,720
6Jul 9, 2021 13:29149,565761,918,953728,869,0003,999,0002,334,720
7Jul 9, 2021 13:29149,573757,743,671727,908,0004,999,0002,473,984
8Jul 9, 2021 13:29149,579757,940,615729,936,0002,999,0002,473,984
9Jul 9, 2021 13:29149,625756,227,681731,162,0002,000,0002,535,424
10Jul 9, 2021 13:29149,631793,198,265733,192,81602,285,568
11Jul 9, 2021 13:29149,700790,689,394733,529,47302,289,664
12Jul 9, 2021 13:29149,798792,399,230734,009,21902,289,664