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:47Mikhail ShirokovMikhail ShirokovScore: 6,292,779Success
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:476,164,79430,265,206,75930,207,491,94302,252,800
2May 19, 2021 21:476,166,11930,267,941,14130,213,983,88502,252,800
3May 19, 2021 21:476,287,98330,911,512,17430,811,116,92002,256,896
4May 19, 2021 21:476,292,23730,912,580,91730,831,961,69602,260,992
5May 19, 2021 21:476,292,77930,892,191,54130,834,618,03402,248,704
6May 19, 2021 21:476,293,99230,900,151,60130,840,558,60402,252,800
7May 19, 2021 21:476,294,47830,916,796,57330,842,943,91302,248,704
8May 19, 2021 21:476,297,29930,915,661,62430,856,766,75602,256,896
9May 19, 2021 21:476,596,77632,379,547,76232,324,204,66502,252,800