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:35Bernard TeoBernard TeoScore: 74,182Success
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:3774,095389,506,562361,067,0002,000,0002,281,472
2Sep 20, 2022 17:3774,113393,081,705362,155,0001,000,0002,396,160
3Sep 20, 2022 17:3574,127387,178,708362,223,0001,000,0002,281,472
4Sep 20, 2022 17:3774,130392,164,150362,242,000997,0002,404,352
5Sep 20, 2022 17:3574,150390,073,586362,333,0001,000,0002,281,472
6Sep 20, 2022 17:3774,151390,229,231362,340,0001,000,0002,396,160
7Sep 20, 2022 17:3574,154389,745,129362,357,0001,000,0002,281,472
8Sep 20, 2022 17:3574,156389,835,462362,365,0001,001,0002,404,352
9Sep 20, 2022 17:3774,157391,208,726362,373,000998,0002,281,472
10Sep 20, 2022 17:3574,161394,487,942363,388,00002,281,472
11Sep 20, 2022 17:3574,161391,738,046362,388,0001,001,0002,400,256
12Sep 20, 2022 17:3774,165396,978,109363,410,00002,400,256
13Sep 20, 2022 17:3774,182389,625,711363,494,00002,281,472
14Sep 20, 2022 17:3774,182391,751,849362,493,0001,001,0002,400,256
15Sep 20, 2022 17:3574,187387,465,862361,518,0001,997,0002,396,160
16Sep 20, 2022 17:3774,199388,654,304361,579,0001,997,0002,396,160
17Sep 20, 2022 17:3574,200389,669,850361,583,0001,997,0002,396,160
18Sep 20, 2022 17:3574,691388,179,860363,987,0001,999,0002,396,160
19Sep 20, 2022 17:3575,724462,487,010371,048,61502,265,088
20Sep 20, 2022 17:3775,753447,373,256371,191,41802,273,280
21Sep 20, 2022 17:3575,770448,062,120371,273,95402,269,184
22Sep 20, 2022 17:3775,795443,671,879371,396,23302,260,992
23Sep 20, 2022 17:3575,824441,234,305371,535,83702,260,992
24Sep 20, 2022 17:3776,039439,131,218372,591,28102,256,896