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 listOct 4, 2022 11:52Robert BurkeRobert BurkeScore: 61,621Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 4, 2022 11:5258,608355,551,953287,177,01502,183,168
2Oct 4, 2022 11:5258,990349,335,232289,051,14902,187,264
3Oct 4, 2022 11:5259,014356,876,996289,169,96802,174,976
4Oct 4, 2022 11:5261,589325,432,150299,786,0001,998,0002,281,472
5Oct 4, 2022 11:5261,598323,450,995299,830,0001,998,0002,441,216
6Oct 4, 2022 11:5261,599326,792,578299,835,0001,998,0002,441,216
7Oct 4, 2022 11:5261,621324,915,917299,942,0001,999,0002,445,312
8Oct 4, 2022 11:5261,640324,581,343300,036,0002,000,0002,281,472
9Oct 4, 2022 11:5261,646329,095,152301,067,0001,000,0002,281,472
10Oct 4, 2022 11:5261,678330,875,529301,224,0001,000,0002,281,472
11Oct 4, 2022 11:5261,768325,162,320301,665,000998,0002,277,376
12Oct 4, 2022 11:5262,061329,772,658303,099,0001,000,0002,281,472