# | Submission time^{} |
Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|

166624 | 2019-12-03T07:45:57 Z | Trickster | Bank (IZhO14_bank) | C++14 | 1000 ms | 4752 KB |

//Suleyman Atayew #include <algorithm> #include <iostream> #include <string.h> #include <stdio.h> #include <vector> #include <queue> #include <cmath> #include <map> #include <set> #define N 10010 #define ff first #define ss second #define pb push_back #define ll long long #define inf 1000000007 #define pii pair <ll, ll> using namespace std; ll sum; ll n, m; ll v[N]; ll arr[N]; vector <int> E[30]; int main() { cin >> n >> m; for(int i = 1; i <= n; i++) cin >> v[i]; for(int i = 0; i < m; i++) cin >> arr[i]; E[0].pb(0); for(int i = 1; i <= n; i++) { for(int h = 0; h < (1<<m); h++) { int sum = 0; for(int j = 0; j < m; j++) if((h&(1<<j))) sum += arr[j]; if(sum != v[i]) continue; for(auto j: E[i-1]) if((j&h) == 0) E[i].pb(j|h); } } if(E[n].empty()) cout << "NO"; else cout << "YES"; }

# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|

1 | Correct | 4 ms | 376 KB | Output is correct |

2 | Correct | 2 ms | 256 KB | Output is correct |

3 | Correct | 2 ms | 256 KB | Output is correct |

4 | Correct | 4 ms | 376 KB | Output is correct |

5 | Correct | 75 ms | 368 KB | Output is correct |

6 | Correct | 2 ms | 360 KB | Output is correct |

7 | Correct | 2 ms | 256 KB | Output is correct |

8 | Correct | 75 ms | 376 KB | Output is correct |

9 | Correct | 75 ms | 376 KB | Output is correct |

# | 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 | 3 ms | 376 KB | Output is correct |

6 | Correct | 2 ms | 256 KB | Output is correct |

7 | Correct | 2 ms | 256 KB | Output is correct |

8 | Correct | 2 ms | 376 KB | Output is correct |

9 | Correct | 2 ms | 256 KB | Output is correct |

10 | Correct | 2 ms | 376 KB | Output is correct |

# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|

1 | Correct | 9 ms | 404 KB | Output is correct |

2 | Correct | 5 ms | 256 KB | Output is correct |

3 | Correct | 12 ms | 256 KB | Output is correct |

4 | Correct | 16 ms | 380 KB | Output is correct |

5 | Correct | 12 ms | 376 KB | Output is correct |

6 | Correct | 7 ms | 376 KB | Output is correct |

7 | Correct | 6 ms | 376 KB | Output is correct |

8 | Correct | 5 ms | 376 KB | Output is correct |

9 | Correct | 10 ms | 256 KB | Output is correct |

10 | Correct | 10 ms | 376 KB | Output is correct |

11 | Correct | 16 ms | 296 KB | Output is correct |

# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|

1 | Correct | 4 ms | 376 KB | Output is correct |

2 | Correct | 2 ms | 256 KB | Output is correct |

3 | Correct | 2 ms | 256 KB | Output is correct |

4 | Correct | 4 ms | 376 KB | Output is correct |

5 | Correct | 75 ms | 368 KB | Output is correct |

6 | Correct | 2 ms | 360 KB | Output is correct |

7 | Correct | 2 ms | 256 KB | Output is correct |

8 | Correct | 75 ms | 376 KB | Output is correct |

9 | Correct | 75 ms | 376 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 | 3 ms | 376 KB | Output is correct |

15 | Correct | 2 ms | 256 KB | Output is correct |

16 | Correct | 2 ms | 256 KB | Output is correct |

17 | Correct | 2 ms | 376 KB | Output is correct |

18 | Correct | 2 ms | 256 KB | Output is correct |

19 | Correct | 2 ms | 376 KB | Output is correct |

20 | Correct | 9 ms | 404 KB | Output is correct |

21 | Correct | 5 ms | 256 KB | Output is correct |

22 | Correct | 12 ms | 256 KB | Output is correct |

23 | Correct | 16 ms | 380 KB | Output is correct |

24 | Correct | 12 ms | 376 KB | Output is correct |

25 | Correct | 7 ms | 376 KB | Output is correct |

26 | Correct | 6 ms | 376 KB | Output is correct |

27 | Correct | 5 ms | 376 KB | Output is correct |

28 | Correct | 10 ms | 256 KB | Output is correct |

29 | Correct | 10 ms | 376 KB | Output is correct |

30 | Correct | 16 ms | 296 KB | Output is correct |

31 | Correct | 150 ms | 540 KB | Output is correct |

32 | Correct | 931 ms | 4752 KB | Output is correct |

33 | Correct | 515 ms | 376 KB | Output is correct |

34 | Correct | 738 ms | 364 KB | Output is correct |

35 | Correct | 889 ms | 364 KB | Output is correct |

36 | Execution timed out | 1080 ms | 256 KB | Time limit exceeded |

37 | Halted | 0 ms | 0 KB | - |