Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <queue>
- using namespace std;
- void matrix(int** arr, int rows, int columns) {
- for (int i = 1; i <= rows; i++) {
- for (int j = 1; j <= columns; j++) {
- arr[i][j] = 0;
- }
- }
- }
- struct Apple {
- int row;
- int column;
- Apple(int row, int column) {
- this->row = row;
- this->column = column;
- }
- };
- int main() {
- int rows;
- int columns;
- int days;
- cin >> rows >> columns >> days;
- int** schemeApples = new int*[rows + 1];
- for (int i = 0; i <= rows + 1; i++) {
- schemeApples[i] = new int[columns + 1];
- }
- matrix(schemeApples, rows, columns);
- int numbeOfRotten = 0;
- queue<Apple> currentRotten;
- int rowOfRotten;
- int columnOfRotten;
- while (cin >> rowOfRotten >> columnOfRotten) {
- Apple* current = new Apple(rowOfRotten, columnOfRotten);
- currentRotten.push(*current);
- schemeApples[rowOfRotten][columnOfRotten] = 1;
- numbeOfRotten++;
- }
- while (!currentRotten.empty()) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement