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