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:14Mikhail ShirokovMikhail ShirokovScore: 1,706,794Success
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:141,638,23916,024,560,9688,027,369,42602,256,896
2May 19, 2021 23:141,640,10217,103,792,8618,036,498,87102,244,608
3May 19, 2021 23:141,652,37516,203,783,7868,096,639,54402,215,936
4May 19, 2021 23:141,706,33716,473,589,9408,361,051,48502,207,744
5May 19, 2021 23:141,706,79416,327,616,1698,363,289,54502,211,840
6May 19, 2021 23:141,707,45516,398,926,6088,366,529,79502,285,568
7May 19, 2021 23:141,712,47316,904,554,1498,391,118,91502,174,976
8May 19, 2021 23:141,720,23916,357,278,2838,429,171,89702,215,936
9May 19, 2021 23:141,720,24816,492,969,0428,429,216,05302,183,168