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 listApr 25, 2024 21:27Hal FHal FScore: 59,731Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 25, 2024 21:2759,567317,711,555289,877,0001,999,0002,285,568
2Apr 25, 2024 21:2759,606315,385,760291,069,0001,000,0002,285,568
3Apr 25, 2024 21:2759,608315,477,933290,080,0002,000,0002,523,136
4Apr 25, 2024 21:2759,613317,616,750289,102,0003,001,0002,285,568
5Apr 25, 2024 21:2759,617317,543,883289,122,0003,001,0002,527,232
6Apr 25, 2024 21:2759,683323,849,529291,446,0001,001,0002,285,568
7Apr 25, 2024 21:2759,731350,621,870292,680,38802,281,472
8Apr 25, 2024 21:2759,751353,529,937292,780,27802,273,280
9Apr 25, 2024 21:2759,771353,582,401292,878,53502,281,472
10Apr 25, 2024 21:2760,218322,898,188292,069,0003,000,0002,285,568
11Apr 25, 2024 21:2761,025328,397,807296,023,0003,000,0002,285,568
12Apr 25, 2024 21:2761,074325,340,556296,263,0003,002,0002,285,568