# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
746041 | vjudge1 | Kitchen (BOI19_kitchen) | C++17 | 326 ms | 108404 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;
const int MAXN = 301;
const int MAXS = MAXN*MAXN+1000;
int dp[MAXN][MAXS], n, m, k;
void solve() {
vector<int> a(n+1), b(m+1);
int need = 0;
for (int i = 1; i <= n; i++) {
cin >> a[i];
need += a[i];
}
for (int j = 1; j <= m; j++) {
cin >> b[j];
}
int ans = INT_MAX;
for (int bits = 0; bits < (1 << m); bits++) {
int x = bits<<1;
int sum = 0, chefs = 0, bad_chefs = 0, good_chefs = 0;
for (int i = 1; i <= m; i++) {
if ((x>>i)&1) {
sum += b[i]; chefs++;
if (b[i] < n) bad_chefs += b[i];
else good_chefs++;
}
# | 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... |