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 9, 2025 17:36Advait IyerAdvait IyerScore: 2,777,291Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 9, 2025 17:362,710,62913,318,466,63313,141,167,000140,916,0002,265,088
2Jan 9, 2025 17:362,711,27513,315,134,51513,154,315,000130,933,0002,277,376
3Jan 9, 2025 17:362,711,48513,318,553,00613,142,340,000143,938,0002,277,376
4Jan 9, 2025 17:362,713,55213,324,289,43613,153,476,000142,929,0002,277,376
5Jan 9, 2025 17:362,777,29113,648,357,37713,479,784,000128,940,0002,289,664
6Jan 9, 2025 17:362,781,15513,657,695,27613,492,732,000134,927,0002,281,472
7Jan 9, 2025 17:362,864,73714,073,137,72013,932,268,000104,941,0002,277,376
8Jan 9, 2025 17:362,910,93614,299,320,45214,119,650,000143,935,0002,265,088
9Jan 9, 2025 17:362,912,13414,300,369,54414,131,530,000137,927,0002,273,280