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 12:29Advait IyerAdvait IyerScore: 1,101,753Success
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 12:291,100,5215,417,569,8495,263,611,000128,941,0002,277,376
2Jan 10, 2025 12:291,101,1635,424,220,5325,266,753,000128,944,0002,277,376
3Jan 10, 2025 12:291,101,3025,421,573,0515,283,437,000112,945,0002,277,376
4Jan 10, 2025 12:291,101,5455,427,745,9135,269,653,000127,918,0002,289,664
5Jan 10, 2025 12:291,101,7535,428,474,0365,274,647,000123,944,0002,523,136
6Jan 10, 2025 12:291,102,0245,431,804,9065,296,979,000102,941,0002,392,064
7Jan 10, 2025 12:291,102,4185,430,528,2595,292,911,000108,936,0002,289,664
8Jan 10, 2025 12:291,102,4745,430,901,1775,287,186,000114,938,0002,277,376
9Jan 10, 2025 12:291,102,6035,429,150,8915,302,816,00099,940,0002,277,376