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 listJul 30, 2022 11:05Robert BurkeRobert BurkeScore: 62,010Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 30, 2022 11:0560,348367,551,214295,703,10202,183,168
2Jul 30, 2022 11:0560,373380,762,681295,828,46802,174,976
3Jul 30, 2022 11:0560,793353,445,208297,886,58602,187,264
4Jul 30, 2022 11:0561,981328,369,979301,709,0001,998,0002,437,120
5Jul 30, 2022 11:0562,004326,684,870301,820,0001,998,0002,277,376
6Jul 30, 2022 11:0562,007325,974,832301,835,0001,998,0002,445,312
7Jul 30, 2022 11:0562,010330,083,748301,852,0001,999,0002,445,312
8Jul 30, 2022 11:0562,015328,695,475301,873,0001,999,0002,281,472
9Jul 30, 2022 11:0562,016325,780,768301,877,0001,999,0002,281,472
10Jul 30, 2022 11:0562,019325,477,220301,894,0001,999,0002,281,472
11Jul 30, 2022 11:0562,053324,242,584302,059,0002,000,0002,281,472
12Jul 30, 2022 11:0562,064326,913,844302,113,0002,000,0002,531,328