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 20, 2021 00:19alex3dalex3dScore: 4,287,310Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 20, 2021 00:194,171,13820,503,188,18220,438,578,47802,281,472
2May 20, 2021 00:194,185,04720,575,126,43120,506,730,83002,269,184
3May 20, 2021 00:194,202,09320,651,889,28420,590,254,33802,285,568
4May 20, 2021 00:194,284,91621,057,800,88120,996,087,42202,277,376
5May 20, 2021 00:194,287,31021,071,449,13621,007,816,78402,277,376
6May 20, 2021 00:194,288,75221,088,239,50621,014,886,92802,277,376
7May 20, 2021 00:194,289,16921,085,474,86121,016,925,73402,269,184
8May 20, 2021 00:194,294,52421,101,590,90421,043,168,62802,277,376
9May 20, 2021 00:194,328,89721,274,887,50721,211,593,00202,277,376