## Submission #191345

# Submission time Handle Problem Language Result Execution time Memory
191345 2020-01-14T20:11:26 Z rzbt Bank (IZhO14_bank) C++14
19 / 100
82 ms 504 KB
```#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define MAXN 21
typedef long long ll;

using namespace std;

int n,m;
int a[MAXN],b[MAXN];
vector<int> moze[MAXN];
bool dp[MAXN][1<<MAXN];

if(koji==n){
printf("YES");
exit(0);
}
for(auto x:moze[koji])
}

int main()
{
scanf("%d %d", &n, &m);
for(int i=0;i<n;i++)
scanf("%d",a+i);
for(int i=0;i<m;i++)
scanf("%d",b+i);
for(int i=1;i<(1<<m);i++){

int zbir=0;
for(int j=0;j<m;j++){
if(i&(1<<j)){
zbir+=b[j];
}
}
//printf("   %d %d\n",i,zbir);
for(int j=0;j<n;j++)
if(a[j]==zbir)moze[j].pb(zbir);

}
resi(0,0);
printf("NO");

return 0;
}
```

### Compilation message

```bank.cpp: In function 'int main()':
bank.cpp:34:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d", &n, &m);
~~~~~^~~~~~~~~~~~~~~~~
bank.cpp:36:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",a+i);
~~~~~^~~~~~~~~~
bank.cpp:38:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",b+i);
~~~~~^~~~~~~~~~```

#### Subtask #1 19.0 / 19.0

# Verdict Execution time Memory Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 408 KB Output is correct
4 Correct 4 ms 376 KB Output is correct
5 Correct 81 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 296 KB Output is correct
8 Correct 81 ms 376 KB Output is correct
9 Correct 82 ms 408 KB Output is correct

#### Subtask #2 0 / 25.0

# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -

#### Subtask #3 0 / 27.0

# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -

#### Subtask #4 0 / 29.0

# Verdict Execution time Memory Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 408 KB Output is correct
4 Correct 4 ms 376 KB Output is correct
5 Correct 81 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 296 KB Output is correct
8 Correct 81 ms 376 KB Output is correct
9 Correct 82 ms 408 KB Output is correct
10 Incorrect 2 ms 376 KB Output isn't correct
11 Halted 0 ms 0 KB -