제출 #306808

#제출 시각아이디문제언어결과실행 시간메모리
306808VEGAnn비스킷 담기 (IOI20_biscuits)C++17
0 / 100
2 ms512 KiB
#include "biscuits.h" #include <bits/stdc++.h> #define sz(x) ((int)x.size()) using namespace std; typedef long long ll; vector<ll> b; ll ans, glob_x; void rec(int ps){ if (ps == sz(b)){ ans++; return; } ll mem = (b[ps]) / 2; if (ps + 1 < sz(b)) { b[ps + 1] += mem; } rec(ps + 1); if (ps + 1 < sz(b)){ b[ps + 1] -= mem; } if (b[ps] >= glob_x) { mem = (b[ps] - glob_x) / 2; if (ps + 1 < sz(b)) { b[ps + 1] += mem; } rec(ps + 1); if (ps + 1 < sz(b)){ b[ps + 1] -= mem; } } } long long count_tastiness(long long x, std::vector<long long> a) { glob_x = x; b = a; ans = 0; rec(0); return ans; }
#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...