fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int MAX_SIZE = 10;
  5.  
  6. int main() {
  7. int size;
  8. cin >> size;
  9. int strictlyAscending = 1;
  10. for (int line = 1; line <= size; ++line) {
  11. for (int col = 1; col <= size; ++col) {
  12. int mt[MAX_SIZE +1][MAX_SIZE + 1];
  13. cin >> mt[line][col];
  14. if (line > 1 && line == col && mt[line][col] <= mt[line - 1][col - 1]) {
  15. strictlyAscending = 0;
  16. }
  17. }
  18. }
  19. if (strictlyAscending) {
  20. cout << "DA";
  21. } else {
  22. cout << "NU";
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0.01s 5288KB
stdin
3
1 5 5
4 2 6
1 1 3
stdout
DA