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 11:56Hal FHal FScore: 61,759Success
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 11:5659,937357,042,335293,690,94502,277,376
2Apr 27, 2024 11:5659,937361,952,755293,691,47302,281,472
3Apr 27, 2024 11:5660,057356,802,679294,280,65502,281,472
4Apr 27, 2024 11:5660,067355,008,381294,327,96602,277,376
5Apr 27, 2024 11:5660,334364,606,207295,638,09602,269,184
6Apr 27, 2024 11:5660,729363,126,702297,569,85302,273,280
7Apr 27, 2024 11:5661,640328,713,409299,038,0003,000,0002,289,664
8Apr 27, 2024 11:5661,668327,143,875299,171,0003,001,0002,289,664
9Apr 27, 2024 11:5661,694324,884,439302,299,00002,265,088
10Apr 27, 2024 11:5661,696323,465,768300,308,0002,002,0002,273,280
11Apr 27, 2024 11:5661,712331,395,681300,386,0002,002,0002,289,664
12Apr 27, 2024 11:5661,729327,851,120300,469,0002,003,0002,289,664
13Apr 27, 2024 11:5661,759330,702,915300,614,0002,004,0002,523,136
14Apr 27, 2024 11:5661,765334,171,549300,651,0001,997,0002,289,664
15Apr 27, 2024 11:5661,766326,089,838300,658,0001,997,0002,383,872
16Apr 27, 2024 11:5661,768335,284,955300,666,0001,997,0002,269,184
17Apr 27, 2024 11:5661,784330,689,565300,746,0001,998,0002,396,160
18Apr 27, 2024 11:5661,817330,174,882299,906,0002,999,0002,289,664
19Apr 27, 2024 11:5661,821327,537,201300,926,0001,999,0002,289,664
20Apr 27, 2024 11:5662,186332,684,246301,715,0002,997,0002,285,568
21Apr 27, 2024 11:5663,034339,214,202305,868,0002,998,0002,289,664
22Apr 27, 2024 11:5663,038330,537,572306,886,0001,999,0002,519,040
23Apr 27, 2024 11:5663,111331,810,685306,241,0003,002,0002,273,280
24Apr 27, 2024 11:5663,146338,458,941308,415,0001,001,0002,523,136