제출 #1119720

#제출 시각아이디문제언어결과실행 시간메모리
1119720tsengang은행 (IZhO14_bank)C++14
19 / 100
68 ms504 KiB
#include <bits/stdc++.h> #define ll long long #define ff first #define ss second #define all(x) x.begin(), x.end() #define pb push_back #define ertunt return #define vodka void using namespace std; int main(){ ll n,m; cin >> n >> m; ll a; cin >> a; ll b[m+1]; for(ll j = 1; j <= m; j++)cin >> b[j]; for(ll i = 1; i <= (1<<m); i++){ ll res = 0; for(ll j = 0; j < m; j++){ if(i&(1<<j)){ res+=b[j]; } } if(res == a){ cout << "YES"; ertunt 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...