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 23, 2022 09:07Robert BurkeRobert BurkeScore: 64,874Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 23, 2022 09:0762,308361,972,632305,310,96102,179,072
2Jul 23, 2022 09:0762,334367,658,853305,434,63802,297,856
3Jul 23, 2022 09:0762,350368,475,329305,514,76902,179,072
4Jul 23, 2022 09:0764,740342,512,175316,226,0001,000,0002,281,472
5Jul 23, 2022 09:0764,872347,417,833316,874,000999,0002,281,472
6Jul 23, 2022 09:0764,873337,139,040315,879,0001,999,0002,281,472
7Jul 23, 2022 09:0764,874337,224,131315,883,0001,999,0002,441,216
8Jul 23, 2022 09:0764,908339,772,611317,049,0001,000,0002,445,312
9Jul 23, 2022 09:0764,960343,572,472317,305,0001,000,0002,281,472
10Jul 23, 2022 09:0764,982347,099,059317,411,0001,001,0002,453,504
11Jul 23, 2022 09:0764,983348,587,189317,415,0001,001,0002,281,472
12Jul 23, 2022 09:0765,031342,839,066316,653,0001,997,0002,445,312