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:06Yuriy LyfenkoYuriy LyfenkoScore: 97,014Success
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:0696,940498,613,423474,008,0001,000,0002,265,088
2Dec 10, 2021 02:0696,965555,131,899475,130,67202,199,552
3Dec 10, 2021 02:0696,975502,368,824474,176,0001,000,0002,342,912
4Dec 10, 2021 02:0696,994502,254,134474,271,0001,000,0002,347,008
5Dec 10, 2021 02:0697,007504,104,598473,335,0001,997,0002,347,008
6Dec 10, 2021 02:0697,007502,805,237474,336,0001,000,0002,269,184
7Dec 10, 2021 02:0697,014506,902,061473,372,0001,997,0002,338,816
8Dec 10, 2021 02:0697,020500,307,035475,398,00002,527,232
9Dec 10, 2021 02:0697,029502,211,694475,442,00002,265,088
10Dec 10, 2021 02:0697,061550,534,405475,597,09302,203,648
11Dec 10, 2021 02:0697,064501,788,816473,617,0001,998,0002,334,720
12Dec 10, 2021 02:0697,070550,616,641475,642,40602,195,456