# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
90511 | daniel_02 | Bank (IZhO14_bank) | C++14 | 61 ms | 504 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>
#define fr first
#define pb push_back
#define sc second
#define ll long long
using namespace std;
int b[27];
main()
{
int n, m, x;
cin >> n >> m;
cin >> x;
if (n > 1)
{
puts("NO");
return 0;
}
for (int i = 1; i <= m; i++)
{
scanf("%d", &b[i]);
}
for (int msk = 1; msk < (1 << m); msk++)
{
int sm = 0;
for (int i = 0; i < m; i++)
{
if (msk & (1 << i))
{
sm += b[i + 1];
}
}
if (sm == x)
{
puts("YES");
return 0;
}
}
puts("NO");
}
Compilation message (stderr)
# | 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... |