#include <bits/stdc++.h>
using namespace std;
const int mx = 1e5+5;
int n;
long double a[mx], b[mx];
long double ans = 0;
int main() {
cin.tie(0);ios::sync_with_stdio(0);
cin >> n;
for (int i=0;i<n;i++) {
cin >> a[i] >> b[i];
}
sort(a, a+n); reverse(a, a+n);
sort(b, b+n); reverse(b, b+n);
long double sa = 0;
for (int i=0;i<n;i++) {
sa += a[i];
long double sb = 0;
for (int j=0;j<n;j++) {
sb += b[j];
ans = max(ans, min(sa - i - j - 2, sb - i - j - 2));
}
}
cout << fixed << setprecision(15) << ans << "\n";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
2396 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
2396 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
2396 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |