#include "biscuits.h"
#include <bits/stdc++.h>
#define ll long long
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define o cout<<"BUG"<<endl;
#define FOR(i, j, n) for(int j = i; j < n; ++j)
#define forn(i, j, n) for(int j = i; j <= n; ++j)
#define nfor(i, j, n) for(int j = n; j >= i; --j)
#define all(v) v.begin(), v.end()
#define ld long double
#define ull unsigned long long
using namespace std;
const int maxn=2e5+100,LOG=17,mod=1e9+7;
int block = 226, timer = 0;
const ld EPS = 1e-18;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define bt(i) (1 << (i))
//#define int ll
const int inf=2e9;
#define y1 yy
#define prev pre
#define pii pair <int, int>
ll count_tastiness(ll x, vector <ll> a)
{
vector <ll> b;
ll ans = 0;
if(a[0] >= x) b.pb((a[0] - x) / 2);
b.pb(a[0] / 2);
while(a.size() < 190) a.pb(0);
for(ll i = 1; i < 190; ++i)
{
vector <ll> c;
for(auto j : b)
{
if(j + a[i] >= x)
c.pb((j + a[i] - x) / 2);
c.pb((j + a[i]) / 2);
}
// cout << c.size() << endl;
b = c;
}
return b.size();
}
Compilation message
biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:34:5: warning: unused variable 'ans' [-Wunused-variable]
34 | ll ans = 0;
| ^~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
116 ms |
3008 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
3 ms |
212 KB |
Output is correct |
4 |
Correct |
104 ms |
1532 KB |
Output is correct |
5 |
Correct |
28 ms |
712 KB |
Output is correct |
6 |
Correct |
434 ms |
3068 KB |
Output is correct |
7 |
Correct |
11 ms |
448 KB |
Output is correct |
8 |
Correct |
441 ms |
3096 KB |
Output is correct |
9 |
Correct |
44 ms |
700 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
77 ms |
912 KB |
Output is correct |
13 |
Correct |
33 ms |
544 KB |
Output is correct |
14 |
Correct |
4 ms |
304 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
141 ms |
3036 KB |
Output is correct |
2 |
Execution timed out |
1095 ms |
36640 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1123 ms |
788528 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1088 ms |
5824 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
116 ms |
3008 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
3 ms |
212 KB |
Output is correct |
4 |
Correct |
104 ms |
1532 KB |
Output is correct |
5 |
Correct |
28 ms |
712 KB |
Output is correct |
6 |
Correct |
434 ms |
3068 KB |
Output is correct |
7 |
Correct |
11 ms |
448 KB |
Output is correct |
8 |
Correct |
441 ms |
3096 KB |
Output is correct |
9 |
Correct |
44 ms |
700 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
77 ms |
912 KB |
Output is correct |
13 |
Correct |
33 ms |
544 KB |
Output is correct |
14 |
Correct |
4 ms |
304 KB |
Output is correct |
15 |
Correct |
141 ms |
3036 KB |
Output is correct |
16 |
Execution timed out |
1095 ms |
36640 KB |
Time limit exceeded |
17 |
Halted |
0 ms |
0 KB |
- |