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 22:44Hal FHal FScore: 55,455Success
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 22:4454,657342,133,720267,820,35702,269,184
2Apr 25, 2024 22:4455,008296,475,719266,544,0002,994,0002,289,664
3Apr 25, 2024 22:4455,018298,978,146266,593,0002,995,0002,289,664
4Apr 25, 2024 22:4455,032297,932,310267,658,0001,997,0002,289,664
5Apr 25, 2024 22:4455,045329,823,816269,722,03902,277,376
6Apr 25, 2024 22:4455,448300,087,992268,701,0002,996,0002,289,664
7Apr 25, 2024 22:4455,455295,248,422268,733,0002,997,0002,289,664
8Apr 25, 2024 22:4455,466293,014,339268,787,0002,997,0002,289,664
9Apr 25, 2024 22:4455,486293,488,284268,882,0002,998,0002,289,664
10Apr 25, 2024 22:4455,743335,126,937273,138,84102,277,376
11Apr 25, 2024 22:4455,996303,032,223273,377,0001,001,0002,289,664
12Apr 25, 2024 22:4459,490318,317,200289,499,0002,003,0002,289,664