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 22:13Yuriy LyfenkoYuriy LyfenkoScore: 587,036Success
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 22:13553,8252,781,345,7242,713,744,53102,265,088
2May 19, 2021 22:13553,8742,766,721,4642,713,982,96402,252,800
3May 19, 2021 22:13553,9322,768,704,3512,714,268,58502,252,800
4May 19, 2021 22:13587,0332,941,747,7182,876,460,39502,252,800
5May 19, 2021 22:13587,0362,937,377,2912,876,477,24902,248,704
6May 19, 2021 22:13587,0562,939,475,0452,876,572,92202,252,800
7May 19, 2021 22:13587,0632,940,302,1072,876,610,96702,265,088
8May 19, 2021 22:13587,1002,942,750,7882,876,788,56502,256,896
9May 19, 2021 22:13587,1532,944,804,0672,877,050,72002,248,704