///~~~LOTA~~~///
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define append push_back
#define add insert
#define nl '\n'
#define ff first
#define ss second
#define panic break
#define pii pair<int,int>
#define pic pair<int,char>
#define all(x) (x).begin(),(x).end()
#define sum(a) accumulate(all(a),0)
#define L0TA ios_base::sync_with_stdio(false);cin.tie(NULL)
#define terminator main
#define N 2001
ld prex[N];
ld prey[N];
void solve(){
int n;
ld o,p,q;
cin>>n;
vector<ld> x,y;
for(int i=o=0;i<n;i++){
cin>>p>>q;
x.append(p);
y.append(q);
}
sort(all(x));
sort(all(y));
for(int i=0;i<N;i++)
prex[i]=prey[i]=0;
for(int i=n-1;i>=0;i--){
prex[n-i]=prex[n-i-1]+x[i];
prey[n-i]=prey[n-i-1]+y[i];
}
for(int i=1;i<=2*n;i++)
for(int j=0;j<=i;j++)
o=max(o,min(prex[j],prey[i-j])-i);
cout<<o;
}
int terminator(){
L0TA;
solve();
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |