답안 #1033206

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1033206 2024-07-24T14:14:55 Z MarwenElarbi Sure Bet (CEOI17_sure) C++17
20 / 100
52 ms 348 KB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define fi first
#define se second
#define ll long long
#define pb push_back
#define ii pair<int,int>
template <class T>
using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const int nax=1e5+5;
#define optimise ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int main()
{
    optimise;
    int n;
    cin>>n;
    vector<double> tab(n*2);
    for (int i = 0; i < n; ++i)
    {
        cin>>tab[i]>>tab[n+i];
    }
    double ans=0;
    for (int mask = 0; mask < (1<<(2*n)); ++mask)
    {
        pair<double,double> cnt={0,0};
        for (int i = 0; i < 2*n; ++i)
        {
            if((1<<i)&mask){
                (i>=n ? cnt.se : cnt.fi)+=tab[i];
            }
        }
        ans=max(ans,min(cnt.fi,cnt.se)-__builtin_popcount(mask));
    }
    cout <<fixed<<setprecision(4)<<ans<<endl;
}

        
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 49 ms 348 KB Output is correct
4 Correct 48 ms 348 KB Output is correct
5 Correct 52 ms 348 KB Output is correct
6 Correct 49 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 49 ms 348 KB Output is correct
4 Correct 48 ms 348 KB Output is correct
5 Correct 52 ms 348 KB Output is correct
6 Correct 49 ms 348 KB Output is correct
7 Incorrect 0 ms 348 KB Output isn't correct
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 49 ms 348 KB Output is correct
4 Correct 48 ms 348 KB Output is correct
5 Correct 52 ms 348 KB Output is correct
6 Correct 49 ms 348 KB Output is correct
7 Incorrect 0 ms 348 KB Output isn't correct
8 Halted 0 ms 0 KB -