In a two-dimensional array, each row is sorted in ascending order from left to right, and each column is sorted in ascending order from top to bottom. Complete a function, input a two-dimensional array and an integer to determine whether the array contains the integer. Input: the input may contain multiple test examples. For each test case, the first input behavior is two integers, m and n (1 <= m, n <= 1000 ): the number of rows and columns of the matrix to be input. The second line of the input contains an integer t (1 <= t <= 1000000): the number to be searched. In the next m row, each row has n numbers, representing the matrix of n columns in the m row given by the question (the matrix is shown in the description of the question, and each row is sorted in ascending order from left to right, each column is sorted in ascending order from top to bottom. Output: For each test case, "Yes" indicates that the number t is found in the two-dimensional array. The output "No" indicates that the number t is not found in the two-dimensional array. Sample input: 3 351 2 34 5 67 8 93 312 3 45 6 78 9 103 3122 3 45 6 78 9 10 sample output: YesNoNo code AC: idea: query X from the upper right corner. If the current number is greater than X, it moves to the left. If it is less than X, it moves down! [Cpp] # include <stdio. h> int main () {int mat [1000] [1000], I, j, m, n, t, flag; while (scanf ("% d ", & m, & n )! = EOF) {scanf ("% d", & t); for (I = 0; I <m; I ++) {for (j = 0; j <n; j ++) {scanf ("% d", & mat [I] [j]) ;}} I = 0; // top right vertex j = n-1; flag = 0; while (I <m & j> = 0) {if (mat [I] [j] <t) {I ++ ;} else if (mat [I] [j]> t) {j --;} else {flag = 1; break ;}} if (flag) {printf ("Yes \ n") ;}else {printf ("No \ n") ;}} return 0 ;}