Submission #954475

# Submission time Handle Problem Language Result Execution time Memory
954475 2024-03-28T03:02:56 Z mocha Sure Bet (CEOI17_sure) C++14
0 / 100
1 ms 2396 KB
#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";
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2396 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2396 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2396 KB Output isn't correct
2 Halted 0 ms 0 KB -