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 listNov 2, 2022 00:28Bernard TeoBernard TeoScore: 48,286Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 2, 2022 00:2848,145259,708,323235,912,00002,400,256
2Nov 2, 2022 00:2848,169260,719,120234,027,0002,000,0002,396,160
3Nov 2, 2022 00:2848,169262,408,898234,029,0002,000,0002,281,472
4Nov 2, 2022 00:2848,189267,622,371235,128,0001,000,0002,281,472
5Nov 2, 2022 00:2848,206258,406,947235,210,0001,000,0002,281,472
6Nov 2, 2022 00:2848,258271,279,125235,464,0001,001,0002,281,472
7Nov 2, 2022 00:2848,286259,193,485235,604,000998,0002,281,472
8Nov 2, 2022 00:2848,290264,228,964234,627,0001,996,0002,408,448
9Nov 2, 2022 00:2848,802335,129,951239,127,82102,269,184
10Nov 2, 2022 00:2848,819306,470,551239,213,00502,265,088
11Nov 2, 2022 00:2848,819314,201,107239,214,67102,265,088
12Nov 2, 2022 00:2851,072273,691,447249,255,000997,0002,396,160