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 10, 2021 02:19Yuriy LyfenkoYuriy LyfenkoScore: 108,566Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 10, 2021 02:19108,483564,577,484529,567,0001,998,0002,527,232
2Dec 10, 2021 02:19108,499557,727,449530,645,000999,0002,465,792
3Dec 10, 2021 02:19108,524561,732,871529,769,0001,999,0002,338,816
4Dec 10, 2021 02:19108,530559,132,387530,796,000999,0002,527,232
5Dec 10, 2021 02:19108,531559,329,013529,803,0001,999,0002,265,088
6Dec 10, 2021 02:19108,532558,624,613531,809,00002,265,088
7Dec 10, 2021 02:19108,566561,753,853529,974,0001,999,0002,338,816
8Dec 10, 2021 02:19108,582559,040,224530,052,0002,000,0002,265,088
9Dec 10, 2021 02:19108,764597,940,577532,941,84402,211,840
10Dec 10, 2021 02:19108,765592,082,944532,947,42702,203,648
11Dec 10, 2021 02:19108,813589,727,725533,184,40302,199,552
12Dec 10, 2021 02:19109,269561,941,578534,419,0001,000,0002,256,896