#include "biscuits.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define sz(x) (int)(x).size()
ll count_tastiness(ll x, vector<ll> a) {
while (sz(a) < 60)
a.push_back(0);
ll ret = 1;
vector<vector<ll>> dp(61, vector<ll>(2*x+1, 0));
dp[0][0] = 1;
ll pref = 0;
for (int i = 0; i < 60; i++) {
pref = pref / 2 + a[i];
for (int j = 0; j <= min(pref,x); j++) if (dp[i][j] != 0) {
dp[i+1][pref / 2 - (pref-j) / 2] += dp[i][j];
if (pref - j >= x) {
ret += dp[i][j];
dp[i+1][pref/2-(pref-j-x)/2] += dp[i][j];
}
}
}
return ret;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Runtime error |
3 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
1 ms |
256 KB |
Output is correct |
5 |
Correct |
1 ms |
256 KB |
Output is correct |
6 |
Correct |
1 ms |
256 KB |
Output is correct |
7 |
Correct |
1 ms |
256 KB |
Output is correct |
8 |
Correct |
1 ms |
256 KB |
Output is correct |
9 |
Correct |
1 ms |
256 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
50 ms |
10240 KB |
Output is correct |
2 |
Correct |
34 ms |
9176 KB |
Output is correct |
3 |
Correct |
34 ms |
9924 KB |
Output is correct |
4 |
Correct |
1 ms |
256 KB |
Output is correct |
5 |
Correct |
1 ms |
256 KB |
Output is correct |
6 |
Correct |
1 ms |
384 KB |
Output is correct |
7 |
Correct |
1 ms |
256 KB |
Output is correct |
8 |
Correct |
93 ms |
10240 KB |
Output is correct |
9 |
Correct |
94 ms |
10368 KB |
Output is correct |
10 |
Correct |
1 ms |
384 KB |
Output is correct |
11 |
Correct |
1 ms |
512 KB |
Output is correct |
12 |
Correct |
9 ms |
1724 KB |
Output is correct |
13 |
Correct |
93 ms |
10008 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1242 ms |
1888152 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Runtime error |
3 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
3 |
Halted |
0 ms |
0 KB |
- |