제출 #1098157

#제출 시각아이디문제언어결과실행 시간메모리
1098157vjudge1은행 (IZhO14_bank)C++17
46 / 100
1 ms348 KiB
#include <bits/stdc++.h> #define int unsigned long using namespace std; signed main() { int n, m; cin >> n >> m; bool q=false; vector<int> a(n),ba(m); for(int i=0;i<n;i++){ cin >> a[i]; } for(int i=0;i<m;i++){ cin >> ba[i]; } vector<bool> dp(5000,false); dp[0]=true; for(int b : ba){ for(int j=5000;j>=b;j--){ if (dp[j-b]) { dp[j]=true; } } } for(int s : a){ if(!dp[s]){ cout << "NO"; return 0; } } cout << "YES"; }

컴파일 시 표준 에러 (stderr) 메시지

bank.cpp: In function 'int main()':
bank.cpp:9:14: warning: unused variable 'q' [-Wunused-variable]
    9 |         bool q=false;
      |              ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...