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 listOct 26, 2021 13:12evgenikwtevgenikwtScore: 172,920Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 26, 2021 13:12172,651896,048,967845,988,01402,244,608
2Oct 26, 2021 11:58172,821909,400,143846,824,30002,232,320
3Oct 26, 2021 11:58172,904908,351,655847,230,16802,248,704
4Oct 26, 2021 11:58172,920915,125,742847,306,03002,240,512
5Oct 26, 2021 13:12173,282902,174,846849,080,70002,252,800
6Oct 26, 2021 13:12173,335905,420,299849,339,99302,240,512