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 20:02Hal FHal FScore: 56,827Success
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 20:0255,808345,404,331273,458,65902,273,280
2May 2, 2024 20:0255,843346,644,780273,629,23402,277,376
3May 2, 2024 20:0256,147360,121,427275,121,28202,281,472
4May 2, 2024 20:0256,698302,665,904275,821,0001,998,0002,519,040
5May 2, 2024 20:0256,797299,948,522277,306,0001,001,0002,281,472
6May 2, 2024 20:0256,804302,402,974276,337,0002,002,0002,281,472
7May 2, 2024 20:0256,827313,153,025276,450,0002,003,0002,281,472
8May 2, 2024 20:0256,880302,181,062275,717,0002,996,0002,289,664
9May 2, 2024 20:0256,888307,105,116275,756,0002,997,0002,289,664
10May 2, 2024 20:0257,031309,114,919277,450,0002,003,0002,289,664
11May 2, 2024 20:0257,243307,371,097278,486,0002,003,0002,289,664
12May 2, 2024 20:0295,449499,218,835464,703,0002,998,0002,281,472