# |
Author |
Problem |
Lang |
Verdict |
Time |
Memory |
Sent |
Judged |
|
154381394 |
Out of competition:
* Niko919 |
1669G
- 12
|
C++20 (GCC 11-64)
|
Skipped
|
15 ms
|
24 KB
|
2022-04-21 18:42:27 |
2022-04-22 09:07:09 |
|
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl "\n"
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int t; cin >> t;
for (int k = 0; k < t; ++k) {
ll n, m; cin >> n >> m;
vector <vector<char>> a(n, vector <char> (m));
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
cin >> a[i][j];
}
}
for (int i = 0; i < m; ++i) {
ll cnt = 0;
for (int j = 0; j < n; ++j) {
if (a[j][i] == '*'){
cnt++;
a[j][i] = '.';
}
else if (a[j][i] == 'o'){
ll c = j - 1;
while (cnt > 0){
a[c][i] = '*';
c--;
cnt--;
}
}
if (j == n - 1){
ll c = j;
while (cnt > 0){
a[c][i] = '*';
c--;
cnt--;
}
}
}
}
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
cout << a[i][j];
}
cout << endl;
}
cout << endl;
}
return 0;
}
Click to see test details