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:45Hal FHal FScore: 55,498Success
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:4554,970293,536,801268,354,0001,001,0002,269,184
2Apr 25, 2024 22:4555,067292,468,229267,832,0001,998,0002,273,280
3Apr 25, 2024 22:4555,072294,293,583266,853,0002,998,0002,523,136
4Apr 25, 2024 22:4555,077295,005,551266,881,0002,998,0002,273,280
5Apr 25, 2024 22:4555,125296,840,670267,113,0003,001,0002,289,664
6Apr 25, 2024 22:4555,461296,450,298269,759,0001,998,0002,527,232
7Apr 25, 2024 22:4555,498330,183,763271,938,16202,281,472
8Apr 25, 2024 22:4555,502298,588,565268,959,0002,999,0002,289,664
9Apr 25, 2024 22:4555,533343,187,232272,111,40102,265,088
10Apr 25, 2024 22:4555,535292,999,219271,120,0001,000,0002,289,664
11Apr 25, 2024 22:4556,047299,618,060271,635,0002,995,0002,367,488
12Apr 25, 2024 22:4556,316355,232,179275,946,31602,281,472