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 21, 2022 23:49Robert BurkeRobert BurkeScore: 79,716Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 21, 2022 23:4979,612418,384,077390,101,00002,424,832
2Jul 21, 2022 23:4979,633413,035,188390,204,00002,281,472
3Jul 21, 2022 23:4979,652418,116,498390,295,00002,424,832
4Jul 21, 2022 23:4979,662412,796,212390,344,00002,519,040
5Jul 21, 2022 23:4979,682417,483,721390,442,00002,281,472
6Jul 21, 2022 23:4979,715415,027,235388,606,0001,997,0002,281,472
7Jul 21, 2022 23:4979,716421,013,944389,608,000998,0002,281,472
8Jul 21, 2022 23:4984,828437,624,141414,659,000999,0002,281,472
9Jul 21, 2022 23:4992,3101,003,988,087452,318,675071,045,120
10Jul 21, 2022 23:4992,5241,285,936,848453,365,265071,106,560
11Jul 21, 2022 23:4992,5761,056,332,698453,621,781071,081,984
12Jul 21, 2022 23:4996,296497,206,227470,850,000999,0002,281,472