Submission #879119

#TimeUsernameProblemLanguageResultExecution timeMemory
879119YassirSalamaBank (IZhO14_bank)C++17
19 / 100
1 ms348 KiB
#include <iostream> #include <vector> #include <algorithm> #include <unordered_map> #include <set> #include <unordered_set> #include <iomanip> #include <cmath> #include <limits> #include <map> #include <utility> #include <cctype> #include <string> #include <cstring> #include <stack> #include <queue> #include<assert.h> #include <functional> #include <iterator> using namespace std; #define OVL(x,s) for(auto y:x) cout<<y<<s; cout<<"\n"; void dbg_out() { cout << endl; } template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cout << ' ' << H; dbg_out(T...); } #define dbg(...) cout << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__); #define endl "\n" #define pb push_back #define F first #define S second #define ll long long #define mod 1000000007 #define all(v) v.begin(),v.end() #define int long long signed main(){ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); int n,m; cin>>n>>m; int x; cin>>x; vector<int> v; for(int i=0;i<m;i++){ int y; cin>>y; v.pb(y); } sort(all(v)); bool dp[x+100]; memset(dp,0,sizeof(dp)); dp[0]=true; for(int i=0;i<m;i++){ for(int j=x+1;j>=v[i];j--){ dp[j]|=dp[j-v[i]]; } } if(dp[x]) cout<<"YES"<<endl; else cout<<"NO"<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...