Submission #317837

# Submission time Handle Problem Language Result Execution time Memory
317837 2020-10-30T13:30:57 Z nandonathaniel Sure Bet (CEOI17_sure) C++14
0 / 100
1 ms 384 KB
#include<bits/stdc++.h>
using namespace std;

double a[100005],b[100005];

int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int n;
	cin >> n;
	for(int i=1;i<=n;i++){
		cin >> a[i] >> b[i];
		a[i]-=1.0;b[i]-=1.0;
	}
	sort(a+1,a+n+1);
	reverse(a+1,a+n+1);
	sort(b+1,b+n+1);
	reverse(b+1,b+n+1);
	for(int i=1;i<=n;i++){
		a[i]+=a[i-1];
		b[i]+=b[i-1];
	}
	double ans=-1e9;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++)ans=max(ans,min(a[i]-(double)j,b[j]-(double)i));
	}
	cout << fixed << setprecision(4) << ans << '\n';
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -