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 listDec 29, 2024 03:25Joad NacerJoad NacerScore: 127,515Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 29, 2024 03:25127,460652,999,968624,556,00002,424,832
2Dec 29, 2024 03:25127,461648,316,027623,560,000999,0002,433,024
3Dec 29, 2024 03:25127,478642,952,196622,644,0001,998,0002,269,184
4Dec 29, 2024 03:25127,496651,958,527623,729,000999,0002,424,832
5Dec 29, 2024 03:25127,515649,433,642623,825,000999,0002,428,928
6Dec 29, 2024 03:25127,520658,674,396623,850,000999,0002,420,736
7Dec 29, 2024 03:25127,552649,074,566624,003,0001,000,0002,506,752
8Dec 29, 2024 03:25127,585648,742,304624,168,0001,000,0002,269,184
9Dec 29, 2024 03:25135,707691,525,439663,963,000999,0002,269,184