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 27, 2024 11:04Hal FHal FScore: 56,513Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 27, 2024 11:0456,108299,097,586272,932,0001,999,0002,289,664
2Apr 27, 2024 11:0456,121298,270,651271,993,0002,999,0002,289,664
3Apr 27, 2024 11:0456,126298,005,505272,016,0003,000,0002,523,136
4Apr 27, 2024 11:0456,133301,840,841272,053,0003,000,0002,265,088
5Apr 27, 2024 11:0456,140301,359,420273,087,0002,000,0002,289,664
6Apr 27, 2024 11:0456,471302,836,988273,714,0002,996,0002,281,472
7Apr 27, 2024 11:0456,513301,476,522273,915,0002,999,0002,269,184
8Apr 27, 2024 11:0456,638305,803,057275,530,0001,996,0002,269,184
9Apr 27, 2024 11:0457,070353,292,705279,645,08502,277,376
10Apr 27, 2024 11:0457,099353,572,236279,786,80002,273,280
11Apr 27, 2024 11:0464,882339,169,521315,925,0001,999,0002,281,472
12Apr 27, 2024 11:0468,940409,050,885337,803,74502,277,376