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 24, 2021 08:52alex3dalex3dScore: 460,573Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 24, 2021 08:52454,3422,287,679,8912,226,274,63802,277,376
2May 24, 2021 08:52454,4862,295,453,7342,226,981,18102,281,472
3May 24, 2021 08:52454,5412,293,162,9062,227,249,87202,265,088
4May 24, 2021 08:52460,5732,310,719,9862,256,808,74902,260,992
5May 24, 2021 08:52460,5822,316,337,1832,256,851,14802,277,376
6May 24, 2021 08:52460,6672,320,595,8522,257,267,17002,260,992