| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1325561 | rainy3218 | 은행 (IZhO14_bank) | C++20 | 2 ms | 400 KiB |
#include <bits/stdc++.h>
using namespace std;
int a[25];
int b[25];
int dp[1005];
int main() {
freopen("bank.in", "r", stdin);
freopen("bank.out", "w", stdout);
int N, M;
cin >> N >> M;
for(int i = 1; i <= N; i++) cin >> a[i];
for (int i = 1; i <= M; i++) cin >> b[i];
dp[0] = 1;
for (int i = 1; i <= M; i++) {
for (int j = 1000; j >= b[i]; j--) {
dp[j] = dp[j - b[i]] | dp[j];
}
}
for(int i = 1; i <= N; i++) {
if(dp[a[i]] == 0) {
cout << "NO" << endl;
return 0;
}
}
cout << "YES" << endl;
return 0;
}
컴파일 시 표준 에러 (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... | ||||
