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 16, 2024 17:41Dan StolyarovDan StolyarovScore: 712,765Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 16, 2024 17:41712,3403,519,073,0483,383,543,000106,922,0002,469,888
2Nov 16, 2024 17:41712,5333,519,449,9803,384,459,000106,951,0002,289,664
3Nov 16, 2024 17:41712,5503,524,962,0273,378,543,000112,951,0002,473,984
4Nov 16, 2024 17:41712,6323,520,876,7163,373,968,000117,928,0002,469,888
5Nov 16, 2024 17:41712,7653,525,503,4523,382,595,000109,954,0002,473,984
6Nov 16, 2024 17:41712,8483,519,918,1093,375,025,000117,931,0002,281,472
7Nov 16, 2024 17:41712,9263,518,172,3293,371,397,000121,942,0002,289,664
8Nov 16, 2024 17:41713,4073,524,165,2513,384,768,000110,926,0002,281,472
9Nov 16, 2024 17:41713,6573,522,365,3813,375,991,000120,928,0002,289,664