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 listOct 4, 2022 03:54Bernard TeoBernard TeoScore: 59,357Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 4, 2022 03:5458,468348,065,650286,490,96802,273,280
2Oct 4, 2022 03:5458,510354,194,350286,697,90302,269,184
3Oct 4, 2022 03:2758,535354,308,908286,821,84602,265,088
4Oct 4, 2022 03:2758,639349,104,571287,330,67102,256,896
5Oct 4, 2022 03:5459,269318,852,788290,418,00002,281,472
6Oct 4, 2022 03:2759,313316,881,516288,638,0001,997,0002,404,352
7Oct 4, 2022 03:2759,318318,140,286289,662,000998,0002,396,160
8Oct 4, 2022 03:5459,319320,474,976288,666,0001,997,0002,281,472
9Oct 4, 2022 03:5459,320317,046,532289,669,000998,0002,400,256
10Oct 4, 2022 03:5459,330313,119,167289,718,000999,0002,400,256
11Oct 4, 2022 03:2759,330312,747,659288,720,0001,998,0002,396,160
12Oct 4, 2022 03:2759,340317,741,518288,770,0001,998,0002,281,472
13Oct 4, 2022 03:2759,357312,010,103288,853,0001,998,0002,510,848
14Oct 4, 2022 03:2759,373313,176,673288,927,0001,999,0002,392,064
15Oct 4, 2022 03:5459,402317,854,861289,070,0002,000,0002,281,472
16Oct 4, 2022 03:5459,405318,442,922289,084,0002,000,0002,392,064
17Oct 4, 2022 03:5459,406313,247,391290,087,0001,000,0002,404,352
18Oct 4, 2022 03:2759,410317,667,976289,107,0002,000,0002,404,352
19Oct 4, 2022 03:2759,416320,333,378291,136,00002,400,256
20Oct 4, 2022 03:5459,442316,812,954290,264,0001,000,0002,281,472
21Oct 4, 2022 03:5459,447320,631,650290,293,000997,0002,281,472
22Oct 4, 2022 03:2759,469320,287,763291,399,00002,404,352
23Oct 4, 2022 03:5461,730364,981,683302,476,45402,273,280
24Oct 4, 2022 03:2761,819364,830,165302,913,33402,273,280