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 listOct 4, 2022 15:03Robert BurkeRobert BurkeScore: 60,106Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 4, 2022 15:0359,542314,166,375289,758,0001,998,0002,281,472
2Oct 4, 2022 15:0359,564318,894,681289,866,0001,999,0002,281,472
3Oct 4, 2022 15:0359,609317,290,349290,086,0002,000,0002,445,312
4Oct 4, 2022 15:0359,662320,884,264291,344,0001,001,0002,445,312
5Oct 4, 2022 15:0359,671319,130,924291,386,0001,001,0002,453,504
6Oct 4, 2022 15:0359,681321,159,396291,436,0001,001,0002,281,472
7Oct 4, 2022 15:0360,106316,830,009292,525,0001,996,0002,281,472
8Oct 4, 2022 15:0363,409380,302,314310,703,53902,187,264
9Oct 4, 2022 15:0364,418388,667,941315,648,18602,183,168
10Oct 4, 2022 15:0364,451384,644,283315,808,81602,179,072
11Oct 4, 2022 15:0375,481390,509,267367,856,0001,999,0002,437,120
12Oct 4, 2022 15:03143,603726,622,282701,658,0001,999,0002,281,472