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 listJan 10, 2025 15:06Advait IyerAdvait IyerScore: 1,029,607Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jan 10, 2025 15:061,029,4055,075,500,0514,936,148,000107,937,0002,281,472
2Jan 10, 2025 15:061,029,4325,071,492,1104,929,281,000114,936,0002,281,472
3Jan 10, 2025 15:061,029,4455,070,067,3384,916,351,000127,931,0002,281,472
4Jan 10, 2025 15:061,029,5975,077,620,2764,932,072,000112,955,0002,293,760
5Jan 10, 2025 15:061,029,6075,075,387,8444,946,113,00098,962,0002,281,472
6Jan 10, 2025 15:061,029,8495,078,273,0574,938,321,000107,941,0002,293,760
7Jan 10, 2025 15:061,030,0595,075,327,2894,939,349,000107,942,0002,281,472
8Jan 10, 2025 15:061,030,0975,077,884,8934,937,530,000109,945,0002,420,736
9Jan 10, 2025 15:061,030,9135,081,649,1364,927,537,000123,938,0002,293,760