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 20, 2021 03:22Yuriy LyfenkoYuriy LyfenkoScore: 397,700Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 20, 2021 03:22325,6651,656,246,0771,595,756,52302,191,360
2May 20, 2021 03:22327,0671,681,155,6851,602,629,65802,187,264
3May 20, 2021 03:22328,1011,685,037,3561,607,696,18002,187,264
4May 20, 2021 03:22397,6102,029,145,5411,948,286,87302,195,456
5May 20, 2021 03:22397,7002,008,858,7161,948,728,81702,191,360
6May 20, 2021 03:22399,0402,017,622,7471,955,296,34102,191,360
7May 20, 2021 03:22400,3402,026,840,9381,961,668,43602,187,264
8May 20, 2021 03:22400,6812,022,714,7131,963,337,99402,183,168
9May 20, 2021 03:22401,0802,020,074,8091,965,290,66802,203,648