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 listJul 30, 2022 11:17Robert BurkeRobert BurkeScore: 60,758Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 30, 2022 11:1760,104351,654,506294,507,48002,179,072
2Jul 30, 2022 11:1760,631362,202,622297,093,66302,179,072
3Jul 30, 2022 11:1760,699327,469,333296,426,0001,001,0002,281,472
4Jul 30, 2022 11:1760,705325,091,132296,453,0001,001,0002,445,312
5Jul 30, 2022 11:1760,710324,050,611296,480,0001,001,0002,281,472
6Jul 30, 2022 11:1760,749327,495,826295,675,0001,997,0002,281,472
7Jul 30, 2022 11:1760,758322,498,612295,715,0001,998,0002,445,312
8Jul 30, 2022 11:1760,807321,379,778295,957,0001,999,0002,281,472
9Jul 30, 2022 11:1761,243326,906,133298,089,0002,000,0002,273,280
10Jul 30, 2022 11:1761,565328,459,238299,670,0001,997,0002,441,216
11Jul 30, 2022 11:1761,925332,359,803302,430,0001,001,0002,281,472
12Jul 30, 2022 11:1762,380355,067,432305,662,20302,179,072