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 listNov 29, 2024 10:36NoSIMD_C#NoSIMD_C#Score: 1,089,161Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 29, 2024 10:361,087,0445,355,863,8495,320,519,0005,997,0002,273,280
2Nov 29, 2024 10:361,087,6755,358,649,0335,328,608,000999,0002,510,848
3Nov 29, 2024 10:361,088,5515,365,768,6025,330,900,0002,998,0002,277,376
4Nov 29, 2024 10:361,088,7705,362,465,0935,332,976,0001,998,0002,273,280
5Nov 29, 2024 10:361,089,1615,371,670,0335,331,894,0004,997,0002,273,280
6Nov 29, 2024 10:361,089,2025,367,864,7115,335,091,0001,998,0002,273,280
7Nov 29, 2024 10:361,089,4815,370,098,8695,335,460,0002,998,0002,277,376
8Nov 29, 2024 10:361,089,9485,380,194,0935,338,749,0001,998,0002,273,280
9Nov 29, 2024 10:361,090,1495,368,503,6695,340,731,000999,0002,273,280