# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
957615 | ezzzay | Olympiads (BOI19_olympiads) | C++14 | 3 ms | 8540 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 int long long
#define ff first
#define ss second
#define pb push_back
const int N=2e3+4;
int a[N][N];
signed main(){
int n,k,c;
cin>>n>>k>>c;
vector<int>vc;
for(int i=1;i<=n;i++){
for(int j=1;j<=k;j++){
cin>>a[i][j];
}
}
int s=0;
for(int i=1;i<=n;i++){
int tmp[N];
for(int l=0;l<=k;l++)tmp[l]=0;
for(int l=0;l<=n;l++){
if(i==l)continue;
for(int j=1;j<=k;j++){
tmp[j]=max(tmp[j],a[l][j]);
}
}
int h=0;
for(int j=1;j<=k;j++)h+=tmp[j];
vc.pb(h);
}
sort(vc.begin(),vc.end(), greater<int>());
cout<<vc[k-1];
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |