Submission #306037

#TimeUsernameProblemLanguageResultExecution timeMemory
306037eriksuenderhaufPacking Biscuits (IOI20_biscuits)C++17
21 / 100
1086 ms14460 KiB
#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) {
  ll ret = 1;
  unordered_map<ll,ll> act;
  act[0] = 1;
  for (int i = 0; i < 60; i++) {
    unordered_map<ll,ll> nx;
    for (auto val: act) {
      ll p = val.first;
      p = p / 2 + (i < sz(a) ? a[i] : 0);
      nx[p] += val.second;
      if (p >= x) {
        ret += val.second;
        nx[p - x] += val.second;
      }
    }
    swap(act, nx);
  }
  return ret;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...