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 3, 2021 21:02Dmitry DolgopolovDmitry DolgopolovScore: 473,652Success
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 3, 2021 21:02438,5002,218,344,3292,148,649,17002,256,896
2May 3, 2021 21:02438,5152,212,486,4702,148,724,84302,256,896
3May 3, 2021 21:02438,5582,218,367,8872,148,931,97902,248,704
4May 3, 2021 21:02473,6522,390,270,7022,320,896,91402,265,088
5May 3, 2021 21:02473,7272,383,515,8272,321,264,12302,252,800
6May 3, 2021 21:02473,7362,375,003,0552,321,307,84402,265,088