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 listApr 28, 2024 21:15Hal FHal FScore: 54,548Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Apr 28, 2024 21:1554,299288,098,666265,066,0001,000,0002,265,088
2Apr 28, 2024 21:1554,307291,518,577265,104,0001,000,0002,269,184
3Apr 28, 2024 21:1554,353289,896,963264,328,0002,002,0002,289,664
4Apr 28, 2024 21:1554,361288,513,378264,366,0002,002,0002,289,664
5Apr 28, 2024 21:1554,435289,523,282263,736,0002,997,0002,265,088
6Apr 28, 2024 21:1554,476290,437,222263,934,0002,999,0002,269,184
7Apr 28, 2024 21:1554,548288,231,639265,285,0002,002,0002,269,184
8Apr 28, 2024 21:1554,583294,107,639265,452,0002,003,0002,527,232
9Apr 28, 2024 21:1554,586293,260,605265,468,0002,003,0002,289,664
10Apr 28, 2024 21:1554,976339,680,045269,384,17102,273,280
11Apr 28, 2024 21:1555,030334,528,320269,645,00002,273,280
12Apr 28, 2024 21:1555,168334,017,459270,324,02402,277,376