# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
649561 | Ghosty_v2 | Quality Of Living (IOI10_quality) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int r,c,h,w;
cin>>r>>c>>h>>w;
int arr[r][c];
for(int i=0;i<r;i++) {
for(int j=0;j<c;j++) {
int a;
cin>>a;
arr[i][j] = a;
}
}
int ans = INT_MAX;
for(int i=0;i<r;i++) {
vector <int> subvec
for(int j=0;j<c;j++) {
subvec.push_back(arr[i][j]);
}
sort(subvec.begin(),subvec.end());
ans= min(ans,subvec[(r*c)/2]);
}
cout<<ans<<endl;
return 0;
}