# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
90511 | daniel_02 | 은행 (IZhO14_bank) | C++14 | 61 ms | 504 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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");
}
컴파일 시 표준 에러 (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... |