Advertisement
SuperKirchik

12.05 3

May 12th, 2020
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <algorithm>
  4. #include <vector>
  5. using namespace std;
  6. int main() {
  7.     int n;
  8.     cin >> n;
  9.     int a[n][n];
  10.     for(int i = 0; i < n; i++){
  11.         for(int j = 0; j < n; j++){
  12.             cin >> a[i][j];
  13.         }
  14.     }
  15.     int ans = 1;
  16.     for(int i = 0; i < n; i++){
  17.         for(int j = 0; j < n; j++){
  18.             if(a[i][j] != a[j][i]){
  19.                     ans = 0;
  20.             }
  21.         }
  22.     }
  23.     if(ans ==0){
  24.         cout<< "no"<<endl;
  25.     }
  26.     if(ans == 1){
  27.         cout<<"yes"<<endl;
  28.     }
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement