제출 #605217

#제출 시각아이디문제언어결과실행 시간메모리
605217MohamedAliSaidane비스킷 담기 (IOI20_biscuits)C++14
0 / 100
1096 ms340 KiB
#include <bits/stdc++.h>
#include "biscuits.h"
    using namespace std;

    typedef long long ll;

    typedef pair<int,int> pii;
    typedef pair<ll,ll> pll;

    typedef vector<int> vi;
    typedef vector<ll> vll;
    typedef vector<pii> vpi;
    typedef vector<pll> vpl;

    #define pb push_back
    #define popb pop_back
    #define all(x) (x).begin(),(x).end()


    int k;
    vll A;
    ll x;

        ll count_tastiness(ll X, vll a)
        {
            A = a;
            x = X;
            k = A.size();
            ll ans = 1ll;
            for(ll y = 1; y <= 1e5; y ++)
            {
                vll B = A;
                bool flag = true;
                for(int i = 0; i < x; i ++)
                {
                    ll cur=  y;
                    for(int j = k - 1; j >= 0; j --)
                    {
                        while(cur >= (1 << j) && B[j] > 0)
                        {
                            cur -= (1 << j);
                            B[j]--;
                        }
                    }
                    if(cur > 0)
                    {
                        flag = false;
                        break;
                    }
                }
                ans += (flag);
            }
            return ans;

        }
        /*
        int32_t main()
        {

            ios::sync_with_stdio(false);
            cin.tie(0); cout.tie(0);
        }
        */

#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...