| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 400973 | zoooma13 | Packing Biscuits (IOI20_biscuits) | C++14 | 2 ms | 588 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "bits/stdc++.h"
#include "biscuits.h"
using namespace std;
vector <long long> a;
long long dp[2][64];
long long go(int i ,bool o){
if(i == a.size())
return 1;
auto&ret = dp[o][i];
if(~ret)
return ret;
if(!o && a[i] == 0) return ret = go(i+1 ,0);
if(!o && a[i] == 1) return ret = 2*go(i+1 ,0);
if(!o && a[i] == 2) return ret = 2*go(i+1 ,0) + go(i+1 ,1);
if(o && a[i] == 0) return ret = 2*go(i+1 ,0);
if(o && a[i] == 1) return ret = 2*go(i+1 ,0) + go(i+1 ,1);
if(o && a[i] == 2) return ret = 2*go(i+1 ,0) + 2*go(i+1 ,1);
}
long long count_tastiness(long long x, vector<long long> _a) {
assert(x == 1);
long long bef = 0;
a = _a;
a.resize(62);
for(auto&i : a){
i += bef;
bef = (i-1)/2;
i -= 2*bef;
}
memset(dp ,-1 ,sizeof dp);
return go(0 ,0);
}Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
