# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
344613 | 2021-01-06T06:38:37 Z | bachaquer | 은행 (IZhO14_bank) | C++14 | 1 ms | 364 KB |
#include <bits/stdc++.h> #define ll long long #define pb push_back using namespace std; ll n, x, m; int main() { cin >> n >> m; vector<ll> v, vvv, real; for (int i = 0; i < n; i++) { cin >> x; v.pb(x); } for (int i = 0; i < m; i++) { cin >> x; vvv.pb(x); } sort(vvv.rbegin(), vvv.rend()); real = vvv; bool tru = true; for (int i = 0; i < n; i++) { bool bar = false; vvv = real; for (int j = 0; j < vvv.size(); j++) { x = v[i]; real = vvv; for (int k = j; k < real.size(); k++) { if (x - real[k] >= 0) { x -= real[k]; real.erase(real.begin() + j); k--; } if (x == 0) { bar = true; break; } } if (bar) break; } if (bar == false) { tru = false; break; } } if (tru) cout << "YES"; else cout << "NO"; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Correct | 1 ms | 364 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Correct | 1 ms | 364 KB | Output is correct |
5 | Correct | 1 ms | 364 KB | Output is correct |
6 | Correct | 0 ms | 364 KB | Output is correct |
7 | Correct | 0 ms | 364 KB | Output is correct |
8 | Correct | 1 ms | 364 KB | Output is correct |
9 | Correct | 1 ms | 364 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Correct | 1 ms | 364 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Correct | 1 ms | 364 KB | Output is correct |
5 | Correct | 1 ms | 364 KB | Output is correct |
6 | Correct | 0 ms | 364 KB | Output is correct |
7 | Correct | 0 ms | 364 KB | Output is correct |
8 | Correct | 1 ms | 364 KB | Output is correct |
9 | Correct | 1 ms | 364 KB | Output is correct |
10 | Incorrect | 1 ms | 364 KB | Output isn't correct |
11 | Halted | 0 ms | 0 KB | - |