제출 #306867

#제출 시각아이디문제언어결과실행 시간메모리
306867VEGAnn비스킷 담기 (IOI20_biscuits)C++14
9 / 100
1087 ms384 KiB
#include "biscuits.h" #include <bits/stdc++.h> #pragma GCC optimize("-O3") #pragma GCC optimize("Ofast") #define sz(x) ((int)x.size()) #define PB push_back 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; while (sz(b) < 60) b.PB(0); 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...