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 10:48Hal FHal FScore: 57,374Success
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 10:4856,926351,581,052278,937,61502,273,280
2Apr 27, 2024 10:4857,127355,160,087279,923,10602,285,568
3Apr 27, 2024 10:4857,198307,581,812277,267,0003,002,0002,289,664
4Apr 27, 2024 10:4857,290338,307,143280,722,44302,281,472
5Apr 27, 2024 10:4857,330302,587,224278,918,0001,999,0002,289,664
6Apr 27, 2024 10:4857,332308,733,680277,930,0002,999,0002,289,664
7Apr 27, 2024 10:4857,374303,572,334279,131,0002,000,0002,269,184
8Apr 27, 2024 10:4857,418303,976,214278,347,0003,003,0002,289,664
9Apr 27, 2024 10:4857,798305,177,127280,209,0003,002,0002,285,568
10Apr 27, 2024 10:4857,821309,343,260280,331,0002,992,0002,379,776
11Apr 27, 2024 10:4857,828308,764,864281,353,0002,002,0002,289,664
12Apr 27, 2024 10:4858,200315,058,610283,177,0002,001,0002,265,088