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 listJun 12, 2024 13:54matsuoka-601matsuoka-601Score: 59,781Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jun 12, 2024 13:5459,308360,404,523290,608,20902,285,568
2Jun 12, 2024 13:5459,324359,640,967290,689,72102,285,568
3Jun 12, 2024 13:5459,518325,074,423288,642,0002,996,0002,416,640
4Jun 12, 2024 13:5459,521318,628,617289,656,0001,997,0002,293,760
5Jun 12, 2024 13:5459,537316,496,433288,735,0002,997,0002,424,832
6Jun 12, 2024 13:5459,549318,426,495289,792,0001,998,0002,420,736
7Jun 12, 2024 13:5459,781370,040,663292,924,48902,277,376
8Jun 12, 2024 13:5459,798315,955,009290,010,0003,000,0002,265,088
9Jun 12, 2024 13:5459,928319,934,449290,651,0002,996,0002,293,760
10Jun 12, 2024 13:5459,947321,352,911291,744,0001,998,0002,428,928
11Jun 12, 2024 13:5464,712340,437,096314,089,0003,000,0002,293,760
12Jun 12, 2024 13:5470,077371,072,116341,375,0002,002,0002,420,736