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 listNov 9, 2024 22:25E SequeiraE SequeiraScore: 2,799,345Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 9, 2024 22:252,792,99313,715,756,49713,544,731,000140,934,0002,281,472
2Nov 9, 2024 22:252,794,30213,728,608,62713,551,141,000140,939,0002,281,472
3Nov 9, 2024 22:252,794,32913,725,892,66213,562,275,000129,935,0002,281,472
4Nov 9, 2024 22:252,794,77313,730,262,80613,564,461,000129,927,0002,281,472
5Nov 9, 2024 22:252,799,34513,751,010,38113,577,865,000138,926,0002,281,472
6Nov 9, 2024 22:252,818,24413,845,462,74613,667,474,000141,921,0002,281,472
7Nov 9, 2024 22:252,818,62413,844,538,25613,669,337,000141,920,0002,281,472
8Nov 9, 2024 22:252,856,02814,030,307,13613,857,612,000136,927,0002,281,472
9Nov 9, 2024 22:252,937,91614,434,510,17714,257,865,000137,921,0002,281,472