Как мне решить эту проблему? Плохо быть признательны и благодарны всем, кто помогает мне
Shreyas is coming back to his apartment after a party. Unfortunately it’s dark outside and he’s unable to see his way back very clearly. The way back to his apartment goes by an open lake beside an open ground. This means the darkness could very easily throw him off track, causing him to fall into the lake. Help him find the shores of the lake so that he doesn’t fall into it. Fortunately, points on the ground and on the lake can be differentiated on the basis of their hue, a value that represents the shade of the colour of a pixel. The hue value describes where the colour of the pixel lies on a rainbow-like colour spectrum. A hue value of 0 represents violet and a hue value of 255 represents red. Given a matrix M representing the hue of the area from a satellite image, where the ground areas and lake areas would fall into a different range of hues, output a matrix P with the shores of the lake marked with 1 and non shore areas marked with 0. The input matrix may also contain hues related to vegetation and other small objects. These must not be marked in the output. NOTE: All test cases will appear to be passed as long as an output of the correct dimensions is submitted. We're using a custom checker, so please check your score after every submission to see how your algorithm performed. Input Format The first line contains two integers P and Q representing the number of rows and columns in the matrix. The next P lines contain a row of Q integers each, representing the hue of the point at that position. Constraints P, Q < 1000 Output Format A matrix of size P x Q, where every point is marked either 1 or 0 depending on whether or not the current point is a shore or not. Sample Input 0 10 10 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 67 138 138 138 67 67 67 67 67 138 138 138 138 138 67 67 67 67 67 138 138 138 138 138 67 67 67 67 67 135 127 137 138 138 67 67 67 67 67 67 67 135 138 138 67 67 67 67 67 67 67 137 138 138 67 67 67 67 67 67 126 138 138 138 67 67 67 67 67 138 138 138 138 138 67 67 67 67 138 138 138 138 138 138 Sample Output 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 Explanation 0 The left side of the matrix are filled with hue values much lower than the ones on the right side. Since higher values of hue represent redder areas, the right side would be the ground and the left side the lake. Hence the above output is obtained when the hue values significantly drop from right to left
Что я уже пробовал:
Я не знаю, как это осуществить .
MadMyche
Купите фонарик