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 24, 2024 20:52Hal FHal FScore: 71,480Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 24, 2024 20:5271,002426,030,443347,911,11102,273,280
2Apr 24, 2024 20:5271,412373,632,488346,919,0002,999,0002,285,568
3Apr 24, 2024 20:5271,419374,231,671346,955,0002,999,0002,285,568
4Apr 24, 2024 20:5271,440377,184,943348,058,0002,000,0002,527,232
5Apr 24, 2024 20:5271,454376,192,742349,127,0001,000,0002,527,232
6Apr 24, 2024 20:5271,469379,392,904348,197,0002,001,0002,285,568
7Apr 24, 2024 20:5271,480374,039,284348,249,0002,001,0002,285,568
8Apr 24, 2024 20:5271,484376,592,836349,274,0001,000,0002,285,568
9Apr 24, 2024 20:5271,658375,323,398348,123,0003,001,0002,514,944
10Apr 24, 2024 20:5271,819412,176,641351,915,02902,273,280
11Apr 24, 2024 20:5271,883434,267,754352,225,61002,277,376
12Apr 24, 2024 20:5272,016376,991,083349,880,0002,998,0002,527,232