제출 #1098130

#제출 시각아이디문제언어결과실행 시간메모리
1098130vjudge1은행 (IZhO14_bank)C++17
19 / 100
67 ms460 KiB
#include<bits/stdc++.h>
#define pb push_back
#define int long long
#define S second
#define F first
#define ahah ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;

const int N=1e6+7;
const int MOD=1e9+7;

int a[N];

signed main() {
	ahah
	int n,m;
	cin >> n >> m;
	int x;
	cin >> x;
	for(int i = 1 ; i <= m ; i++){
		cin >> a[i];
	}
	for(int i = 0 ; i < (1 << m) ; i++){
		int cnt=0;
		for(int j = 0 ; j < m ; j++){
			if(i&(1 << j)){
				cnt+=a[j+1];
			}
		}
		if(cnt == x){
			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...