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 listDec 9, 2021 17:30Yuriy LyfenkoYuriy LyfenkoScore: 124,754Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 9, 2021 17:30123,846673,762,958606,846,92102,220,032
2Dec 9, 2021 17:30123,972684,635,098607,464,55602,211,840
3Dec 9, 2021 17:30124,685634,812,556609,957,000999,0002,527,232
4Dec 9, 2021 17:30124,704635,980,736610,052,0001,000,0002,265,088
5Dec 9, 2021 17:30124,710637,662,889610,078,0001,000,0002,359,296
6Dec 9, 2021 17:30124,717637,279,269611,114,00002,265,088
7Dec 9, 2021 17:30124,754640,470,174611,293,00002,527,232
8Dec 9, 2021 17:30124,776638,929,884610,402,000999,0002,265,088
9Dec 9, 2021 17:30124,839643,836,416609,713,0001,999,0002,461,696
10Dec 9, 2021 17:30124,845641,887,506609,740,0001,999,0002,265,088
11Dec 9, 2021 17:30124,852635,145,719609,778,0001,999,0002,469,888
12Dec 9, 2021 17:30125,649703,649,814615,680,83002,244,608