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:59Robert BurkeRobert BurkeScore: 74,138Success
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:5970,409398,895,004345,005,33202,293,760
2Jul 21, 2022 18:5970,422409,468,270345,070,23602,289,664
3Jul 21, 2022 18:5970,472404,367,900345,310,87802,285,568
4Jul 21, 2022 18:5974,111386,189,108363,143,00002,433,024
5Jul 21, 2022 18:5974,123382,163,809363,202,00002,519,040
6Jul 21, 2022 18:5974,126390,843,479363,215,00002,281,472
7Jul 21, 2022 18:5974,138383,816,854362,274,0001,000,0002,281,472
8Jul 21, 2022 18:5974,138384,082,264363,278,00002,281,472
9Jul 21, 2022 18:5974,138389,697,808363,278,00002,281,472
10Jul 21, 2022 18:5974,139384,271,750363,283,00002,424,832
11Jul 21, 2022 18:5974,203388,399,540361,598,0001,997,0002,428,928
12Jul 21, 2022 18:5974,204385,934,531361,601,0001,997,0002,281,472