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;
int const N=505;
vector<int> arr[N];
vector<int> answer;
int main(){
int n,k,c;
cin>>n>>k>>c;
for(int i=0;i<n;i++)
for(int j=0;j<k;j++){
int a;
cin>>a;
arr[i].push_back(a);
}
for(int i=0;i<n;i++)
for(int j=i+1;j<n;j++){
int sm=0;
for(int t=0;t<k;t++)
sm+=max(arr[i][t],arr[j][t]);
answer.push_back(sm);
}
sort(answer.begin(),answer.end());
reverse(answer.begin(),answer.end());
cout<<answer[c-1]<<endl;
}
# | 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... |