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 14:03Advait IyerAdvait IyerScore: 654,958Success
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 14:03654,8933,239,921,8143,205,979,0002,997,0002,465,792
2Jan 11, 2025 14:03654,9273,240,285,6733,206,147,0002,997,0002,326,528
3Jan 11, 2025 14:03654,9333,239,001,2923,205,173,0003,997,0002,285,568
4Jan 11, 2025 14:03654,9423,243,625,3013,206,220,0002,998,0002,330,624
5Jan 11, 2025 14:03654,9583,242,380,3213,205,297,0003,997,0002,457,600
6Jan 11, 2025 14:03654,9713,240,256,1673,207,361,0001,998,0002,465,792
7Jan 11, 2025 14:03655,0033,236,286,7053,206,519,0002,997,0002,334,720
8Jan 11, 2025 14:03655,0063,239,366,1983,206,533,0002,997,0002,465,792
9Jan 11, 2025 14:03655,0293,247,490,8313,207,643,0001,999,0002,289,664