제출 #833955

#제출 시각아이디문제언어결과실행 시간메모리
833955Johann비스킷 담기 (IOI20_biscuits)C++14
0 / 100
1065 ms340 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; vi A; bool check(ll num, int idx, ll force) { if (num == 0) return true; if (num & (1 << idx)) { if (force < X) return false; force -= X; num ^= (1 << idx); } force /= 2; if (idx + 1 < sz(A)) force += A[idx + 1]; return check(num, idx + 1, force); } long long count_tastiness(long long _X, std::vector<long long> a) { X = _X; ans = 0; A = vi(all(a)); for (int i = 0; i <= 100000; ++i) if (check(i, 0, a[0])) ++ans; 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...