Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- ifstream fin;
- ofstream fout;
- fin.open("input.txt");
- fout.open("output.txt");
- int points;
- fin >> points;
- int** arr = new int* [points];
- for (int i = 0; i < points; i++)
- {
- arr[i] = new int[points];
- }
- for (int i = 0; i < points; i++)
- {
- for (int j = 0; j < points; j++)
- {
- fin >> arr[i][j];
- }
- }
- for (int i = 0; i < points; i++)
- {
- for (int j = 0; j < points; j++)
- {
- if (arr[i][j] != arr[j][i])
- {
- fout << "NO";
- return -1;
- }
- if (i == j && arr[i][j] == 1)
- {
- fout << "NO";
- return -2;
- }
- }
- }
- fout << "YES";
- fin.close();
- fout.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement