fork download
  1. /*
  2. Task: Problem 7.07
  3. Date: Dec 24, 2020
  4. Author: aLittleLove (Minh Vu)
  5. */
  6.  
  7. #include<bits/stdc++.h>
  8.  
  9. using namespace std;
  10. const int N = 2e3 + 5;
  11.  
  12. double a[N][N];
  13.  
  14. int main()
  15. {
  16. ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  17. //freopen("input.txt","r",stdin);
  18. int n; cin >> n >> n;
  19. for (int i=0; i<n; i++)
  20. for (int j=0; j<n; j++)
  21. cin >> a[i][j];
  22.  
  23. for (int i=0; i<n; i++)
  24. for (int j=0; j<n; j++)
  25. if (a[i][j]!=a[j][i])
  26. {
  27. cout << "No";
  28. return 0;
  29. }
  30. cout << "Yes";
  31. return 0;
  32. }
Success #stdin #stdout 0s 4944KB
stdin
3 3
1 0 1
0 2 0
1 0 0.0
stdout
Yes