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 23, 2021 20:54alex3dalex3dScore: 3,865,783Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 23, 2021 20:543,750,61718,436,836,95718,378,021,64702,273,280
2May 23, 2021 20:543,752,68418,443,780,51318,388,152,59802,265,088
3May 23, 2021 20:543,762,84718,510,608,82418,437,949,93902,269,184
4May 23, 2021 20:543,865,78319,026,948,30918,942,335,88602,277,376
5May 23, 2021 20:543,868,34219,015,628,18818,954,874,62402,269,184
6May 23, 2021 20:543,880,72919,086,737,03619,015,570,71902,265,088