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:50Bernard TeoBernard TeoScore: 59,838Success
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:5058,415345,228,996286,232,54902,265,088
2Oct 4, 2022 03:5158,421335,973,542286,264,00802,265,088
3Oct 4, 2022 03:5058,428342,016,756286,297,92902,269,184
4Oct 4, 2022 03:5058,443354,661,254286,368,31802,265,088
5Oct 4, 2022 03:5058,452346,420,239286,416,18502,277,376
6Oct 4, 2022 03:5158,459350,067,703286,446,88402,273,280
7Oct 4, 2022 03:5058,461356,696,183286,456,96102,260,992
8Oct 4, 2022 03:5058,465345,239,972286,479,86102,273,280
9Oct 4, 2022 03:5058,480344,530,129286,551,10502,277,376
10Oct 4, 2022 03:5158,495343,443,461286,625,73402,269,184
11Oct 4, 2022 03:5058,539343,920,460286,840,90402,265,088
12Oct 4, 2022 03:5059,526317,555,933290,678,000998,0002,281,472
13Oct 4, 2022 03:5059,680315,525,824291,431,0001,001,0002,396,160
14Oct 4, 2022 03:5059,733315,078,214290,696,0001,997,0002,408,448
15Oct 4, 2022 03:5059,781315,840,894291,928,000999,0002,396,160
16Oct 4, 2022 03:5059,792321,039,549291,982,000999,0002,387,968
17Oct 4, 2022 03:5059,792318,614,873290,980,0001,999,0002,281,472
18Oct 4, 2022 03:5059,793314,724,919291,988,000999,0002,400,256
19Oct 4, 2022 03:5059,800315,580,164291,019,0002,000,0002,387,968
20Oct 4, 2022 03:5159,806316,498,423291,047,0002,000,0002,400,256
21Oct 4, 2022 03:5059,807316,693,463292,053,0001,000,0002,281,472
22Oct 4, 2022 03:5059,812316,076,604292,079,0001,000,0002,404,352
23Oct 4, 2022 03:5059,821315,350,898291,121,0002,000,0002,281,472
24Oct 4, 2022 03:5059,824314,693,072292,138,0001,000,0002,281,472
25Oct 4, 2022 03:5159,838315,340,533292,206,0001,000,0002,281,472
26Oct 4, 2022 03:5159,840318,080,045292,218,0001,000,0002,478,080
27Oct 4, 2022 03:5059,844319,241,257293,235,00002,281,472
28Oct 4, 2022 03:5159,845310,350,932293,239,00002,281,472
29Oct 4, 2022 03:5059,848324,262,727293,255,00002,281,472
30Oct 4, 2022 03:5059,856312,561,925292,293,0001,001,0002,396,160
31Oct 4, 2022 03:5159,860315,735,254291,321,0001,995,0002,396,160
32Oct 4, 2022 03:5159,861316,604,140292,319,0001,001,0002,281,472
33Oct 4, 2022 03:5059,862316,455,557293,322,00002,277,376
34Oct 4, 2022 03:5059,869322,759,917291,362,0001,995,0002,400,256
35Oct 4, 2022 03:5059,879318,703,836292,404,0001,001,0002,404,352
36Oct 4, 2022 03:5059,885320,987,354292,434,0001,001,0002,281,472
37Oct 4, 2022 03:5059,890319,559,715292,461,0001,001,0002,519,040
38Oct 4, 2022 03:5059,893322,827,394291,481,0001,996,0002,404,352
39Oct 4, 2022 03:5059,911319,239,578292,564,000998,0002,400,256
40Oct 4, 2022 03:5059,919323,910,224291,605,0001,997,0002,281,472
41Oct 4, 2022 03:5159,929315,690,566291,657,0001,997,0002,396,160
42Oct 4, 2022 03:5059,931316,356,289291,667,0001,997,0002,400,256
43Oct 4, 2022 03:5159,932316,034,121292,668,000998,0002,400,256
44Oct 4, 2022 03:5059,938322,794,887292,696,000998,0002,281,472
45Oct 4, 2022 03:5059,946315,333,910291,735,0001,998,0002,400,256
46Oct 4, 2022 03:5059,983317,272,692291,920,0001,999,0002,281,472
47Oct 4, 2022 03:5159,997316,691,173291,987,0001,999,0002,400,256
48Oct 4, 2022 03:5062,078379,073,406304,182,84202,273,280