# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
305541 | myungwoo | Packing Biscuits (IOI20_biscuits) | C++17 | 20 ms | 896 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;
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
typedef long long lld;
lld count_tastiness(lld x, vector<lld> a)
{
vector <lld> status(63, 0);
lld sum = 0;
for (int i=0;i<63;i++){
if (i < a.size()) sum += a[i]<<i;
status[i] = sum;
}
vector <lld> dp(63, 0); dp[0] = 1;
for (int i=1;i<63;i++){
lld cur = sum; dp[i] = 1;
for (int j=i;j--;){
cur = min(cur, status[j]);
if (x <= cur>>j){
cur -= x<<j;
dp[i] += dp[j];
}
}
}
return dp.back();
}
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... |