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 listSep 22, 2022 12:05Bernard TeoBernard TeoScore: 73,595Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Sep 22, 2022 12:0573,507384,249,783359,184,0001,000,0002,281,472
2Sep 22, 2022 12:2073,526387,683,646359,275,0001,000,0002,396,160
3Sep 22, 2022 12:0773,527385,206,553360,282,00002,281,472
4Sep 22, 2022 12:0773,529387,129,709359,290,0001,000,0002,281,472
5Sep 22, 2022 12:2073,533391,752,795360,311,00002,392,064
6Sep 22, 2022 12:0773,534383,332,539360,319,00002,396,160
7Sep 22, 2022 12:0573,543386,895,505359,360,0001,001,0002,392,064
8Sep 22, 2022 12:0773,545387,203,505358,375,0001,996,0002,281,472
9Sep 22, 2022 12:0573,548391,587,174359,385,0001,001,0002,387,968
10Sep 22, 2022 12:2073,550389,311,590358,400,0001,996,0002,281,472
11Sep 22, 2022 12:2073,550388,617,830358,397,0001,996,0002,281,472
12Sep 22, 2022 12:0673,558390,959,209359,431,0001,001,0002,400,256
13Sep 22, 2022 12:0673,560387,881,097360,446,00002,510,848
14Sep 22, 2022 12:0673,563386,639,121360,460,00002,396,160
15Sep 22, 2022 12:0773,578385,119,353358,536,0001,997,0002,396,160
16Sep 22, 2022 12:0773,580385,784,124358,545,0001,997,0002,281,472
17Sep 22, 2022 12:0773,589386,062,860359,587,000998,0002,404,352
18Sep 22, 2022 12:2073,590387,883,308359,594,000998,0002,277,376
19Sep 22, 2022 12:2073,592391,654,565359,602,000998,0002,387,968
20Sep 22, 2022 12:2073,592389,370,099359,603,000998,0002,400,256
21Sep 22, 2022 12:0673,593382,023,909358,609,0001,997,0002,392,064
22Sep 22, 2022 12:0673,595389,561,420359,617,000998,0002,281,472
23Sep 22, 2022 12:0673,595386,776,357359,617,000998,0002,281,472
24Sep 22, 2022 12:0573,595383,998,744359,617,000998,0002,396,160
25Sep 22, 2022 12:0673,595390,034,593359,616,000998,0002,396,160
26Sep 22, 2022 12:0573,596389,965,400359,620,000998,0002,396,160
27Sep 22, 2022 12:0573,596390,475,940358,622,0001,997,0002,404,352
28Sep 22, 2022 12:0573,597389,060,515359,626,000998,0002,281,472
29Sep 22, 2022 12:0773,598388,780,923359,633,000998,0002,392,064
30Sep 22, 2022 12:0573,599387,121,726358,640,0001,997,0002,281,472
31Sep 22, 2022 12:0573,602383,249,808359,650,000999,0002,281,472
32Sep 22, 2022 12:2073,602388,031,442359,653,000999,0002,281,472
33Sep 22, 2022 12:2073,602393,222,646358,652,0001,998,0002,281,472
34Sep 22, 2022 12:0773,612389,903,993359,700,000999,0002,412,544
35Sep 22, 2022 12:0673,619386,682,968359,732,000999,0002,404,352
36Sep 22, 2022 12:0673,622384,186,443358,752,0001,998,0002,281,472
37Sep 22, 2022 12:0573,781424,559,760361,524,55302,256,896
38Sep 22, 2022 12:0773,792428,803,091361,579,18702,269,184
39Sep 22, 2022 12:0773,798429,553,267361,610,75902,260,992
40Sep 22, 2022 12:2073,799424,049,077361,616,26002,265,088
41Sep 22, 2022 12:0773,800423,880,879361,620,99102,265,088
42Sep 22, 2022 12:2073,825431,078,889361,744,30302,273,280
43Sep 22, 2022 12:0673,825411,945,079361,743,40702,277,376
44Sep 22, 2022 12:2073,842430,944,494361,824,00802,273,280
45Sep 22, 2022 12:0573,865416,939,431361,936,66602,269,184
46Sep 22, 2022 12:0677,477450,819,808379,635,52402,265,088
47Sep 22, 2022 12:0577,490449,787,345379,701,33702,269,184
48Sep 22, 2022 12:0677,494462,015,979379,721,32102,260,992