#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll x;
vector<ll> a;
vector<ll> limit;
int n;
int sol;
void bkt(int i, ll sum)
{
if (i == 60)
{
sol++;
return;
}
if (sum <= limit[i])
{
bkt(i + 1, sum);
}
if (sum + x * (1LL << i) <= limit[i])
{
bkt(i + 1, sum + x * (1LL << i));
}
}
ll count_tastiness(ll xx, vector<ll> aa)
{
sol = 0;
x = xx;
a = aa;
n = (int) a.size();
limit = a;
ll c = 0;
for (int i = 0; i < n; i++)
{
c += (1LL << i) * a[i];
limit[i] = c;
}
while ((int) limit.size() < 60)
{
limit.push_back(limit.back());
}
bkt(0, 0);
return sol;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
23 ms |
256 KB |
Output is correct |
2 |
Execution timed out |
1088 ms |
256 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
23 ms |
256 KB |
Output is correct |
2 |
Execution timed out |
1094 ms |
256 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1055 ms |
256 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1090 ms |
384 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
23 ms |
256 KB |
Output is correct |
2 |
Execution timed out |
1088 ms |
256 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |