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 listDec 7, 2024 17:32Nick RolfeNick RolfeScore: 2,813,090Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 7, 2024 17:322,791,65013,709,659,39413,542,146,000136,940,0002,277,376
2Dec 7, 2024 17:322,795,15813,722,705,48513,572,327,000123,948,0002,277,376
3Dec 7, 2024 17:322,795,25213,730,571,71313,551,812,000144,923,0002,277,376
4Dec 7, 2024 17:322,802,16913,759,855,49613,599,690,000130,939,0002,277,376
5Dec 7, 2024 17:322,813,09013,819,880,68813,654,205,000129,935,0002,265,088
6Dec 7, 2024 17:322,813,10913,811,680,22113,672,289,000111,945,0002,277,376
7Dec 7, 2024 17:322,822,49113,866,729,04213,696,281,000133,924,0002,277,376
8Dec 7, 2024 17:322,852,08714,014,120,52413,844,292,000130,936,0002,269,184
9Dec 7, 2024 17:322,897,60414,234,567,24014,062,316,000135,945,0002,269,184