# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
579946 | Vanilla | Packing Biscuits (IOI20_biscuits) | C++17 | 1086 ms | 852 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;
typedef long long int64;
bool check (int64 tg, int64 x, vector <int64> a) {
vector <int64> b(x, 0);
int64 n = a.size();
int64 curr = tg;
for (int64 i = n - 1; i >= 0; i--){
for (int z = 0; z < 100; z++){
int j = 0;
while (j < x && a[i]) {
if (b[j] + (1 << i) <= tg) {
b[j]+=(1 << i);
a[i]--;
}
j++;
}
}
}
for (int i = 0; i < x; i++){
if (b[i] != tg) return 0;
}
return 1;
}
int64 count_tastiness(int64 x, vector<int64> a) {
cout << "\n\n";
int64 rs = 1;
for (int i = 1; i <= 100000; i++){
if (check(i, x, a)) rs++;
}
return rs;
}
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... |