Submission #1047453

#TimeUsernameProblemLanguageResultExecution timeMemory
1047453jer033비스킷 담기 (IOI20_biscuits)C++17
0 / 100
1090 ms348 KiB
#include "biscuits.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

long long count_hastiness(ll x, vector<ll> (&a), ll bonus)
{
    //basically, the biscuits are now in the order I want. Woohoo!
    int b = a.size();
    if (b==0)
        return 1;
    ll bac = a[b-1]+bonus;
    a.pop_back();
    ll ans = 0;
    if (bac >= x)
    {
        ans += count_hastiness(x, a, (bac-x)/2ll);
    }
    ans += count_hastiness(x, a, bac/2ll);
    a.push_back(bac);
    return ans;
}

long long count_tastiness(long long x, std::vector<long long> a) {
	int k = a.size();
    for (int i=1; i<=(60-k); i++)
        a.push_back(0ll);
    vector<ll> aa(60);
    for (int i=0; i<60; i++)
        aa[i] = a[59-i];
    return count_hastiness(x, aa, 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...