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:55Mikhail ShirokovMikhail ShirokovScore: 4,625,856Success
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:554,490,27529,955,276,71022,002,346,78702,220,032
2May 19, 2021 21:554,503,29930,064,915,65922,066,164,63102,273,280
3May 19, 2021 21:554,623,06230,998,351,81222,653,005,53602,183,168
4May 19, 2021 21:554,625,48830,957,356,00222,664,889,71002,252,800
5May 19, 2021 21:554,625,85630,787,914,63322,666,695,82402,224,128
6May 19, 2021 21:554,641,75630,492,880,45022,744,604,86702,224,128
7May 19, 2021 21:554,652,17230,933,564,10622,795,644,05402,228,224
8May 19, 2021 21:554,687,01431,158,506,69122,966,366,43402,289,664
9May 19, 2021 21:555,969,90837,187,801,41629,252,548,59402,228,224