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 listOct 4, 2022 11:58Robert BurkeRobert BurkeScore: 56,001Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 4, 2022 11:5855,609336,033,650272,482,52502,174,976
2Oct 4, 2022 11:5855,619333,306,208272,533,77102,183,168
3Oct 4, 2022 11:5855,934297,669,577272,078,0002,000,0002,445,312
4Oct 4, 2022 11:5855,947303,988,156273,141,0001,000,0002,281,472
5Oct 4, 2022 11:5855,955295,389,850273,180,0001,000,0002,281,472
6Oct 4, 2022 11:5855,957303,789,705273,187,0001,000,0002,269,184
7Oct 4, 2022 11:5856,001302,020,400273,405,0001,001,0002,281,472
8Oct 4, 2022 11:5856,015300,585,329273,473,0001,001,0002,441,216
9Oct 4, 2022 11:5856,025302,775,043272,526,0001,996,0002,281,472
10Oct 4, 2022 11:5856,027297,604,037273,534,000998,0002,449,408
11Oct 4, 2022 11:5856,451301,508,296274,614,0001,997,0002,449,408
12Oct 4, 2022 11:5858,893342,469,589288,577,18402,187,264