제출 #633761

#제출 시각아이디문제언어결과실행 시간메모리
633761tabrPacking Biscuits (IOI20_biscuits)C++17
9 / 100
1090 ms1108 KiB
#include <bits/stdc++.h>
using namespace std;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

long long count_tastiness(long long x, vector<long long> a) {
    if (a.size() == 1) {
        return a[0] / x + 1;
    }
    long long res = 0;
    for (long long t : {0LL, x}) {
        if (a[0] < t) {
            continue;
        }
        auto b = a;
        b[1] += (b[0] - t) / 2;
        b.erase(b.begin());
        res += count_tastiness(x, b);
    }
    return res;
}

#ifdef tabr
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    debug(count_tastiness(3, {5, 2, 1}));  // 5
    debug(count_tastiness(2, {2, 1, 2}));  // 6
    return 0;
}
#endif
#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...