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:27Yuriy LyfenkoYuriy LyfenkoScore: 809,428Success
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:27739,7593,684,610,4903,624,820,47102,211,840
2May 19, 2021 21:27740,6773,690,284,1223,629,316,78902,220,032
3May 19, 2021 21:27741,4253,701,568,0013,632,984,56402,215,936
4May 19, 2021 21:27808,4004,017,808,8333,961,159,18402,215,936
5May 19, 2021 21:27809,4284,018,306,2183,966,195,37502,224,128
6May 19, 2021 21:27809,5334,027,124,3273,966,712,21002,220,032
7May 19, 2021 21:27809,8824,035,069,9363,968,421,74402,211,840
8May 19, 2021 21:27809,9404,033,389,5733,968,703,59402,207,744
9May 19, 2021 21:27810,1144,022,330,4713,969,558,65002,215,936