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 listMay 2, 2024 19:28Hal FHal FScore: 54,790Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 2, 2024 19:2851,999317,916,031254,794,99102,281,472
2May 2, 2024 19:2852,061317,429,985255,098,90702,273,280
3May 2, 2024 19:2852,237330,889,396255,962,29202,277,376
4May 2, 2024 19:2854,699293,900,012266,026,0002,000,0002,289,664
5May 2, 2024 19:2854,729292,574,119265,173,0003,001,0002,289,664
6May 2, 2024 19:2854,770299,159,942267,371,0001,001,0002,289,664
7May 2, 2024 19:2854,790299,614,392266,467,0002,003,0002,289,664
8May 2, 2024 19:2855,240302,511,608268,680,0001,997,0002,289,664
9May 2, 2024 19:2855,351295,572,606271,221,00002,265,088
10May 2, 2024 19:2855,393300,463,567269,421,0002,003,0002,289,664
11May 2, 2024 19:2856,911308,027,565276,867,0001,999,0002,289,664
12May 2, 2024 19:2858,347309,617,391283,903,0001,999,0002,289,664