Number of dominant values Time Limit: 1000 ms Memory limit: 65536 K any questions? Click Here ^_^ The question description is known to be an integer array of f [] and g []. The elements are sorted in ascending order. Please write a program, calculate the logarithm of f [] greater than the element in g. In other words, f [0] is bigger than how many elements in g [], and f [1] is bigger than how many elements in g []. The sum of these values is the answer.
For example, if f [] contains 1, 3, 5, 7, 9, and g [] contains 2, 3, 4, 7, and 8.
So:
F [0] is smaller than all elements in g;
F [1] is larger than g [0;
F [2] is larger than g [0], g [1], and g [2;
F [3] is larger than g [0], g [1], and g [2;
F [4] is larger than g [0], g [1], g [2], g [3], and g [4;
So the answer is 0 + 1 + 3 + 3 + 5 = 12. Enter the first two integers, m, n (1 ≤ m, n ≤ 1000), representing the length of the array f [], g [], respectively.
The second row has m elements, which are arrays f [].
The third row has n elements, which are array g []. Output output control value. Sample Input
5 51 3 5 7 92 3 4 7 8
# Include
Void main ()
{
Int a [1000], B [1000], m, n, I, j, p = 0;
Scanf ("% d", & m, & n );
For (I = 0; I {
Scanf ("% d", & a [I]);
}
For (j = 0; j {
Scanf ("% d", & B [j]);
}
For (I = 0; I {
For (j = 0; j If (a [I]> B [j])
P ++;
}
Printf ("% d \ n", p );
}