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 01:39Yuriy LyfenkoYuriy LyfenkoScore: 111,720Success
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 01:39111,657579,585,719546,119,0001,000,0002,265,088
2Dec 10, 2021 01:39111,666572,763,054546,161,0001,000,0002,265,088
3Dec 10, 2021 01:39111,670575,172,802546,184,0001,000,0002,347,008
4Dec 10, 2021 01:39111,691570,769,539546,286,0001,000,0002,342,912
5Dec 10, 2021 01:39111,696584,573,149546,310,0001,000,0002,338,816
6Dec 10, 2021 01:39111,711578,368,690546,384,000998,0002,265,088
7Dec 10, 2021 01:39111,720576,585,095546,428,000998,0002,527,232
8Dec 10, 2021 01:39111,742575,582,241545,536,0001,998,0002,265,088
9Dec 10, 2021 01:39111,750574,345,052547,574,00002,338,816
10Dec 10, 2021 01:39112,259616,853,812550,069,31002,211,840
11Dec 10, 2021 01:39112,298611,144,254550,259,36502,203,648
12Dec 10, 2021 01:39112,454621,699,170551,025,01502,211,840