Submission #425646

# Submission time Handle Problem Language Result Execution time Memory
425646 2021-06-13T09:41:10 Z oleh1421 Sure Bet (CEOI17_sure) C++17
0 / 100
1 ms 204 KB
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
const int N=510;
const ll mod=1000000007;
const ll inf=1e15;
double a[N],b[N];
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n;cin>>n;
    vector<double>v;
    for (int i=1;i<=n;i++) {
        cin>>a[i]>>b[i];
        v.push_back(a[i]);
        v.push_back(b[i]);
    }
    sort(a+1,a+n+1);
    sort(b+1,b+n+1);
    reverse(a+1,a+n+1);
    reverse(b+1,b+n+1);
    for (int i=2;i<=n;i++) a[i]+=a[i-1];
    for (int i=2;i<=n;i++) b[i]+=b[i-1];
    double res=0.0;
    for (int i=1;i<=n;i++){
        for (int j=1;j<=n;j++){
            res=max(res,min(a[i]-i-j,b[j]-i-j));
        }
    }
    cout<<setprecision(10)<<fixed<<res<<endl;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -