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 listJul 20, 2022 15:14Yuriy LyfenkoYuriy LyfenkoScore: 101,449Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 20, 2022 15:14101,376526,383,747494,742,0001,998,0002,527,232
2Jul 20, 2022 15:14101,388522,370,929494,800,0001,999,0002,265,088
3Jul 20, 2022 15:14101,404523,504,850495,879,000999,0002,265,088
4Jul 20, 2022 15:14101,409524,255,186494,903,0001,999,0002,289,664
5Jul 20, 2022 15:14101,423549,337,740496,971,64302,285,568
6Jul 20, 2022 15:14101,445525,765,423496,082,0001,000,0002,297,856
7Jul 20, 2022 15:14101,449523,454,162495,102,0002,000,0002,265,088
8Jul 20, 2022 15:14101,466520,210,325497,184,00002,289,664
9Jul 20, 2022 15:14101,518528,576,872496,440,0001,000,0002,527,232
10Jul 20, 2022 15:14101,572564,320,350497,702,46502,285,568
11Jul 20, 2022 15:14101,868522,779,289497,151,0002,000,0002,265,088
12Jul 20, 2022 15:14102,198567,577,639500,769,43302,285,568