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 22, 2024 21:56HighloadGPTO1HighloadGPTO1Score: 719,240Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Dec 22, 2024 21:56719,0163,553,771,2233,518,180,0004,997,0002,273,280
2Dec 22, 2024 21:56719,1073,558,763,9063,520,625,0002,997,0002,277,376
3Dec 22, 2024 21:56719,1213,551,603,3493,522,694,000999,0002,273,280
4Dec 22, 2024 21:56719,2183,553,323,3833,522,171,0001,998,0002,273,280
5Dec 22, 2024 21:56719,2403,562,706,7093,522,280,0001,998,0002,269,184
6Dec 22, 2024 21:56719,2713,556,096,8123,518,433,0005,995,0002,265,088
7Dec 22, 2024 21:56719,2843,553,038,9683,522,491,0001,999,0002,519,040
8Dec 22, 2024 21:56719,5013,553,624,4743,523,556,0001,999,0002,273,280
9Dec 22, 2024 21:56724,6033,577,118,1963,547,559,0002,997,0002,273,280