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 19, 2025 12:33MatthiasMatthiasScore: 2,934,709Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 19, 2025 12:332,930,41914,390,404,11414,199,133,000159,922,0002,277,376
2Jan 19, 2025 12:332,930,52014,389,914,17914,200,632,000158,917,0002,277,376
3Jan 19, 2025 12:332,930,61214,396,840,57414,218,077,000141,920,0002,273,280
4Jan 19, 2025 12:332,933,21814,405,594,44514,235,855,000136,912,0002,277,376
5Jan 19, 2025 12:332,934,70914,411,846,30914,256,162,000123,914,0002,289,664
6Jan 19, 2025 12:332,934,73914,416,152,64614,254,280,000125,940,0002,277,376
7Jan 19, 2025 12:332,935,29214,413,913,16514,243,999,000138,931,0002,277,376
8Jan 19, 2025 12:332,935,70214,423,639,78314,263,000,000121,940,0002,277,376
9Jan 19, 2025 12:333,746,93318,398,004,23418,227,054,000132,920,0002,277,376