Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- const int N = 19;
- char board[N + 1][N + 2];
- int mn[N + 1];
- int main(){
- int row, col;
- scanf("%d%d", &row, &col);
- for(int j = 1; j <= col; ++j){
- mn[j] = row + 1;
- }
- for(int i = 1; i <= row; ++i){
- for(int j = 1; j <= col; ++j){
- scanf(" %c", &board[i][j]);
- if(board[i][j] == 'O'){
- mn[j] = min(mn[j], i);
- }
- }
- }
- for(int j = 1; j <= col; ++j){
- int cnt;
- scanf("%d", &cnt);
- for(int i = mn[j] - 1; i >= mn[j] - cnt; --i){
- board[i][j] = '#';
- }
- }
- for(int i = 1; i <= row; ++i){
- for(int j = 1; j <= col; ++j){
- cout << board[i][j];
- }
- cout << '\n';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement