# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
962949 | raspy | Bank (IZhO14_bank) | C++14 | 109 ms | 1464 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 <iostream>
using namespace std;
int a[25];
int b[25];
bool o[25][(1<<20)+1];
void dfs(int n, int m, int ix, int ob)
{
// cout << ix << " " << ob << " " << a[ix] << "\n";
if (ix == n)
{
cout << "YES\n";
exit(0);
}
if (ob == ((1<<m)-1))
return;
if (a[ix] < 0)
return;
if (o[ix][ob])
return;
if (a[ix] == 0)
dfs(n, m, ix+1, ob);
for (int i = 0; i < m; i++)
if (((1<<i)&ob) == 0)
{
a[ix]-=b[i];
dfs(n, m, ix, ob|(1<<i));
a[ix]+=b[i];
# | 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... |