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 listFeb 28, 2023 11:26Robert BurkeRobert BurkeScore: 55,357Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Feb 28, 2023 11:2652,850330,448,624258,964,20002,179,072
2Feb 28, 2023 11:2652,857323,856,536258,999,61302,174,976
3Oct 17, 2023 17:2452,884318,916,797259,133,17902,187,264
4Oct 17, 2023 17:2452,886334,143,257259,141,96202,183,168
5Oct 17, 2023 17:2452,893321,282,657259,178,02102,179,072
6Feb 28, 2023 11:2652,907341,112,760259,243,25402,179,072
7Oct 17, 2023 17:2455,288292,515,569268,914,0001,999,0002,441,216
8Feb 28, 2023 11:2655,333292,795,010270,133,0001,000,0002,453,504
9Oct 17, 2023 17:2455,335297,689,362269,140,0002,001,0002,441,216
10Oct 17, 2023 17:2455,346292,786,045270,194,0001,000,0002,441,216
11Feb 28, 2023 11:2655,346296,697,599270,197,0001,000,0002,449,408
12Oct 17, 2023 17:2455,353291,062,861270,232,0001,000,0002,281,472
13Oct 17, 2023 17:2455,357290,420,392270,250,0001,000,0002,441,216
14Feb 28, 2023 11:2655,429301,281,523269,605,0001,997,0002,281,472
15Feb 28, 2023 11:2655,440298,181,066269,660,0001,997,0002,277,376
16Feb 28, 2023 11:2655,465300,912,875269,781,0001,998,0002,441,216
17Feb 28, 2023 11:2655,511296,329,782270,002,0002,000,0002,441,216
18Feb 28, 2023 11:2655,640300,573,017271,639,000998,0002,441,216
19Feb 28, 2023 11:2655,676291,538,003271,814,000999,0002,281,472
20Oct 17, 2023 17:2455,850297,218,625272,665,000998,0002,281,472
21Feb 28, 2023 11:2655,894298,711,877271,882,0001,999,0002,453,504
22Oct 17, 2023 17:2455,944300,722,345272,128,0002,000,0002,281,472
23Oct 17, 2023 17:2455,974295,823,865273,273,0001,001,0002,281,472
24Oct 17, 2023 17:2456,320302,081,287273,970,0001,999,0002,273,280