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 08:57Robert BurkeRobert BurkeScore: 64,526Success
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 08:5763,473380,826,706311,016,47002,297,856
2Jul 23, 2022 08:5763,495390,169,848311,125,09102,293,760
3Jul 23, 2022 08:5763,507374,082,706311,185,42802,293,760
4Jul 23, 2022 08:5863,560390,037,682311,446,19502,297,856
5Jul 23, 2022 08:5864,415375,337,062315,632,17902,170,880
6Jul 23, 2022 08:5864,461338,521,602314,858,000999,0002,424,832
7Jul 23, 2022 08:5864,479337,544,460314,948,000999,0002,281,472
8Jul 23, 2022 08:5764,480337,995,434314,955,000999,0002,424,832
9Jul 23, 2022 08:5864,483336,446,802314,969,000999,0002,277,376
10Jul 23, 2022 08:5764,490340,081,323315,003,0001,000,0002,281,472
11Jul 23, 2022 08:5864,503338,453,189315,063,0001,000,0002,424,832
12Jul 23, 2022 08:5764,512341,977,211315,111,0001,000,0002,433,024
13Jul 23, 2022 08:5864,526340,831,586314,174,0002,001,0002,281,472
14Jul 23, 2022 08:5864,531340,119,549316,202,00002,281,472
15Jul 23, 2022 08:5864,536337,638,807315,224,0001,000,0002,428,928
16Jul 23, 2022 08:5764,536343,416,117316,225,00002,281,472
17Jul 23, 2022 08:5764,537337,917,817316,229,00002,433,024
18Jul 23, 2022 08:5764,540343,261,613315,244,0001,000,0002,281,472
19Jul 23, 2022 08:5764,551343,144,582315,302,000997,0002,281,472
20Jul 23, 2022 08:5764,699343,822,459316,026,0001,000,0002,424,832
21Jul 23, 2022 08:5864,834346,614,258316,687,000999,0002,428,928
22Jul 23, 2022 08:5764,842337,108,535315,729,0001,998,0002,424,832
23Jul 23, 2022 08:5865,117350,336,858318,075,0001,000,0002,281,472
24Jul 23, 2022 08:5866,800399,615,783327,321,01402,293,760