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 16:15Advait IyerAdvait IyerScore: 994,429Success
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 16:00994,0104,899,910,9884,867,651,0002,998,0002,285,568
2Jan 10, 2025 16:00994,0824,899,361,1924,868,003,0002,998,0002,285,568
3Jan 10, 2025 16:00994,2854,902,626,7714,869,996,0001,999,0002,281,472
4Jan 10, 2025 16:00994,2944,903,725,3774,869,041,0002,998,0002,285,568
5Jan 10, 2025 16:00994,3254,900,558,3794,869,196,0002,998,0002,506,752
6Jan 10, 2025 16:15994,3714,906,630,6554,869,420,0002,999,0002,285,568
7Jan 10, 2025 16:00994,4294,902,797,2714,870,704,0001,998,0002,285,568
8Jan 10, 2025 16:15994,4634,905,069,9594,869,870,0002,998,0002,289,664
9Jan 10, 2025 16:00994,4724,901,949,2184,869,913,0002,998,0002,285,568
10Jan 10, 2025 16:00994,4844,899,882,3814,869,973,0002,998,0002,289,664
11Jan 10, 2025 16:15994,5544,905,268,0824,870,319,0002,997,0002,506,752
12Jan 10, 2025 16:00994,6434,903,599,6224,871,750,0001,999,0002,285,568