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 listMay 3, 2021 21:13Dmitry DolgopolovDmitry DolgopolovScore: 521,308Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 3, 2021 21:13469,4482,358,374,2952,300,296,26502,260,992
2May 3, 2021 21:13469,4702,373,138,4222,300,403,30602,260,992
3May 3, 2021 21:19469,4782,364,657,1212,300,440,82202,265,088
4May 3, 2021 21:13469,4822,361,657,2342,300,460,66902,248,704
5May 3, 2021 21:19469,4892,363,838,7562,300,496,93302,252,800
6May 3, 2021 21:13469,4972,359,870,8782,300,535,90002,265,088
7May 3, 2021 21:13469,5012,364,005,7432,300,553,33302,248,704
8May 3, 2021 21:13469,5252,355,110,8632,300,673,71402,265,088
9May 3, 2021 21:19469,5432,361,354,5692,300,760,59502,256,896
10May 3, 2021 21:13521,3082,614,150,9802,554,410,92602,252,800
11May 3, 2021 21:13521,3922,622,562,4522,554,821,84602,256,896
12May 3, 2021 21:19521,4052,615,311,8992,554,885,42402,252,800
13May 3, 2021 21:19521,4352,626,245,1862,555,030,29102,252,800
14May 3, 2021 21:13521,4402,633,528,7962,555,055,94202,252,800
15May 3, 2021 21:19521,4442,623,402,2502,555,077,87502,248,704
16May 3, 2021 21:13521,4562,616,581,7452,555,136,84202,244,608
17May 3, 2021 21:13521,5032,623,152,1552,555,366,88702,240,512
18May 3, 2021 21:13521,6132,630,368,9932,555,904,69102,260,992