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 3, 2022 04:13Bernard TeoBernard TeoScore: 60,286Success
Source Code

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

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Oct 3, 2022 04:2460,185319,164,846293,908,000999,0002,281,472
2Oct 3, 2022 04:0260,210319,322,275293,028,0002,000,0002,281,472
3Oct 3, 2022 04:0260,216315,773,141293,058,0002,000,0002,400,256
4Oct 3, 2022 04:2460,216320,166,948293,058,0002,000,0002,281,472
5Oct 3, 2022 04:2460,220326,066,845293,077,0002,000,0002,281,472
6Oct 3, 2022 04:0260,227316,997,310294,110,0001,000,0002,400,256
7Oct 3, 2022 04:2460,228327,699,468295,115,00002,281,472
8Oct 3, 2022 04:1360,232318,328,689294,139,0001,000,0002,478,080
9Oct 3, 2022 04:0260,234325,358,805294,145,0001,000,0002,281,472
10Oct 3, 2022 04:2460,239317,655,457295,171,00002,400,256
11Oct 3, 2022 04:1360,246324,512,157294,204,0001,000,0002,396,160
12Oct 3, 2022 04:0260,253323,608,529295,242,00002,404,352
13Oct 3, 2022 04:1360,254316,493,206294,244,0001,000,0002,281,472
14Oct 3, 2022 04:1360,258320,195,140295,265,00002,510,848
15Oct 3, 2022 04:0260,262315,612,078294,284,0001,000,0002,281,472
16Oct 3, 2022 04:2460,283322,890,888295,386,00002,281,472
17Oct 3, 2022 04:1360,284323,289,664295,390,00002,281,472
18Oct 3, 2022 04:0260,285326,030,675295,396,00002,281,472
19Oct 3, 2022 04:2460,286320,285,740295,401,00002,281,472
20Oct 3, 2022 04:0260,288321,963,997294,409,0001,001,0002,400,256
21Oct 3, 2022 04:0260,293319,325,642294,437,0001,001,0002,482,176
22Oct 3, 2022 04:2460,318324,833,942294,559,000998,0002,482,176
23Oct 3, 2022 04:1360,326321,303,180294,601,000998,0002,404,352
24Oct 3, 2022 04:2460,328322,751,348294,609,000998,0002,281,472
25Oct 3, 2022 04:1360,334318,645,622294,639,000998,0002,281,472
26Oct 3, 2022 04:1360,387321,001,979294,896,000999,0002,281,472
27Oct 3, 2022 04:1360,396317,388,932293,939,0001,999,0002,396,160
28Oct 3, 2022 04:0260,559354,939,067296,737,11402,265,088
29Oct 3, 2022 04:1360,573357,688,416296,807,32002,273,280
30Oct 3, 2022 04:2460,576362,567,831296,821,63002,273,280
31Oct 3, 2022 04:0260,577363,382,782296,826,73902,265,088
32Oct 3, 2022 04:2460,587353,284,905296,875,20802,260,992
33Oct 3, 2022 04:1360,601356,736,244296,947,33902,265,088
34Oct 3, 2022 04:1360,616371,580,806297,018,25302,269,184
35Oct 3, 2022 04:2461,619358,476,383301,933,58702,265,088
36Oct 3, 2022 04:0261,636381,032,816302,017,81002,269,184