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 28, 2024 21:01Hal FHal FScore: 54,644Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 28, 2024 21:0152,576325,790,683257,620,73802,281,472
2Apr 28, 2024 21:0153,107325,945,596260,223,07402,277,376
3Apr 28, 2024 21:0153,428323,544,843261,795,76302,265,088
4Apr 28, 2024 21:0154,375291,521,904265,437,0001,001,0002,531,328
5Apr 28, 2024 21:0154,393293,172,222265,526,0001,001,0002,523,136
6Apr 28, 2024 21:0154,643287,301,996264,753,0002,997,0002,269,184
7Apr 28, 2024 21:0154,644291,688,496264,758,0002,997,0002,527,232
8Apr 28, 2024 21:0154,668290,317,174265,873,0001,999,0002,265,088
9Apr 28, 2024 21:0154,696292,634,164267,005,0001,003,0002,289,664
10Apr 28, 2024 21:0154,723289,962,224265,143,0003,001,0002,289,664
11Apr 28, 2024 21:0154,945290,689,795268,230,0001,000,0002,289,664
12Apr 28, 2024 21:0154,956296,186,228267,282,0002,002,0002,289,664