#include<iostream>
#include<algorithm>
#include<cstring>
#include<queue>
#include<vector>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<deque>
#include<string>
#include<unordered_map>
#include<bitset>
#include<random>
#include<chrono>
#include<cstdarg>
//Eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
using namespace std;
const int MAXN = 60;
typedef long long ul;
map<ul, ul> dp;
ul X;
vector<ul> psa;
ul f(ul i) {
if (i == 0) return 1;
if (dp.find(i) == dp.end()) {
ul mx = log2(i);
dp[i] = dp[i - (1 << mx)] + dp[min(i, psa[mx] / X) - (1 << mx)];
}
return dp[i];
}
ul count_tastiness(ul x, vector<ul> a) {
int N = a.size(); X = x;
dp = map<ul, ul>();
psa = vector<ul>(N);
psa[0] = a[0];
for (int i = 1; i < N; i++) psa[i] = psa[i - 1] * a[i] << i;
return f(1LL << 60);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |