# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
548918 | Hanksburger | Bank (IZhO14_bank) | C++17 | 160 ms | 2416 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;
bool visited[1048580], dp[1048580];
int a[25], b[25], n, m;
bool f(int x)
{
if (visited[x])
return dp[x];
visited[x]=1;
int index=0, sum=0;
for (int i=1; i<=m; i++)
if (x&(1<<(i-1)))
sum+=b[i];
for (int i=1; i<=n; i++)
{
if (sum<a[i])
{
index=i;
break;
}
sum-=a[i];
}
if (!index)
{
dp[x]=1;
return 1;
}
bool res=0;
for (int i=1; i<=m; i++)
if (!(x&(1<<(i-1))) && b[i]<=a[index]-sum)
# | 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... |