# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1066001 | Ahmed57 | Packing Biscuits (IOI20_biscuits) | C++17 | 1098 ms | 596 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"
using namespace std;
#define int long long
long long count_tastiness(long long x,vector<long long> a){
int k = a.size();
int ans = 0;
for(int i = 0;i<a.size();i++){
ans/=2;
ans+=a[i];
}
while(ans>1){
ans/=2;
a.push_back(0);
}
k = a.size();
long long all =0;
for(int val = 0;val<=min((long long)10000000,(1ll<<k)-1);val++){
long long ans = 0;bool bad = 0;
for(int i = 0;i<k;i++){
ans/=2;
ans+=a[i];
if(val&(1ll<<i)){
if(ans<x){
bad = 1;break;
}
ans-=x;
}
}
if(!bad)all++;
}
return all;
}
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... |