Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. #include <iostream>
  2. #include <queue>
  3. using namespace std;
  4.  
  5. void matrix(int** arr, int rows, int columns) {
  6. for (int i = 1; i <= rows; i++) {
  7. for (int j = 1; j <= columns; j++) {
  8. arr[i][j] = 0;
  9. }
  10. }
  11. }
  12.  
  13. struct Apple {
  14. int row;
  15. int column;
  16. Apple(int row, int column) {
  17. this->row = row;
  18. this->column = column;
  19. }
  20. };
  21. int main() {
  22.  
  23. int rows;
  24. int columns;
  25. int days;
  26. cin >> rows >> columns >> days;
  27. int** schemeApples = new int*[rows + 1];
  28. for (int i = 0; i <= rows + 1; i++) {
  29. schemeApples[i] = new int[columns + 1];
  30. }
  31. matrix(schemeApples, rows, columns);
  32.  
  33. int numbeOfRotten = 0;
  34. queue<Apple> currentRotten;
  35. int rowOfRotten;
  36. int columnOfRotten;
  37. while (cin >> rowOfRotten >> columnOfRotten) {
  38. Apple* current = new Apple(rowOfRotten, columnOfRotten);
  39. currentRotten.push(*current);
  40. schemeApples[rowOfRotten][columnOfRotten] = 1;
  41. numbeOfRotten++;
  42. }
  43. while (!currentRotten.empty()) {
  44.  
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement