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 12:43Hal FHal FScore: 60,334Success
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 12:4355,299334,471,961270,967,01302,277,376
2Apr 27, 2024 12:4355,376345,090,521271,340,63802,273,280
3Apr 27, 2024 12:2455,379363,363,756271,356,49402,269,184
4Apr 27, 2024 12:4355,460329,189,963271,751,69002,285,568
5Apr 27, 2024 12:2455,469353,038,553271,798,98502,277,376
6Apr 27, 2024 12:2455,499330,581,955271,944,32002,281,472
7Apr 27, 2024 12:4360,203320,647,845293,997,000999,0002,265,088
8Apr 27, 2024 12:4360,235316,739,860293,150,0002,001,0002,523,136
9Apr 27, 2024 12:2460,235320,581,001292,151,0003,001,0002,289,664
10Apr 27, 2024 12:4360,237321,487,614293,159,0002,001,0002,289,664
11Apr 27, 2024 12:2460,267316,267,253294,308,0001,001,0002,527,232
12Apr 27, 2024 12:2460,271319,238,091293,328,0002,002,0002,289,664
13Apr 27, 2024 12:2460,334320,517,553293,639,0001,997,0002,269,184
14Apr 27, 2024 12:2461,512326,687,402299,405,0002,002,0002,289,664
15Apr 27, 2024 12:4361,512323,564,184300,407,0001,001,0002,265,088
16Apr 27, 2024 12:2461,518326,838,766300,436,0001,001,0002,523,136
17Apr 27, 2024 12:2461,519327,717,121299,448,0001,996,0002,269,184
18Apr 27, 2024 12:4361,531327,530,424299,498,0002,003,0002,289,664
19Apr 27, 2024 12:4361,584325,198,235298,764,0002,997,0002,289,664
20Apr 27, 2024 12:4361,770330,990,100300,677,0001,997,0002,289,664
21Apr 27, 2024 12:4362,013330,050,828300,866,0002,998,0002,527,232
22Apr 27, 2024 12:4362,104327,166,073302,310,0002,002,0002,289,664
23Apr 27, 2024 12:2462,170328,937,411301,636,0002,996,0002,289,664
24Apr 27, 2024 12:2476,586402,733,706373,271,0002,001,0002,265,088