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:33Advait IyerAdvait IyerScore: 1,012,256Success
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:331,011,2894,989,834,7234,952,319,0002,998,0002,289,664
2Jan 10, 2025 15:331,011,6444,986,293,7094,954,058,0002,998,0002,285,568
3Jan 10, 2025 15:331,011,8494,987,588,3804,955,064,0002,998,0002,506,752
4Jan 10, 2025 15:331,012,2514,991,309,2684,956,031,0003,997,0002,289,664
5Jan 10, 2025 15:331,012,2564,994,337,1814,957,058,0002,998,0002,293,760
6Jan 10, 2025 15:331,012,5144,994,010,9074,958,319,0002,998,0002,285,568
7Jan 10, 2025 15:331,012,8504,999,032,4974,960,967,0001,998,0002,293,760
8Jan 10, 2025 15:331,013,4124,998,285,8334,962,720,0002,998,0002,293,760
9Jan 10, 2025 15:331,014,2865,003,438,5444,967,001,0002,998,0002,293,760