Submission #746041

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7460412023-05-21 10:43:52vjudge1Kitchen (BOI19_kitchen)C++17
51 / 100
326 ms108404 KiB
#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++;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...