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 listMay 16, 2026 18:53M-RochatM-RochatError
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 16, 2026 18:53011,473,493821,00002,117,632expected "560382228405 ", got "1801478707 181846151 1650008556 3921301583 1853193344 3391791791 2448885486 3402885911 67448509 2040069141 1289142325 3040245456 2246767284 1300549677 2617873984 2257289868 "
2May 16, 2026 18:5309,846,614829,00002,117,632expected "560375369483 ", got "2496294905 1390727289 1936759318 3468196324 1108040608 1813497621 3156831341 1352902976 833488997 2918531628 2612595608 995671272 341160587 707334117 2869673649 3730461307 "
3May 16, 2026 18:5309,266,961826,00002,117,632expected "560376326041 ", got "612403242 3437106825 113057038 2532840575 492892125 3235937032 2142417032 2822375318 1672269445 4290427708 24708903 1445649917 4083339834 2629993620 102530098 317471025 "