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 3, 2026 07:56Karthik 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 3, 2026 07:560322,439,638298,863,00012,605,00020,480expected "560381147174 ", got "n250000000 0 0 9 74 728 7361 74898 749343 7477769 27404104 mn143 mx4294967278 s16 518 s24 139163 "
2Oct 3, 2026 07:560323,131,655299,474,00012,611,00020,480expected "560380348694 ", got "n250000000 0 0 11 67 780 7553 74340 749079 7480943 27401513 mn116 mx4294966710 s16 545 s24 139100 "
3Oct 3, 2026 07:560322,094,873298,068,00013,049,00020,480expected "560379874925 ", got "n250000000 0 0 8 81 742 7534 74885 747300 7480136 27403600 mn173 mx4294967174 s16 562 s24 139295 "