Submission #519516

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5195162022-01-26 13:19:15danikoynovBank (IZhO14_bank)C++14
100 / 100
92 ms8516 KiB
#include<bits/stdc++.h>
using namespace std;
const int maxn = 21;
int n, m, a[maxn], b[maxn], cov[(1 << maxn)], lef[(1 << maxn)];
vector < int > g[maxn];
void solve()
{
cin >> n >> m;
for (int i = 1; i <= n; i ++)
cin >> a[i];
for (int i = 0; i < m; i ++)
cin >> b[i];
cov[0] = 1;
lef[0] = a[1];
for (int mask = 1; mask < (1 << m); mask ++)
{
for (int bit = 0; bit < m; bit ++)
{
if ((mask & (1 << bit)) == 0)
continue;
int old_mask = (mask ^ (1 << bit));
int wcov = cov[old_mask];
int wlef = lef[old_mask] - b[bit];
if (wlef < 0)
continue;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...