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 listMar 8, 2024 02:53Huy Duc LeHuy Duc LeScore: 165,854Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 8, 2024 02:53157,921836,592,797773,811,69502,260,992
2Mar 8, 2024 02:56158,140843,565,119774,885,89802,273,280
3Mar 8, 2024 02:56158,489836,167,670776,595,41202,269,184
4Mar 8, 2024 02:53158,700837,379,835777,628,33102,265,088
5Mar 8, 2024 02:53160,633850,122,399787,102,41102,273,280
6Mar 8, 2024 02:56161,110859,354,031789,439,33502,265,088
7Mar 8, 2024 02:53165,035834,725,311695,718,000112,954,0002,281,472
8Mar 8, 2024 02:56165,157835,348,669695,230,000114,037,0002,281,472
9Mar 8, 2024 02:56165,211832,555,153696,458,000113,074,0002,281,472
10Mar 8, 2024 02:56165,367834,059,262691,401,000118,897,0002,387,968
11Mar 8, 2024 02:53165,572842,039,748701,261,000110,041,0002,281,472
12Mar 8, 2024 02:56165,847834,292,810696,702,000115,950,0002,269,184
13Mar 8, 2024 02:53165,854836,310,406704,727,000107,958,0002,383,872
14Mar 8, 2024 02:56166,043843,306,350702,664,000110,946,0002,281,472
15Mar 8, 2024 02:53166,179842,722,645704,242,000110,037,0002,277,376
16Mar 8, 2024 02:56166,211841,397,958706,511,000107,925,0002,269,184
17Mar 8, 2024 02:53166,348842,726,987701,091,000114,014,0002,281,472
18Mar 8, 2024 02:53166,530844,390,481708,999,000106,999,0002,281,472
19Mar 8, 2024 02:56167,394849,188,516707,200,000113,032,0002,281,472
20Mar 8, 2024 02:56167,548843,206,238713,987,000106,998,0002,281,472
21Mar 8, 2024 02:53167,681849,598,391711,685,000109,951,0002,277,376
22Mar 8, 2024 02:53167,850850,545,240713,538,000108,929,0002,273,280
23Mar 8, 2024 02:56168,069846,239,547703,604,000119,932,0002,281,472
24Mar 8, 2024 02:53168,307847,436,494705,746,000118,957,0002,277,376