# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
720077 | ovidiush11 | Bank (IZhO14_bank) | C++14 | 6 ms | 340 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;
int st[20],n,m;
vector<int> a,b;
bool sum(int s,int k)
{
if(s == 0)return 1;
if(s < 0)return 0;
for(int i = k;i < m;i++)
{
if(st[i] == 0)
{
st[i] = 1;
if(sum(s - b[i],i+1))return 1;
st[i] = 0;
}
}
return 0;
}
int main()
{
cin>>n>>m;
for(int i = 0;i < m;i++)st[i] = 0;
a.resize(n);b.resize(m);
for(int i = 0;i < n;i++)cin>>a[i];
for(int i = 0;i < m;i++)cin>>b[i];
sort(a.begin(),a.end());
# | 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... |