Submission #1356782

#TimeUsernameProblemLanguageResultExecution timeMemory
1356782SacharlemagnePacking Biscuits (IOI20_biscuits)C++20
0 / 100
1119 ms788444 KiB
#include "biscuits.h"

using namespace std;

typedef long long ll;
typedef vector<ll> vll;

ll count_tastiness(ll x, vll a) {
    a.resize(62);
    vll good = {0};
    ll sum = 0;
    for (int i = 0; i<62; ++i) {
        ll po = 1ll << i;
        sum += po * a[i];
        vll newGood;
        for (ll val : good) {
            if ((val + po) * x <= sum) newGood.push_back(val + po);
        }
        for (ll val : newGood) good.push_back(val);
    }
    return good.size();
}
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...