# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1027642 | vjudge1 | Bank (IZhO14_bank) | C++14 | 1075 ms | 416 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 n,m;
const int MAX=20;
int plata[MAX],pari[MAX];
bool flag=false;
void f(int i,int cnt[])
{
if(i>=m)
{
for(int j=0; j<n; j++)if(plata[j]!=cnt[j])return;
flag=true;
return;
}
for(int j=0; j<n; j++)
{
if(cnt[j]+pari[i]>plata[j])continue;
//cout<<"add: "<<pari[i]<<" on pos: "<<j+1<<endl;
cnt[j]+=pari[i];
f(i+1,cnt);
cnt[j]-=pari[i];
f(i+1,cnt);
}
}
int main()
{
cin>>n>>m;
# | 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... |