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 19, 2021 21:23Yuriy LyfenkoYuriy LyfenkoScore: 2,643,523Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1May 19, 2021 21:232,525,48512,442,361,98412,374,878,49302,228,224
2May 19, 2021 21:232,527,94412,459,721,46012,386,927,32302,224,128
3May 19, 2021 21:232,529,22212,456,830,86912,393,187,11702,232,320
4May 19, 2021 21:232,640,34112,995,895,05812,937,669,29702,211,840
5May 19, 2021 21:232,643,52313,008,190,60512,953,263,72502,236,416
6May 19, 2021 21:232,643,56713,013,617,42512,953,477,68602,240,512
7May 19, 2021 21:232,643,58913,012,105,39712,953,584,19502,232,320
8May 19, 2021 21:232,644,13513,019,845,10212,956,263,53702,244,608
9May 19, 2021 21:232,651,43113,053,957,20112,992,010,41702,240,512