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 listMay 2, 2024 19:26Hal FHal FScore: 57,426Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 2, 2024 19:2657,247309,160,848279,513,000998,0002,527,232
2May 2, 2024 19:2657,258338,899,204280,562,77102,277,376
3May 2, 2024 19:2657,282308,498,707277,684,0002,996,0002,289,664
4May 2, 2024 19:2657,283305,878,895278,692,0001,997,0002,265,088
5May 2, 2024 19:2657,400304,413,311279,261,0002,001,0002,289,664
6May 2, 2024 19:2657,415309,286,602280,335,000997,0002,523,136
7May 2, 2024 19:2657,426306,247,966279,384,0002,002,0002,289,664
8May 2, 2024 19:2657,570336,787,924282,094,91502,285,568
9May 2, 2024 19:2657,760304,256,641280,023,0003,000,0002,527,232
10May 2, 2024 19:2657,806308,186,309281,250,0002,001,0002,289,664
11May 2, 2024 19:2657,904310,848,125280,731,0002,997,0002,281,472
12May 2, 2024 19:2667,873408,594,253332,576,26802,281,472