This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define EmirBey ios_base::sync_with_stdio(NULL);cin.tie(0);cout.tie(0);
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
using namespace std;
const int N = 200;
int n,m,a,b[N],used[N];
void get(int val , int pos){
if(val>a)return;
used[val]=1;
for(int i=pos ; i<m ; i++){
get(b[i]+val , i+1);
}
}
void putin()
{
cin>>n>>m>>a;
for(int i=1 ; i<=m ; i++)cin>>b[i];
for(int i=1 ; i<=n ; i++){
get(b[i] , i+1);
}
if(used[a])cout<<"NO\n";
else cout<<"YES\n";
}
signed main() {
EmirBey
int tt=1;
//cin>>tt;
while(tt--){
putin();
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |