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 21:15alex3dalex3dScore: 3,798,728Success
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 21:153,666,04618,029,859,80917,963,623,05902,269,184
2May 23, 2021 21:153,669,72118,044,673,24717,981,630,88602,269,184
3May 23, 2021 21:153,677,11118,070,936,51818,017,843,67702,269,184
4May 23, 2021 21:153,798,72818,679,906,11018,613,768,84002,273,280
5May 23, 2021 21:153,802,95118,691,470,21618,634,458,36102,269,184
6May 23, 2021 21:153,815,42218,764,373,52518,695,566,77402,273,280