제출 #1098108

#제출 시각아이디문제언어결과실행 시간메모리
1098108vjudge1은행 (IZhO14_bank)C++17
19 / 100
58 ms436 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int a; cin >> a; int b[20]; for(int i = 0; i < m; i++) { cin >> b[i]; } for(int j = 0; j < (1 << m); j++) { int k = 0; for(int i = 0; i < m; i++) { if(j & (1 << i)) { k += b[i]; } } if(k == a) { cout << "YES"; return 0; } } cout << "NO"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...