#include #include using namespace std; /*void printPole( int sizeX, int sizeY,bool playground[][]) { for (int y = 0; y < sizeY; y++) { for (int x = 0; x < sizeX; x++) { if(playground[x][y]) cout << '*'; else cout << '.'; } cout << "\n"; } }*/ int main() { int sizeX, sizeY; int timeCount; string temp; int countFlakes = 0; cin >> sizeX; cin >> sizeY; cin >> timeCount; int tCounts[timeCount] = {0}; bool playground[sizeX][sizeY] = {0}; for (int x = 0; x < sizeX; x++) { temp = {0}; cin >> temp; //cout << temp << "\n"; for (int y = 0; y < sizeY; y++) { if(temp[y] == '*') {playground[x][y] = true; }else playground[x][y] = false; } } for(int i = 0; i < timeCount; i++) { cin >> tCounts[i]; } for (int k = 0; k <= tCounts[timeCount-1]; k++) { //check countFlakes = 0; for (int y = sizeY-1; y >= 0; y--) { for (int x = sizeX-1; x >= 0; x--) { if(playground[x][y]) { countFlakes++; } else break; } } for (int m = 0; m < timeCount; m++) { if(tCounts[m] == k) { cout << countFlakes << "\n"; } } //posun for (int x = sizeX-1; x >= 0; x--) { for (int y = sizeY-1; y >= 0; y--) { if(playground[x][y] && (x != sizeX-1 && playground[x+1][y] != true)) { //goes down playground[x][y] = false; playground[x+1][y] = true; } } } } return 0; }