# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
996302 | Rifal | Packing Biscuits (IOI20_biscuits) | C++14 | 3 ms | 604 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;
long long count_tastiness(long long x, std::vector<long long> a) {
long long ans = 0;
int siz = a.size();
for(int i = 0; i <= 100000; i++) {
int cur[siz];
for(int j = 0; j < a.size(); j++) cur[j] = a[j];
bool ok = true;
for(int j = 0; j < 20; j++) {
if((i&(1<<j)) > 0) {
if(cur[j] >= x) {
cur[j] -= x;
}
else {
ok = false; break;
}
}
if(!ok) break;
if(cur[j] != 0) cur[j+1] = cur[j]/2;
}
if(ok) 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... |