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 listMay 11, 2025 10:31Emanuele BolognesiEmanuele BolognesiScore: 919,189Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 11, 2025 10:31918,9054,532,352,5334,501,635,000999,0002,285,568
2May 11, 2025 10:31918,9704,531,110,2334,500,953,0001,999,0002,281,472
3May 11, 2025 10:31919,0644,543,161,0114,502,416,000999,0002,281,472
4May 11, 2025 10:31919,1324,536,449,0844,500,748,0002,998,0002,371,584
5May 11, 2025 10:31919,1894,531,333,5714,501,027,0002,998,0002,359,296
6May 11, 2025 10:31919,5094,533,698,9434,504,596,000999,0002,355,200
7May 11, 2025 10:31919,6764,537,032,3144,504,414,0001,998,0002,359,296
8May 11, 2025 10:31919,7134,530,421,0254,505,597,000999,0002,355,200
9May 11, 2025 10:31920,0114,544,273,1954,507,056,000999,0002,281,472