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 25, 2024 21:26Hal FHal FScore: 58,666Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 25, 2024 21:2657,446309,330,584279,482,0002,003,0002,285,568
2Apr 25, 2024 21:2657,490307,063,089279,705,0001,997,0002,285,568
3Apr 25, 2024 21:2657,514309,310,711278,819,0002,998,0002,285,568
4Apr 25, 2024 21:2657,549305,519,312279,993,0001,999,0002,285,568
5Apr 25, 2024 21:2657,553308,498,268280,009,0002,000,0002,285,568
6Apr 25, 2024 21:2658,621312,010,959285,241,0002,001,0002,285,568
7Apr 25, 2024 21:2658,666319,570,895285,461,0002,003,0002,285,568
8Apr 25, 2024 21:2658,707317,937,705285,667,0001,997,0002,514,944
9Apr 25, 2024 21:2660,877354,630,748298,298,25402,269,184
10Apr 25, 2024 21:2667,649405,066,743331,478,49302,260,992
11Apr 25, 2024 21:2685,644449,440,057416,657,0002,997,0002,367,488
12Apr 25, 2024 21:26106,335589,680,620521,040,82402,269,184