Submission #1106096

#TimeUsernameProblemLanguageResultExecution timeMemory
1106096akzytrBank (IZhO14_bank)C++17
19 / 100
1 ms592 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define arr array #define vec vector #define sz(a) ((int)(a).size()) void B() { /* Problem B: Bank Subtask 1: n = 1, Normal knapsack, 1000 */ int N, M; cin >> N >> M; int a[N]; int b[M]; for(int i = 0; i < N; i++) { cin >> a[i]; } for(int i = 0; i < M; i++) { cin >> b[i]; } assert(N = 1); assert(M <= 20); bitset<(int)2e4> g; g[0] = 1; for(int i : b) { g |= (g << i); } cout << (g[a[0]] ? "YES" : "NO") << endl; } int main() { B(); }

Compilation message (stderr)

In file included from /usr/include/c++/10/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:33,
                 from bank.cpp:1:
bank.cpp: In function 'void B()':
bank.cpp:25:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   25 |  assert(N = 1);
      |         ~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...