Correct and detailed answer will upvoted else downvoted. You have gotten information from a Bubble bot. You realize your assignment is to make plant offices, however before you even beginning, you need to realize how huge the production line is and the number of rooms it has. At the point when you check out the information you see that you have the elements of the development, which is fit as a fiddle: N x M. Then, at that point, in the
Correct and detailed answer will upvoted else downvoted.
You have gotten information from a Bubble bot. You realize your assignment is to make plant offices, however before you even beginning, you need to realize how huge the production line is and the number of rooms it has. At the point when you check out the information you see that you have the elements of the development, which is fit as a fiddle: N x M.
Then, at that point, in the following N lines you have M numbers. These numbers address processing plant tiles and they can go from 0 to 15. Every one of these numbers ought to be examined its paired structure. Since from each number you know on which side the tile has dividers. For instance number 10 in it's twofold structure is 1010, which implies that it has a divider from the North side, it doesn't have a divider from the East, it has a divider on the South side and it doesn't have a divider on the West side. So it goes North, East, South, West. It is ensured that the development consistently has dividers on it's edges. The input will be right.
Your assignment is to print the size of the rooms from greatest to littlest.
Input : The primary line has two numbers which are N and M, the size of the development. Both are integers: n (1≤n≤103) m (1≤m≤103) Next N x M numbers address each tile of development.
Output :When you wrap up preparing the information your output comprises of one line arranged from greatest to littlest room sizes.
Step by step
Solved in 4 steps with 1 images