제출 #306798

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