HTTPS GATEIO ACTIVE 1564632 7A4E6164C05C1DD0B67C8BB749B8905C
#include <iostream>
#include <cstring>
using namespace std;
int main() {
int n, m, a[20][20] = {0}, cnt = 0;
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++) {
int min = 999999999;
for(int k=1; k<=m; k++){
if(a[i][k] < min){
min = a[i][k];
}
}
int max = 0;
for(int k=1; k<=n; k++){
if(a[k][j]>max){
max = a[k][j];
}
}
if(a[i][j] == min && a[i][j]==max){
cnt++;
cout << i << " " << j << " "<< a[i][j] << endl; }
}
}
if(cnt == 0) cout << "not exist";
return 0;
}
GATE.IO HUMAN |