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 23, 2022 09:23Robert BurkeRobert BurkeScore: 64,900Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Jul 23, 2022 09:1262,316373,608,518305,348,78402,183,168
2Jul 23, 2022 09:1262,327364,944,453305,403,50302,260,992
3Jul 23, 2022 09:1262,349354,811,215305,508,46102,187,264
4Jul 23, 2022 09:2362,352364,808,722305,522,87802,183,168
5Jul 23, 2022 09:2362,821381,910,276307,825,03302,187,264
6Jul 23, 2022 09:2363,462394,300,871310,961,59302,183,168
7Jul 23, 2022 09:1264,863338,029,254315,829,0001,998,0002,281,472
8Jul 23, 2022 09:1264,866340,159,661315,843,0001,999,0002,281,472
9Jul 23, 2022 09:2364,882342,413,821315,923,0001,999,0002,281,472
10Jul 23, 2022 09:2364,888340,578,211315,952,0001,999,0002,281,472
11Jul 23, 2022 09:2364,892347,140,149315,974,0001,999,0002,281,472
12Jul 23, 2022 09:1264,899343,192,055316,003,0002,000,0002,437,120
13Jul 23, 2022 09:1264,900345,409,383316,012,0002,000,0002,441,216
14Jul 23, 2022 09:2364,907338,961,195316,043,0002,000,0002,449,408
15Jul 23, 2022 09:1264,909339,862,233317,055,0001,000,0002,277,376
16Jul 23, 2022 09:1264,919344,366,456317,104,0001,000,0002,281,472
17Jul 23, 2022 09:2364,951347,380,506317,262,000997,0002,281,472
18Jul 23, 2022 09:2364,970343,779,676317,353,0001,001,0002,281,472
19Jul 23, 2022 09:2364,986344,555,783317,431,0001,001,0002,281,472
20Jul 23, 2022 09:2364,997343,286,296316,488,0001,996,0002,281,472
21Jul 23, 2022 09:1265,033343,494,174316,663,0001,997,0002,281,472
22Jul 23, 2022 09:2365,049342,185,665316,741,0001,998,0002,441,216
23Jul 23, 2022 09:1265,323344,628,274319,081,0001,000,0002,281,472
24Jul 23, 2022 09:1265,671350,623,571320,787,0001,002,0002,281,472