| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 89034 | luka1234 | Schools (IZhO13_school) | C++14 | 288 ms | 5344 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,x,y,mx1=0,mx2=0,s=1;
cin>>n>>x>>y;
pair<int,int> a[n],b[n];
for(int k=0;k<n;k++){
cin>>a[k].first;
cin>>a[k].second;
b[k].first=a[k].second;
b[k].second=a[k].first;
}
sort(a,a+n);
sort(b,b+n);
for(int k=0;k<x;k++){
mx1=mx1+a[n-s].first;
s++;
}
s=x+1;
for(int k=0;k<y;k++){
mx1=mx1+a[n-s].second;
}
s=1;
for(int k=0;k<y;k++){
mx2=mx2+b[n-s].first;
s++;
}
s=y+1;
for(int k=0;k<x;k++){
mx2=mx2+b[n-s].second;
}
cout<<max(mx1,mx2);
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
