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 listJan 13, 2025 07:34Ian MckibbenIan MckibbenScore: 2,819,053Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 13, 2025 07:342,792,29713,716,502,80813,540,324,000141,930,0002,277,376
2Jan 13, 2025 07:342,799,18713,746,538,14713,574,088,000141,927,0002,289,664
3Jan 13, 2025 07:342,813,48813,821,108,95313,667,152,000118,940,0002,277,376
4Jan 13, 2025 07:342,814,11513,825,904,79113,666,225,000122,939,0002,277,376
5Jan 13, 2025 07:342,819,05313,842,838,71413,666,431,000146,929,0002,277,376
6Jan 13, 2025 07:342,819,81213,846,696,00713,701,136,000115,941,0002,277,376
7Jan 13, 2025 07:342,821,26413,858,867,79813,662,276,000161,920,0002,277,376
8Jan 13, 2025 07:342,825,89213,879,405,10213,745,921,000100,948,0002,289,664
9Jan 13, 2025 07:342,838,72113,946,289,16913,769,805,000139,926,0002,289,664