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:03Hal FHal FScore: 58,173Success
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:0356,186299,008,742273,307,0002,002,0002,285,568
2Apr 25, 2024 22:0356,278309,948,386274,763,000999,0002,285,568
3Apr 25, 2024 22:0356,362302,739,459273,171,0003,001,0002,285,568
4Apr 25, 2024 22:0356,550301,599,007275,093,0002,000,0002,285,568
5Apr 25, 2024 22:0356,556307,290,876274,122,0003,001,0002,269,184
6Apr 25, 2024 22:0356,665303,953,809275,660,0001,997,0002,531,328
7Apr 25, 2024 22:0358,173307,767,290283,050,0002,000,0002,527,232
8Apr 25, 2024 22:0358,213308,231,570282,243,0003,002,0002,523,136
9Apr 25, 2024 22:0358,217310,983,974282,261,0003,002,0002,269,184
10Apr 25, 2024 22:0358,947348,485,178288,841,28602,281,472
11Apr 25, 2024 22:0358,995363,859,749289,077,24802,289,664
12Apr 25, 2024 22:0359,013346,310,616289,165,85402,277,376