SHARE
TWEET

№5

a guest Oct 15th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2. #include <stdio.h>
  3. #define REP(var, start, end) for(int var = start; var < end; var++)
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.   int n;
  9.   bool isSymmetrical = true;
  10.  
  11.   scanf("%d", &n);
  12.   int array[n][n];
  13.  
  14.   //fill
  15.   REP(x, 0, n)
  16.   {
  17.     REP(y, 0, n)
  18.     {
  19.       scanf("%d ", &array[x][y]);
  20.     }
  21.   }
  22.  
  23. REP(x, 0, n)
  24.   {
  25.     REP(y, 0, n)
  26.     {
  27.         if (x-y == 0 ) continue;
  28.  
  29.         if(array[x][y] != array[y][x])
  30.         {
  31.             printf("NO");
  32.             return 0;
  33.         }
  34.     }
  35.  
  36.   }
  37.  
  38.   printf("YES");
  39.  
  40.  
  41.   return 0;
  42. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top