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 13:05Andrei GrazhdankovAndrei GrazhdankovScore: 2,646,158Success
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 13:052,521,15312,411,707,61812,353,647,34702,232,320
2May 20, 2021 13:052,522,80112,418,391,27512,361,724,93702,232,320
3May 20, 2021 13:052,525,23112,429,905,60012,373,631,11602,236,416
4May 20, 2021 13:052,646,15813,019,638,12712,966,172,33902,215,936
5May 20, 2021 13:052,647,56113,034,772,51612,973,048,90002,224,128
6May 20, 2021 13:052,649,79713,047,884,30612,984,007,55402,232,320