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 listNov 9, 2024 22:24E SequeiraE SequeiraScore: 2,856,560Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 9, 2024 22:242,838,36013,939,730,24713,755,031,000152,933,0002,281,472
2Nov 9, 2024 22:242,838,50613,940,589,70313,780,748,000127,932,0002,281,472
3Nov 9, 2024 22:242,838,55413,940,171,39713,770,996,000137,919,0002,281,472
4Nov 9, 2024 22:242,855,79814,025,762,85113,875,473,000117,936,0002,281,472
5Nov 9, 2024 22:242,856,56014,026,386,56213,861,213,000135,933,0002,281,472
6Nov 9, 2024 22:242,865,40414,075,986,59513,908,542,000131,938,0002,281,472
7Nov 9, 2024 22:242,891,61114,204,979,97814,032,965,000135,931,0002,281,472
8Nov 9, 2024 22:242,896,29314,224,708,38914,031,907,000159,930,0002,281,472
9Nov 9, 2024 22:242,897,61514,231,195,00514,075,388,000122,924,0002,281,472