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 11, 2025 13:50Advait IyerAdvait IyerScore: 659,533Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 11, 2025 13:50659,3253,263,888,5013,228,693,0001,999,0002,297,856
2Jan 11, 2025 13:50659,3593,258,149,1233,227,860,0002,998,0002,297,856
3Jan 11, 2025 13:50659,3943,269,036,3963,228,035,0002,998,0002,289,664
4Jan 11, 2025 13:50659,4833,260,402,9833,228,470,0002,997,0002,502,656
5Jan 11, 2025 13:50659,5333,263,237,9693,228,713,0002,997,0002,297,856
6Jan 11, 2025 13:50659,5873,258,401,1873,228,980,0002,998,0002,502,656
7Jan 11, 2025 13:50659,5913,261,633,5173,228,999,0002,998,0002,289,664
8Jan 11, 2025 13:50659,6183,257,857,8203,228,132,0003,997,0002,289,664
9Jan 11, 2025 13:50659,6933,266,612,2933,231,498,000999,0002,510,848