poj 2941 Homogeneous Squares

poj 2941 Homogeneous Squares,第1张

poj 2941 Homogeneous Squares
#include <cstdlib>  #include <cctype>  #include <cstring>  #include <cstdio>  #include <cmath>  #include <algorithm>  #include <vector>  #include <string>  #include <iostream>  #include <sstream>  #include <map>  #include <set>  #include <queue>  #include <stack>  #include <fstream>  #include <numeric>  #include <iomanip>  #include <bitset>  #include <list>  #include <stdexcept>  #include <functional>  #include <utility>  #include <ctime>using namespace std;typedef long long LL;typedef unsigned long long ULL;#define MAX(a,b) ((a) > (b) ? (a) : (b))#define MIN(a,b) ((a) < (b) ? (a) : (b))#define MEM(a,b) memset((a),(b),sizeof(a))const LL INF = 1000000007;const int N = 1e3+10;const double eps = 1e-12;int a[N][N];int main(){int n;while (scanf("%d", &n) != EOF){if (n == 0) break;int flag = 1;for (int i = 0; i < n; i++){for (int j = 0; j < n; j++){scanf("%d", &a[i][j]);}}for (int i = 0; i < n; i++){for (int j = i + 1; j < n; j++){if (a[i][i] + a[j][j] != a[i][j] + a[j][i]){flag = 0;break;}}if (flag == 0) break;}if (flag) puts("homogeneous");else puts("not homogeneous");}return 0;}

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/4897853.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-11-12
下一篇2022-11-12

发表评论

登录后才能评论

评论列表(0条)

    保存