제출 #303489

#제출 시각아이디문제언어결과실행 시간메모리
303489aljasdlas비스킷 담기 (IOI20_biscuits)C++14
0 / 100
1087 ms384 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; #define int long long int x; vector<int> a; int recurse(int cur, int i) { // if(i == 60) { // cerr << bitset<60>(cur) << " " << i << endl; // } if(i == 60) return 1; a[i+1] += a[i]/2; int res = recurse(cur, i+1); a[i+1] -= a[i]/2; if(a[i] >= x) { a[i+1] += (a[i]-x)/2; res += recurse(cur + (1ll<<i), i+1); a[i+1] -= (a[i]-x)/2; } return res; } long long count_tastiness(long long x_, vector<long long> a_) { x=x_; a=a_; if(x == 1) { int cur = 0; for(auto x: a) if(x) cur++; return (1ll << cur); } while(a.size() <= 62) a.push_back(0); int ans = recurse(0, 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...