vector<vector<int>> ary(n, vector<int>(n));
int MIN = INT_MAX;
int MAX = INT_MIN;
for (i = 0; i < n; i++) {
minx = min(minx, (int)*min_element(ary[i].begin(), ary[i].end()));
maxx = man(maxx, (int)*max_element(ary[i].begin(), ary[i].end()));
if (*MIN > minx) {
*MIN = minx;
min_index= distance(ary[i].begin(), min_element(ary[i].begin(), ary[i].end()));
}
if (*MAX < maxx) {
*MAX = maxx;
max_index= distance(ary[i].begin(), max_element(ary[i].begin(), ary[i].end()));
}
}
More than 3 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme