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 listNov 2, 2022 00:36Bernard TeoBernard TeoScore: 47,266Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Nov 2, 2022 00:3647,123253,223,040228,906,0001,999,0002,281,472
2Nov 2, 2022 00:3647,135254,076,911229,963,000999,0002,281,472
3Nov 2, 2022 00:3647,148252,845,326229,026,0002,000,0002,281,472
4Nov 2, 2022 00:3647,148253,254,534229,025,0002,000,0002,392,064
5Nov 2, 2022 00:3647,174258,374,936230,152,0001,000,0002,281,472
6Nov 2, 2022 00:3647,178255,298,702230,172,0001,000,0002,281,472
7Nov 2, 2022 00:3647,191255,109,438231,234,00002,281,472
8Nov 2, 2022 00:3647,192264,836,562230,240,0001,001,0002,281,472
9Nov 2, 2022 00:3647,202253,524,531231,290,00002,281,472
10Nov 2, 2022 00:3647,215258,098,705231,355,00002,281,472
11Nov 2, 2022 00:3647,215257,136,691230,352,0001,001,0002,281,472
12Nov 2, 2022 00:3647,266255,232,068230,605,000998,0002,392,064
13Nov 2, 2022 00:3647,266266,708,767230,607,000998,0002,281,472
14Nov 2, 2022 00:3647,267256,815,443230,608,000998,0002,281,472
15Nov 2, 2022 00:3647,267261,590,150231,609,00002,281,472
16Nov 2, 2022 00:3647,290252,745,281229,726,0001,997,0002,392,064
17Nov 2, 2022 00:3647,304253,310,618230,792,000999,0002,506,752
18Nov 2, 2022 00:3647,340260,330,026231,964,00002,281,472
19Nov 2, 2022 00:3647,933303,150,928234,872,69502,265,088
20Nov 2, 2022 00:3647,952308,257,570234,966,95102,269,184
21Nov 2, 2022 00:3647,971306,897,786235,056,36102,269,184
22Nov 2, 2022 00:3647,978299,066,824235,091,46302,269,184
23Nov 2, 2022 00:3647,997301,471,060235,184,70702,269,184
24Nov 2, 2022 00:3650,229302,382,781246,124,27302,256,896