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 listJan 7, 2024 05:56matsuoka-601matsuoka-601Score: 75,243Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 7, 2024 05:5670,875409,826,796347,287,36102,269,184
2Jan 7, 2024 05:5670,931416,985,528347,562,08902,277,376
3Jan 7, 2024 05:5671,075414,069,252348,265,46302,285,568
4Jan 7, 2024 05:5675,203395,015,256366,494,0002,002,0002,285,568
5Jan 7, 2024 05:5675,222397,285,676365,592,0002,996,0002,285,568
6Jan 7, 2024 05:5675,237397,087,392366,662,0001,998,0002,527,232
7Jan 7, 2024 05:5675,243392,789,230365,692,0002,997,0002,285,568
8Jan 7, 2024 05:5675,247392,242,044366,711,0001,998,0002,375,680
9Jan 7, 2024 05:5675,255398,507,052365,751,0002,997,0002,527,232
10Jan 7, 2024 05:5675,262396,742,395365,786,0002,998,0002,285,568
11Jan 7, 2024 05:5675,262398,823,596366,787,0001,998,0002,285,568
12Jan 7, 2024 05:5677,547404,590,287376,983,0002,999,0002,527,232