# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
831202 | Username4132 | Packing Biscuits (IOI20_biscuits) | C++17 | 11 ms | 1236 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<iostream>
#include<vector>
using namespace std;
using ll = long long;
#define forn(i, n) for(int i=0; i<(int)n; ++i)
const int MAXN = 62;
int n;
ll val[MAXN], res[MAXN];
long long count_tastiness(ll x, vector<ll> a) {
n = (int)a.size();
ll su=0;
forn(i, MAXN){
if(i<n) su+=a[i]*(1LL<<i);
val[i]=(su/x);
int cur=i;
ll ans=0, r=val[i];
while(true){
if(cur==0){
ans+=(r>0)+1;
break;
}
if(r>=(1LL<<(cur+1))-1){
ans+=2*res[cur-1];
break;
}
if(r>=(1LL<<cur)){
ans+=res[cur-1];
# | 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... |