Moderator: Board moderators
1 6 7 1
7 2 3 1
1 3 2 7
1 5 4 1
1 4 5 1
7 2 3 1
1 3 2 7
1 5 4 1
thanx, luishhh and sclo! got AC
int m[110][110]; long long m[110][110]; armansuleimenov wrote:Oh, I see: [-2^32 ... 2^32] doesn't fit signed 32-bit integer ([-2^32...2^31-1]), I overlooked that. However I still get WA.
I changed this
- Code: Select all
int m[110][110];
to this
- Code: Select all
long long m[110][110];
That is the only I change I need to do to use 64-bit integers.
#include <iostream>
using namespace std;
int main() {
long long M[110][110];
int T;
cin >> T;
for(int cas = 1; cas <= T; cas++) {
char a, b;
int N;
cin >> a >> b >> N;
if(N <= 0)
continue;
for(int i = 0; i < N; i++)
for(int j = 0; j < N; j++)
cin >> M[i][j];
bool sim = true;
for(int i = 0; i < N; i++) {
for(int j = 0; j < N; j++) {
if(M[i][j] != M[N-1-i][N-1-j])
sim = false;
}
}
cout << "Test #" << cas << ": ";
if(sim)
cout << "Symmetric." << endl;
else
cout << "Non-symmetric." << endl;
}
}
Users browsing this forum: No registered users and 1 guest