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 08:05Ian MckibbenIan MckibbenScore: 2,441,284Success
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 08:052,425,68120,584,993,6689,317,811,0002,568,024,000188,416
2Jan 13, 2025 08:052,441,28421,324,834,9789,293,257,0002,669,035,000204,800
3Jan 13, 2025 08:052,455,67021,910,433,6009,441,930,0002,590,852,000270,336