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 18:36Robert BurkeRobert BurkeScore: 55,438Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Feb 28, 2023 11:2452,914324,008,610259,278,45902,187,264
2Oct 4, 2022 18:3652,961332,626,842259,508,96602,183,168
3Oct 4, 2022 18:3652,969322,718,502259,545,98102,183,168
4Oct 4, 2022 18:3652,990331,866,013259,653,23302,174,976
5Feb 28, 2023 11:2452,998326,072,714259,691,33502,183,168
6Feb 28, 2023 11:2453,187328,384,243260,616,75102,179,072
7Oct 4, 2022 18:3655,361292,816,661270,270,0001,001,0002,281,472
8Oct 4, 2022 18:3655,368291,124,399270,302,0001,001,0002,281,472
9Oct 4, 2022 18:3655,370296,382,539270,312,0001,001,0002,441,216
10Feb 28, 2023 11:2455,377292,406,148270,345,0001,001,0002,437,120
11Feb 28, 2023 11:2455,379296,017,398270,356,0001,001,0002,453,504
12Feb 28, 2023 11:2455,400299,500,877270,460,0001,001,0002,269,184
13Feb 28, 2023 11:2455,438298,910,888270,646,000998,0002,281,472
14Feb 28, 2023 11:2455,442302,734,703269,670,0001,997,0002,445,312
15Feb 28, 2023 11:2455,446299,486,375269,688,0001,997,0002,445,312
16Oct 4, 2022 18:3655,448299,013,600269,699,0001,997,0002,441,216
17Feb 28, 2023 11:2455,465294,329,037269,782,0001,998,0002,281,472
18Oct 4, 2022 18:3655,833294,687,296271,585,0001,996,0002,277,376
19Oct 4, 2022 18:3655,840295,563,458271,618,0001,997,0002,281,472
20Oct 4, 2022 18:3655,897296,878,003271,897,0001,999,0002,281,472
21Oct 4, 2022 18:3655,901294,049,788272,918,000999,0002,281,472
22Feb 28, 2023 11:2455,927294,862,061272,043,0002,000,0002,445,312
23Oct 4, 2022 18:3655,932294,953,038272,068,0002,000,0002,535,424
24Feb 28, 2023 11:2456,776306,446,406277,200,0001,000,0002,281,472