# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1029516 | irmuun | Packing Biscuits (IOI20_biscuits) | C++17 | 1041 ms | 416 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 ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
ll count_tastiness(ll x,vector<ll>a){
ll ans=0,k=a.size();
vector<ll>c(60,0);
for(ll i=0;i<=100000;i++){
if(i*x>(ll)1e18) break;
for(ll j=0;j<60;j++){
c[j]=a[j];
}
bool can=true;
for(ll j=0;j<60;j++){
if(i&(1ll<<j)){
if(c[j]<x){
can=false;
break;
}
c[j]-=x;
if(j<59){
c[j+1]+=c[j]/2;
}
}
}
if(can){
ans++;
}
}
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... |