文章
43
粉丝
180
获赞
21
访问
195.4k
#include <iostream>
using namespace std;
const int N = 15;
int n, m, cnt, a[N][N];
void check(int x, int y)
{
int t = a[x][y];
int mx = 0, mn = 0x3f3f3f3f;
for (int i = 1; i <= n ; i ++ ) mn = min(mn, a[i][y]);
for (int i = 1; i <= m ; i ++ ) mx = max(mx, a[x][i]);
if (t == mn && t == mx)
{
cout << x << ' ' << y << ' ' << a[x][y] << endl;
cnt ++;
}
}
int main()
{
cin >> n >> m;
for (int i = 1; i <= n ; i ++ )
for (int j = 1; j <= m ; j ++ )
cin >> a[i][j];
for (int i = 1; i <= n ; i ++ )
for (int j = 1; j <= m ; j ++ )
check(i, j);
if (!cnt) puts("NO");
return 0;
}
登录后发布评论
暂无评论,来抢沙发