## Submission #191347

# Submission time Handle Problem Language Result Execution time Memory
191347 2020-01-14T20:16:38 Z rzbt Bank (IZhO14_bank) C++14
100 / 100
218 ms 14576 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(i);

}

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 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 252 KB Output is correct
4 Correct 4 ms 376 KB Output is correct
5 Correct 84 ms 256 KB Output is correct
6 Correct 15 ms 504 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 84 ms 376 KB Output is correct
9 Correct 85 ms 364 KB Output is correct

#### Subtask #2 25.0 / 25.0

# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 4 ms 376 KB Output is correct
8 Correct 1 ms 376 KB Output is correct
9 Correct 3 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct

#### Subtask #3 27.0 / 27.0

# Verdict Execution time Memory Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 3 ms 376 KB Output is correct
3 Correct 4 ms 376 KB Output is correct
4 Correct 3 ms 376 KB Output is correct
5 Correct 4 ms 376 KB Output is correct
6 Correct 3 ms 256 KB Output is correct
7 Correct 3 ms 376 KB Output is correct
8 Correct 3 ms 376 KB Output is correct
9 Correct 3 ms 376 KB Output is correct
10 Correct 3 ms 376 KB Output is correct
11 Correct 4 ms 256 KB Output is correct

#### Subtask #4 29.0 / 29.0

# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 252 KB Output is correct
4 Correct 4 ms 376 KB Output is correct
5 Correct 84 ms 256 KB Output is correct
6 Correct 15 ms 504 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 84 ms 376 KB Output is correct
9 Correct 85 ms 364 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 4 ms 376 KB Output is correct
17 Correct 1 ms 376 KB Output is correct
18 Correct 3 ms 376 KB Output is correct
19 Correct 2 ms 376 KB Output is correct
20 Correct 3 ms 376 KB Output is correct
21 Correct 3 ms 376 KB Output is correct
22 Correct 4 ms 376 KB Output is correct
23 Correct 3 ms 376 KB Output is correct
24 Correct 4 ms 376 KB Output is correct
25 Correct 3 ms 256 KB Output is correct
26 Correct 3 ms 376 KB Output is correct
27 Correct 3 ms 376 KB Output is correct
28 Correct 3 ms 376 KB Output is correct
29 Correct 3 ms 376 KB Output is correct
30 Correct 4 ms 256 KB Output is correct
31 Correct 88 ms 492 KB Output is correct
32 Correct 89 ms 632 KB Output is correct
33 Correct 93 ms 376 KB Output is correct
34 Correct 97 ms 504 KB Output is correct
35 Correct 98 ms 364 KB Output is correct
36 Correct 106 ms 632 KB Output is correct
37 Correct 89 ms 376 KB Output is correct
38 Correct 98 ms 372 KB Output is correct
39 Correct 99 ms 368 KB Output is correct
40 Correct 98 ms 376 KB Output is correct
41 Correct 106 ms 376 KB Output is correct
42 Correct 101 ms 3908 KB Output is correct
43 Correct 95 ms 1016 KB Output is correct
44 Correct 101 ms 256 KB Output is correct
45 Correct 88 ms 380 KB Output is correct
46 Correct 92 ms 376 KB Output is correct
47 Correct 108 ms 376 KB Output is correct
48 Correct 85 ms 436 KB Output is correct
49 Correct 85 ms 364 KB Output is correct
50 Correct 105 ms 504 KB Output is correct
51 Correct 97 ms 504 KB Output is correct
52 Correct 96 ms 504 KB Output is correct
53 Correct 96 ms 504 KB Output is correct
54 Correct 106 ms 476 KB Output is correct
55 Correct 105 ms 376 KB Output is correct
56 Correct 105 ms 508 KB Output is correct
57 Correct 218 ms 14576 KB Output is correct
58 Correct 105 ms 504 KB Output is correct