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 listJun 14, 2021 11:03Andrey TsvetkovAndrey TsvetkovScore: 2,641,936Success
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:252,522,13412,414,805,90212,358,456,19002,236,416
2Jun 14, 2021 11:032,523,29112,437,131,38512,364,126,96102,220,032
3May 19, 2021 21:252,526,05512,451,756,85112,377,668,62702,232,320
4Jun 14, 2021 11:032,526,91412,446,351,43612,381,877,61002,240,512
5Jun 14, 2021 11:032,527,41512,442,132,18512,384,331,84602,240,512
6May 19, 2021 21:252,528,26712,469,780,12212,388,506,15002,220,032
7May 19, 2021 21:252,641,93612,998,841,26912,945,488,47802,224,128
8May 19, 2021 21:252,644,79013,028,154,65512,959,468,77902,232,320
9May 19, 2021 21:252,645,41613,029,363,19112,962,539,78602,228,224
10May 19, 2021 21:252,646,38313,029,288,73612,967,277,76102,236,416
11May 19, 2021 21:252,649,95413,039,867,02712,984,774,17102,224,128
12May 19, 2021 21:252,654,72813,079,481,53213,008,167,92502,236,416