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 19, 2021 21:21Yuriy LyfenkoYuriy LyfenkoScore: 808,906Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 19, 2021 21:21740,4773,701,478,5633,628,337,19002,207,744
2May 19, 2021 21:21740,8853,692,745,0733,630,338,55802,211,840
3May 19, 2021 21:21741,5653,698,911,7903,633,670,94502,220,032
4May 19, 2021 21:21808,5654,023,771,1733,961,968,98302,220,032
5May 19, 2021 21:21808,9064,023,244,3473,963,641,61302,215,936
6May 19, 2021 21:21809,1494,028,299,0833,964,831,11202,224,128
7May 19, 2021 21:21809,2714,028,861,7803,965,430,13902,220,032
8May 19, 2021 21:21809,5824,035,485,1623,966,952,74602,215,936
9May 19, 2021 21:21809,9694,028,748,9343,968,846,88702,203,648