제출 #833850

#제출 시각아이디문제언어결과실행 시간메모리
833850Johann비스킷 담기 (IOI20_biscuits)C++14
0 / 100
1169 ms1981964 KiB
#include "biscuits.h" #include "bits/stdc++.h" using namespace std; typedef long long ll; typedef vector<ll> vi; typedef vector<vi> vvi; #define sz(x) (int)(x).size() #define all(x) (x).begin(), (x).end() int X; ll ans = 0; void dfs(int idx, vi &a) { if (idx == sz(a) - 1 && a[idx] < X) return; if (idx + 1 >= sz(a)) a.push_back(0); ll oldidxplus1 = a[idx + 1]; if (a[idx] >= X) { ++ans; a[idx + 1] += (a[idx] - X) / 2; dfs(idx + 1, a); } a[idx + 1] = oldidxplus1; a[idx + 1] += a[idx] / 2; dfs(idx + 1, a); a[idx + 1] = oldidxplus1; } long long count_tastiness(long long _X, std::vector<long long> a) { X = _X; a.push_back(0); ans = 0; dfs(0, a); return ans + 1; }
#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...