| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1368610 | bnijaamaa | Bank (IZhO14_bank) | C++20 | 0 ms | 348 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define nn endl
#define pb push_back
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n , m ;
cin >> n >> m ;
vector<int> b(n + 1) , a(m + 1);
for(int i = 1; i <= n ; i++)
{
cin >> b[i];
}
for(int i = 1; i <= m ; i++)
{
cin >> a[i];
}
vector<bool> dp(b[1] + 1 , 0);
dp[0] = true;
for(int i = 1; i <= m ; i++)
{
for(int j = b[1] ; j >= a[i]; j--)
{
if(dp[j - a[i]])
{
dp[j] = true;
}
}
}
if(dp[b[1]]) cout << "YES" << nn ;
else cout << "NO" << nn ;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
