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 listOct 4, 2022 03:54Bernard TeoBernard TeoScore: 59,619Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 4, 2022 03:5459,354315,984,964288,838,0001,998,0002,400,256
2Oct 4, 2022 03:5459,363312,655,650289,879,000999,0002,514,944
3Oct 4, 2022 03:5459,367313,074,268288,899,0001,999,0002,396,160
4Oct 4, 2022 03:5459,382314,618,487289,975,000999,0002,281,472
5Oct 4, 2022 03:5459,394311,258,598289,029,0002,000,0002,392,064
6Oct 4, 2022 03:5459,420317,852,354290,158,0001,000,0002,400,256
7Oct 4, 2022 03:5459,422317,590,747290,167,0001,000,0002,281,472
8Oct 4, 2022 03:5459,422317,063,360291,169,00002,396,160
9Oct 4, 2022 03:5459,429316,394,258291,200,00002,281,472
10Oct 4, 2022 03:5459,463323,999,073290,366,0001,001,0002,396,160
11Oct 4, 2022 03:5459,494322,970,372291,522,00002,387,968
12Oct 4, 2022 03:5459,602318,904,011290,049,0002,000,0002,387,968
13Oct 4, 2022 03:5459,619321,809,437290,131,0002,000,0002,281,472
14Oct 4, 2022 03:5459,670316,034,533291,382,0001,001,0002,281,472
15Oct 4, 2022 03:5459,678318,757,483291,422,0001,001,0002,392,064
16Oct 4, 2022 03:5459,703318,794,065290,551,0001,996,0002,396,160
17Oct 4, 2022 03:5459,717319,742,527290,617,0001,997,0002,396,160
18Oct 4, 2022 03:5459,737315,366,348290,715,0001,998,0002,396,160
19Oct 4, 2022 03:5459,995352,762,913293,973,66102,260,992
20Oct 4, 2022 03:5460,007352,933,507294,033,30002,273,280
21Oct 4, 2022 03:5460,013351,396,201294,061,49002,269,184
22Oct 4, 2022 03:5460,028358,815,405294,135,42002,260,992
23Oct 4, 2022 03:5460,095346,536,029294,466,38902,265,088
24Oct 4, 2022 03:5462,885372,608,029308,137,04902,252,800