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 listApr 27, 2024 19:07Hal FHal FScore: 53,612Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 27, 2024 19:0753,061282,426,568259,001,0001,000,0002,269,184
2Apr 27, 2024 19:0753,082283,682,372257,100,0003,001,0002,289,664
3Apr 27, 2024 19:0653,083288,145,034257,104,0003,001,0002,273,280
4Apr 27, 2024 19:0753,124329,872,452260,307,80802,277,376
5Apr 27, 2024 19:0653,125287,187,461260,311,00002,289,664
6Apr 27, 2024 19:0753,142322,189,777260,396,35302,277,376
7Apr 27, 2024 19:0653,183343,551,478260,598,43702,277,376
8Apr 27, 2024 19:0653,397283,378,081259,649,0001,997,0002,285,568
9Apr 27, 2024 19:0753,484323,398,264262,073,08402,273,280
10Apr 27, 2024 19:0753,498291,795,753260,137,0002,001,0002,265,088
11Apr 27, 2024 19:0653,517290,631,129260,232,0002,001,0002,289,664
12Apr 27, 2024 19:0753,539285,527,243260,339,0002,002,0002,289,664
13Apr 27, 2024 19:0653,612290,254,347260,701,0001,997,0002,523,136
14Apr 27, 2024 19:0653,617290,137,093259,726,0002,996,0002,289,664
15Apr 27, 2024 19:0753,629286,268,637260,782,0001,998,0002,289,664
16Apr 27, 2024 19:0753,659286,516,510259,931,0002,999,0002,265,088
17Apr 27, 2024 19:0653,676290,179,915262,010,0001,000,0002,289,664
18Apr 27, 2024 19:0653,684289,886,325260,051,0003,000,0002,523,136
19Apr 27, 2024 19:0753,768287,443,839260,469,0002,993,0002,269,184
20Apr 27, 2024 19:0654,181335,914,625265,486,36902,273,280
21Apr 27, 2024 19:0654,221337,454,532265,681,65502,281,472
22Apr 27, 2024 19:0758,310310,917,294282,724,0002,997,0002,289,664
23Apr 27, 2024 19:0659,039319,151,098287,291,0002,002,0002,289,664
24Apr 27, 2024 19:0759,537320,053,666289,733,0001,998,0002,527,232