-
This is a very rubbing of AC in the past** I don't know if it can help you.
#include
int main()
int i,j,n,m,t,a,k,count,flag;
double sum1;
double p[51][6],a1[6],a2[51];
t=0;k=0;count=0;
for(i=0;ifor(j=0;jscanf("%lf",&p[i][j]);
for(j=0;jsum1=0;
for(i=0;isum1+=p[i][j];
a1[k++]=sum1/n;}
for(i=0;isum1=0;
for(j=0;jsum1+=p[i][j];
a2[t++]=sum1/m;}
for(i=0;iflag=1;a=0;
for(j=0;jif(p[i][j]if(flag) count++;
for(i=0;iprintf("%",a2[i],32);
printf("%",a2[n-1]);
for(j=0;jprintf("%",a1[j],32);
printf("%",a1[m-1]);
printf("%d",count);
printf("");}
-
Now that we know the starting point m and the end point n, we now need to find a general rule to get m to n as soon as possible.
As you can see from the graph, suppose a starting point is at the top of a triangle, such as 1, 2, 4, 5, 7, 9, etc
Then the distance from it to the point of a certain layer below it is the same, such as 1 to 2 and 1 to 4. For example, 2 to 10 and 2 to 12 and 2 to 14. Wait a minute.
According to this law, we can imagine that if n is below a triangle with m as the vertex, then just find out how many layers are in between, and the problem is solved.
If m is not the vertex of the triangle, we can find the smallest triangle where m is located, e.g. 6 is 2, 8 is 4, 13 is 7...
How to tell if it is below a certain point, we know the value of the end point n first, and we can calculate the number of layers it is in.
Then we know the difference in the number of layers between m and n, and we can calculate the left and right boundaries of the vertices, and how to judge it.
If you are there, the pattern is easy to find. If not, find the nearest boundary point n in the left and right boundaries and calculate the difference value, which is the extra number of steps, plus the number of steps to this layer.
If you want to find a pattern, assuming that the vertex f(x) is in layer x, then the right boundary of it to the next layer x+1 layer is f(x)+2*x-1 and the left boundary is f(x)+2x+1, and so on, and the number of steps from vertex to boundary is added by 2 every other layer.
Of course, you can also find generic expressions, and I won't do that.
Pure hand-playing, may not be clearly expressed, can be together**.
-
On that ** you want to output the shortest channel, the example is 6 12
That is to say, 6-》7-》13-》12, channel 3 or 6-》5-》11-》12, channel is also 3
-
2031 Base Conversion:
Idea: Recursive algorithm. Instance Analysis:
Get (746)10 = (1352)8
From this, it is only necessary to see that the quotient of the number to r is constantly rounded, and the result is put into the stack, and the elements in the stack are output, and it is OK!! ^
2032 Yang Hui Triangle:
1. Each number is equal to the sum of the two numbers above it.
2. The numbers in each row are symmetrical from left to right, starting from 1 and gradually becoming larger.
3. The number in line n has n items.
4. The sum of digits in line nth is 2 n-1.
5. The mth number of the nth row and the n-m+1 number are equal, that is, c(n-1, m-1) = c(n-1, n-m) (the nature of the combination number.
6. Each number is equal to the sum of the left and right numbers of the previous row. The entire Yang Hui Triangle can be written with this property. That is, the ith number of the n+1 row is equal to the sum of the i-1 number and the ith number of the nth row, which is also one of the properties of the combined number.
i.e. c(n+1,m)=c(n,m)+c(n,m-1). Reference.
Agree with the statement upstairs, the first floor is obviously not Hangzhou Electric's, Hangzhou TV University? I haven't heard of it, maybe it's affiliated with Hangzhou Electric? Hehe. >>>More
Type 1 - **.
It is subdivided from the e-commerce market, and because it mainly operates local life services, and the model is becoming more and more mature and stable, it is considered to be a representative model of O2O. **The industry has basically covered all aspects of the local life service market, which can be mainly divided into three categories: catering, service and entertainment; >>>More
The difference between the attack power of electric magic is too large and unstable, so it is not recommended that you add it. >>>More
From the Know Certification Team 2018-03-31
1. Generally, the Bluetooth headset itself does not have a power display function, and if you make another display in the case of a small size and limited power storage, it will inevitably lead to a shorter single use time of the earphone. >>>More
I don't know if you're right.
O2O e-commerce noun). >>>More