# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
996300 | Essa2006 | Packing Biscuits (IOI20_biscuits) | C++14 | 16 ms | 600 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;
#define ll long long
#define endl '\n'
#define FF first
#define SS second
#define all(a) a.begin(), aa.end()
#define mod (ll)(1000000007)
ll count_tastiness(ll n, vector<ll> Freq) {
int sum = 100000 / n;
int ans = 0;
for (int i = 0; i <= sum; i++) {
vector<ll> Freq2 = Freq;
int j = 0;
bool cant = 0;
while (j < min(18, (int)Freq.size())) {
if ((1 << j) & i) {
if (Freq2[j] < n) {
cant = 1;
break;
}
Freq2[j] -= n;
}
if (j != Freq.size() - 1) {
Freq2[j + 1] += Freq2[j] / 2;
}
j++;
}
ans += !cant;
}
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... |