Submission #781678

#TimeUsernameProblemLanguageResultExecution timeMemory
781678rahidilbayramliBank (IZhO14_bank)C++17
19 / 100
66 ms340 KiB
#include<bits/stdc++.h> #define ll long long #define ld long double #define vi vector<int> #define vl vector<ll> #define all(v) v.begin(), v.end() #define pb push_back #define f first #define s second #define pii pair<int, int> #define pll pair<ll, ll> using namespace std; int main() { ll n, m, i, j, p = 1, k, q, sum = 0; cin >> n >> m; vl v(n); for(ll&h : v) cin >> h; vl a(m); for(ll&h : a) cin >> h; bool f = false; for(i = 0; i < (1 << m); i++) { sum = 0; for(j = 0; j < m; j++) { if((i & (1 << j)) != 0) sum += a[j]; } if(sum == v[0]) f = true; } if(f) cout << "YES\n"; else cout << "NO\n"; }

Compilation message (stderr)

bank.cpp: In function 'int main()':
bank.cpp:15:20: warning: unused variable 'p' [-Wunused-variable]
   15 |     ll n, m, i, j, p = 1, k, q, sum = 0;
      |                    ^
bank.cpp:15:27: warning: unused variable 'k' [-Wunused-variable]
   15 |     ll n, m, i, j, p = 1, k, q, sum = 0;
      |                           ^
bank.cpp:15:30: warning: unused variable 'q' [-Wunused-variable]
   15 |     ll n, m, i, j, p = 1, k, q, sum = 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...