# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
378214 | Thistle | Packing Biscuits (IOI20_biscuits) | C++14 | 1088 ms | 16176 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 "biscuits.h"
#include <vector>
#include<iostream>
#include<algorithm>
#include<unordered_map>
#include<map>
using namespace std;
using ll=long long;
using H=pair<ll, ll>;
using vi=vector<ll>;
#define rng(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define rep(i,n) rng((i),(0),(n))
#define pb push_back
#define vec vector
#define all(a) (a).begin(),(a).end()
#define fs first
#define sc second
#define siz(a) ll((a).size())
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
long long count_tastiness(long long x, std::vector<long long> a) {
ll k=siz(a);
a.resize(60);
rng(i,k,60) a[i]=0;
unordered_map<ll, ll>mp[2];
//remain cookie -> able number
mp[0][0]=1;
rep(i,60){
auto& now=mp[i&1];
auto& nxt=mp[(i+1)&1];
nxt.clear();
for(auto g:now){
ll t=g.fs;
t+=a[i];
if(t>=x) nxt[(t-x)>>1]+=g.sc;
nxt[t>>1]+=g.sc;
}
}
ll ans=0;
for(auto g:mp[0]){
ans+=g.sc;
}
return ans;
}
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... |