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 listSep 20, 2022 17:57Bernard TeoBernard TeoScore: 75,592Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 20, 2022 17:5774,626393,255,534365,666,00002,404,352
2Sep 20, 2022 17:5774,667392,650,740364,871,000999,0002,396,160
3Sep 20, 2022 17:5774,872387,935,291365,872,000999,0002,490,368
4Sep 20, 2022 17:5775,448398,344,313367,698,0001,998,0002,281,472
5Sep 20, 2022 17:5775,467388,774,512368,787,000999,0002,281,472
6Sep 20, 2022 17:5775,470390,056,117368,802,000999,0002,281,472
7Sep 20, 2022 17:5775,592389,900,563369,400,0001,001,0002,281,472
8Sep 20, 2022 17:5776,177403,548,725372,266,0001,000,0002,281,472
9Sep 20, 2022 17:5776,811403,886,241376,376,00002,396,160
10Sep 20, 2022 17:5777,777439,281,724381,105,19202,265,088
11Sep 20, 2022 17:5777,919438,636,043381,804,72202,273,280
12Sep 20, 2022 17:5778,603444,768,279385,152,38902,252,800