제출 #304581

#제출 시각아이디문제언어결과실행 시간메모리
304581johutha비스킷 담기 (IOI20_biscuits)C++17
0 / 100
3 ms384 KiB
#include "biscuits.h" #include <vector> #include <iostream> #define int long long using namespace std; int count_tastiness(int x, vector<int> a) { a.resize(62, 0); vector<int> b; for (int i = 0; i < 62; i++) { if (i > 0) b.push_back((b.back() / 2) + a[i]); else b.push_back(a[i]); } vector<int> res(62, 0); res[0] = 1; for (int i = 0; i < 62; i++) { if (b[i] < x) continue; res[i] = 1; int need = max(0ll, 2*(x - a[i])); for (int j = i - 1; j >= 0; j--) { if (b[j] - need >= x) res[i] += res[j]; need = max(0ll, 2*(need - a[i])); } } int r = 1; for (auto i : res) { r += i; } return r; }
#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...