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:09Yuriy LyfenkoYuriy LyfenkoScore: 96,981Success
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:0996,900555,217,902474,811,51102,215,936
2Dec 10, 2021 02:1596,909503,302,372472,853,0001,999,0002,265,088
3Dec 10, 2021 02:0996,923501,384,513472,926,0001,999,0002,527,232
4Dec 10, 2021 02:1596,926504,245,205473,938,000999,0002,342,912
5Dec 10, 2021 02:0996,938551,502,660474,994,76802,203,648
6Dec 10, 2021 02:1596,947542,616,496475,041,80802,211,840
7Dec 10, 2021 02:0996,953496,231,192474,072,0001,000,0002,334,720
8Dec 10, 2021 02:0996,959504,977,779473,098,0002,000,0002,265,088
9Dec 10, 2021 02:1596,959500,466,128475,100,00002,527,232
10Dec 10, 2021 02:1596,970500,230,576474,155,0001,000,0002,334,720
11Dec 10, 2021 02:0996,973499,536,448475,166,00002,342,912
12Dec 10, 2021 02:1596,975498,704,435474,176,0001,000,0002,334,720
13Dec 10, 2021 02:0996,981496,043,038474,206,0001,000,0002,527,232
14Dec 10, 2021 02:0996,987547,927,278475,235,33402,203,648
15Dec 10, 2021 02:0996,989498,613,830474,247,0001,000,0002,265,088
16Dec 10, 2021 02:0996,993504,032,771474,265,0001,000,0002,527,232
17Dec 10, 2021 02:0996,993507,103,873474,266,0001,000,0002,265,088
18Dec 10, 2021 02:1596,999502,709,416474,294,0001,000,0002,347,008
19Dec 10, 2021 02:0997,014506,205,684474,373,000998,0002,342,912
20Dec 10, 2021 02:1597,026501,830,369475,427,00002,338,816
21Dec 10, 2021 02:1597,065502,294,236474,619,000999,0002,265,088
22Dec 10, 2021 02:1597,069548,502,528475,636,97302,203,648
23Dec 10, 2021 02:1597,072558,613,124475,653,36902,322,432
24Dec 10, 2021 02:1597,089502,055,144473,739,0001,998,0002,347,008