Editing
2018 Dec Silver Problem 3 Mooyo Mooyo
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Problem == The problem presents a 2D game grid which is N x 10 (Nβ€100) squares, each square either contains a cow or is empty. Adjacent squares sharing an edge (not only a corner) with the same number are part of the same component. If a component contains at least K squares (Kβ€N), it's removed from the grid, and all cows above it in the same column fall down to take the places of the cows in the removed component, potentially forming new components. This process continues until no component contains K or more squares. The task is to simulate this process and output the final state of the board. === Input === The first line of input contains two integers N and K (1β€Nβ€100). The next N lines contain 10 digits each, specifying the initial state of the grid. === Output === The output should be N lines, each containing 10 digits, showing the final state of the game board.
Summary:
Please note that all contributions to Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
My wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information