Submission #878677

# Submission time Handle Problem Language Result Execution time Memory
878677 2023-11-25T04:54:24 Z Sir_Ahmed_Imran Sure Bet (CEOI17_sure) C++17
0 / 100
0 ms 344 KB
                            ///~~~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;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -