제출 #558388

#제출 시각아이디문제언어결과실행 시간메모리
558388ymm비스킷 담기 (IOI20_biscuits)C++17
0 / 100
1 ms340 KiB
/// /// Standing here /// I realize /// You are just like me /// Trying to make history /// #include <bits/stdc++.h> #define Loop(x,l,r) for(ll x = ll(l); x < ll(r); ++x) #define LoopR(x,l,r) for(ll x = ll(r)-1; x >= ll(l); --x) #define Kill(x) exit((cout << (x) << '\n', 0)) typedef long long ll; typedef std::pair<int,int> pii; typedef std::pair<ll,ll> pll; using namespace std; #ifndef LOCAL #include "biscuits.h" #else ll count_tastiness(ll, vector<ll>); int main() { cout << count_tastiness(2, {2, 1, 2}) << '\n'; } #endif static vector<ll> a; static int k; static ll x; static ll solve(int i, ll rem) { if (i == k) return rem/k + 1; ll ans = solve(i+1, (rem+a[i])/2); if (rem + a[i] >= x) ans += solve(i+1, (rem+a[i]-x)/2); return ans; } ll count_tastiness(ll _x, vector<ll> _a) { x = _x; a = _a; k = _a.size(); return solve(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...