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 23:12Yuriy LyfenkoYuriy LyfenkoScore: 278,195Success
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 23:12231,5991,195,977,0881,134,834,45602,244,608
2May 19, 2021 23:12232,1921,189,981,9071,137,739,01702,236,416
3May 19, 2021 23:12234,1421,213,227,8621,147,296,13702,224,128
4May 19, 2021 23:12277,1931,414,360,8261,358,243,45202,236,416
5May 19, 2021 23:12278,1951,446,135,0501,363,154,02202,248,704
6May 19, 2021 23:12278,3951,427,433,1411,364,136,72302,244,608
7May 19, 2021 23:12278,7981,423,727,0651,366,112,20502,240,512
8May 19, 2021 23:12279,9431,435,851,2041,371,721,66902,236,416
9May 19, 2021 23:12280,9971,439,724,1031,376,885,58602,236,416