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 10, 2025 15:56Advait IyerAdvait IyerScore: 994,550Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 10, 2025 15:56994,3494,902,144,4964,869,314,0002,998,0002,285,568
2Jan 10, 2025 15:56994,3634,907,517,1644,869,384,0002,997,0002,285,568
3Jan 10, 2025 15:56994,5254,906,364,9184,871,173,0001,998,0002,285,568
4Jan 10, 2025 15:56994,5314,902,017,1084,870,206,0002,998,0002,285,568
5Jan 10, 2025 15:56994,5504,903,355,5294,870,296,0002,998,0002,293,760
6Jan 10, 2025 15:56994,6584,905,326,3794,870,824,0002,998,0002,293,760
7Jan 10, 2025 15:56994,7064,902,528,2964,871,060,0002,998,0002,351,104
8Jan 10, 2025 15:56994,7544,905,768,2834,870,299,0003,997,0002,281,472
9Jan 10, 2025 15:56994,8134,904,920,6334,871,588,0002,997,0002,285,568