# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
303839 | cgiosy | Packing Biscuits (IOI20_biscuits) | C++17 | 1 ms | 384 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 <bits/stdc++.h>
using namespace std;
using ll=long long;
ll count_tastiness(ll x, vector<ll> A) {
const int N=A.size();
for(int i=1; i<N; i++) A[i]=A[i-1]+(A[i]<<i);
for(int i=0; i<N; i++) A[i]=min(A[i]/x, (1LL<<i+1)-1);
for(int i=1; i<N; i++) A[i]=min(A[i], A[i-1]|(A[i]&1LL<<i));
ll mx=1;
vector<ll> D(N, 1);
for(int i=0; i<N; i++) {
ll mx2=mx;
for(int j=0; j<N; j++) if(A[j]&1LL<<i) mx2=max(mx2, D[j]+=mx);
mx=mx2;
}
return mx;
}
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... |