Submission #960407

#TimeUsernameProblemLanguageResultExecution timeMemory
960407okkooBank (IZhO14_bank)C++17
0 / 100
1 ms604 KiB
#include <iostream> using namespace std; #define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int main(){ fastIO; int n, m; cin >> n >> m; int a[n], b[m]; for(int i=0; i<n; i++) cin >> a[i]; for(int i=0; i<m; i++) cin >> b[i]; for(int i=1; i<(1<<m); i++){ int cur = 0; for(int j=0; j<m; j++){ if(i&(1<<j)) cur += a[j]; } if(cur==a[0]){ cout << "YES" << '\n'; return 0; } } cout << "NO" << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...