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:20Mikhail ShirokovMikhail ShirokovScore: 1,464,566Success
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:201,407,04815,192,347,4606,894,537,13402,330,624
2May 19, 2021 23:201,407,30415,089,037,6176,895,787,27302,211,840
3May 19, 2021 23:201,421,11615,304,966,7446,963,466,88702,195,456
4May 19, 2021 23:201,462,91615,721,699,6857,168,287,33602,215,936
5May 19, 2021 23:201,464,56615,524,100,4457,176,372,87402,310,144
6May 19, 2021 23:201,465,64415,553,449,8387,181,657,40502,215,936
7May 19, 2021 23:201,476,54615,117,715,5747,235,075,41002,269,184
8May 19, 2021 23:201,476,72415,618,159,9747,235,946,81102,215,936
9May 19, 2021 23:201,570,50916,288,038,8357,695,493,33202,183,168