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 21, 2022 18:57Robert BurkeRobert BurkeScore: 74,141Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 21, 2022 18:5770,394413,718,835344,933,04002,289,664
2Jul 21, 2022 18:5770,436410,415,810345,137,52002,289,664
3Jul 21, 2022 18:5774,092384,976,821362,053,0001,000,0002,433,024
4Jul 21, 2022 18:5774,130386,156,455362,237,0001,000,0002,519,040
5Jul 21, 2022 18:5774,133391,177,790363,254,00002,281,472
6Jul 21, 2022 18:5774,136388,027,811362,264,0001,000,0002,281,472
7Jul 21, 2022 18:5774,141389,504,465362,293,000998,0002,281,472
8Jul 21, 2022 18:5774,145384,233,223362,311,0001,000,0002,437,120
9Jul 21, 2022 18:5774,151385,682,516363,340,00002,281,472
10Jul 21, 2022 18:5774,156390,246,716362,365,0001,001,0002,428,928
11Jul 21, 2022 18:5774,214390,272,481360,652,0002,997,0002,428,928
12Jul 21, 2022 18:5796,856541,855,122474,592,38902,289,664