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:07Yuriy LyfenkoYuriy LyfenkoScore: 97,006Success
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:0796,886549,662,680474,742,21602,203,648
2Dec 10, 2021 02:0796,913499,415,952473,873,000999,0002,461,696
3Dec 10, 2021 02:0796,933497,723,391474,971,00002,527,232
4Dec 10, 2021 02:0796,941496,684,399475,010,00002,338,816
5Dec 10, 2021 02:0796,945567,291,238475,032,94502,203,648
6Dec 10, 2021 02:0896,966499,901,151474,131,0001,000,0002,265,088
7Dec 10, 2021 02:0896,972539,857,189475,164,66302,203,648
8Dec 10, 2021 02:0896,977498,239,729474,186,0001,000,0002,334,720
9Dec 10, 2021 02:0796,980498,024,807474,203,0001,000,0002,265,088
10Dec 10, 2021 02:0896,983500,530,446475,217,00002,347,008
11Dec 10, 2021 02:0896,983498,983,487474,217,0001,000,0002,265,088
12Dec 10, 2021 02:0896,986498,981,020474,233,0001,000,0002,527,232
13Dec 10, 2021 02:0797,006503,113,836475,327,00002,527,232
14Dec 10, 2021 02:0797,015505,498,119474,373,0001,000,0002,265,088
15Dec 10, 2021 02:0897,020504,381,381474,399,0001,000,0002,342,912
16Dec 10, 2021 02:0797,021505,038,742473,406,0001,997,0002,338,816
17Dec 10, 2021 02:0797,021501,070,582475,405,00002,338,816
18Dec 10, 2021 02:0797,021543,748,286475,402,13302,211,840
19Dec 10, 2021 02:0797,023502,123,285473,416,0001,997,0002,265,088
20Dec 10, 2021 02:0897,034506,390,203474,471,000998,0002,338,816
21Dec 10, 2021 02:0897,046501,900,612474,525,000999,0002,265,088
22Dec 10, 2021 02:0897,081501,938,172473,699,0001,998,0002,527,232
23Dec 10, 2021 02:0897,515574,669,050477,821,70602,199,552
24Dec 10, 2021 02:0897,583541,686,783478,157,36702,203,648