# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1080357 | UmairAhmadMirza | Packing Biscuits (IOI20_biscuits) | C++17 | 1050 ms | 440 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
int const K=20;
int cnt[K];
int cp[K];
long long count_tastiness(long long x, vector<long long> a){
for(int i=0;i<K;i++)
cnt[i]=0;
for(int i=0;i<a.size();i++)
cnt[i]=a[i];
int ans=0;
for(int n=0;n<=100000;n++){
for(int i=0;i<K;i++)
cp[i]=cnt[i];
ans++;
for(int i=0;i<K-1;i++){
if((1<<i)&(n)){
if(cp[i]<x){
ans--;
break;
}
cp[i]-=x;
}
cp[i+1]+=cp[i]/2;
}
}
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... |