제출 #1106944

#제출 시각아이디문제언어결과실행 시간메모리
1106944vjudge1은행 (IZhO14_bank)C++17
19 / 100
75 ms460 KiB
#include <bits/stdc++.h> #define pb push_back #define pf push_front #define F first #define S second #define int long long #define all(x) (x).begin(),(x).end() #define webbly ios_base::sync_with_stdio(0);cin.tie(0); using namespace std; typedef long long ll; const int maxn = 3e5 + 5; const int mod = 1e9 + 7; int n,m,a[1001],b[1001]; void sayat_apni_eksperta(){ cin >> n >> m; for(int i = 1; i <= n; i++){ cin >> a[i]; } for(int i = 1; i <= m; i++){ cin >> b[i]; } for(int mask = 0; mask < (1 << m); mask++){ int sum = 0; for(int i = 0; i < m; i++){ if(mask & (1 << i)){ sum += b[i + 1]; } } if(sum == a[1]){ cout << "YES"; return; } } cout << "NO"; } signed main(){ /* freopen("pieaters.in", "r", stdin); freopen("pieaters.out", "w", stdout); */ webbly int tt = 1; //cin >> tt; while(tt--) sayat_apni_eksperta(); return 0; } /* */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...