#include "biscuits.h"
#include <bits/stdc++.h>
#ifndef EVAL
#include "grader.cpp"
#endif
using ll = long long;
using std::cin;
using std::cout;
using std::endl;
using std::vector;
using std::string;
using vi = vector<ll>;
using vii = vector<vi>;
using pii = std::pair<ll,ll>;
#define rep(i,j,k) for(ll i=ll(j); i<ll(k); i++)
#define REP(i,j,k) for(ll i=ll(j); i<=ll(k); i++)
#define per(i,j,k) for(ll i=ll(j); i>=ll(k); i--)
#define ln "\n"
#define pb emplace_back
#define mp std::make_pair
#define mtp std::make_tuple
#define all(a) a.begin(), a.end()
constexpr ll inf = (1ll<<60);
long long count_tastiness(long long x, std::vector<long long> a) {
ll k = a.size();
while(k <= 60){
a.pb(0);
k++;
}
assert(x <= 10000);
vi remain(1,0), val(1,1);
rep(i,0,k){
vector<pii> data;
rep(j,0,remain.size()){
data.pb(mp((remain[j]+a[i])/2, val[j]));
if(remain[j]+a[i] >= x){
data.pb(mp((remain[j]+a[j]-x)/2,val[j]));
}
}
sort(all(data));
remain.clear();
val.clear();
remain.pb(data[0].first);
val.pb(0);
for(auto el: data){
if(el.first == remain.back()) val[val.size()-1] += el.second;
else{
remain.pb(el.first);
val.pb(el.second);
}
}
}
ll ans = 0;
for(auto el: val) ans += el;
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1064 ms |
149328 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
596 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |