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 listOct 6, 2026 02:41Karthik ReddyKarthik ReddyError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 6, 2026 02:410339,454,730285,408,00043,482,0002,113,536expected "560386121310 ", got "n250000000 0 2 7 63 761 7395 75356 747316 7483146 27400240 mn36 mx4294967217 s16 528 s24 139599 "
2Oct 6, 2026 02:410338,920,910285,645,00042,691,00020,480expected "560375318488 ", got "n250000000 0 2 2 77 755 7443 74726 749761 7482577 27398943 mn46 mx4294966934 s16 530 s24 139411 "
3Oct 6, 2026 02:410340,508,834284,794,00045,001,00020,480expected "560375798359 ", got "n250000000 0 1 4 76 769 7703 74472 746925 7483903 27400433 mn66 mx4294967123 s16 545 s24 139166 "