#include <bits/stdc++.h>
using namespace std;
int a[1010][1010],n;
bool sovp(int x) {
for (int i = 1; i <= n; i++)
if (a[x][i] != a[i][x]) return 0;
return 1;
}
main () {
cin >>n;
for (int j = 1; j <= n; j++)
cin >>a[i][j];
{
if (sovp(i) == 1) cout <<i <<" ";
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <bits/stdc++.h>
using namespace std;
int a[1010][1010],n;
bool sovp(int x) {
for (int i = 1; i <= n; i++)
if (a[x][i] != a[i][x]) return 0;
return 1;
}
main () {
cin >>n;
for (int i = 1; i <= n; i++)
for (int j = 1; j <= n; j++)
cin >>a[i][j];
for (int i = 1; i <= n; i++)
{
if (sovp(i) == 1) cout <<i <<" ";
}
}