제출 #1032265

#제출 시각아이디문제언어결과실행 시간메모리
1032265mdn2002비스킷 담기 (IOI20_biscuits)C++17
21 / 100
1099 ms63312 KiB
/*
Mayoeba Yabureru
*/
#include<bits/stdc++.h>
using namespace std;

long long count_tastiness(long long x, vector<long long> a) {
    while (a.size() != 200) a.push_back(0);
    map<long long, long long> dp[202];
    function<long long(int, long long)> f = [&] (int i, long long sum) {
        if (i > 60 && sum == 0) return 1ll;
        if (dp[i].count(sum)) return dp[i][sum];
        long long ans = f(i + 1, (sum + a[i]) / 2);
        if (sum + a[i] >= x) ans += f(i + 1, (sum + a[i] - x) / 2);
        return dp[i][sum] = ans;
    };
    return f(0, 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...