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 23, 2022 12:15Robert BurkeRobert BurkeScore: 63,811Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 23, 2022 12:1562,453365,519,645306,021,20802,179,072
2Jul 23, 2022 12:1562,479364,764,368306,148,56602,183,168
3Jul 23, 2022 12:1562,483384,624,265306,166,19702,179,072
4Jul 23, 2022 12:1563,808341,229,102310,664,0001,997,0002,281,472
5Jul 23, 2022 12:1563,810335,833,749311,670,000998,0002,281,472
6Jul 23, 2022 12:1563,810335,963,963311,673,000998,0002,441,216
7Jul 23, 2022 12:1563,811335,958,116311,676,000998,0002,281,472
8Jul 23, 2022 12:1563,812338,920,056311,680,000998,0002,281,472
9Jul 23, 2022 12:1563,814339,134,183310,689,0001,998,0002,281,472
10Jul 23, 2022 12:1563,816339,767,020310,700,0001,998,0002,449,408
11Jul 23, 2022 12:1563,818334,484,944310,710,0001,998,0002,445,312
12Jul 23, 2022 12:1563,899337,216,569311,107,0002,000,0002,281,472