Submission #973883

#TimeUsernameProblemLanguageResultExecution timeMemory
973883Bilal_CoderBank (IZhO14_bank)C++17
46 / 100
63 ms436 KiB
#include<bits/stdc++.h> using namespace std; int main() { int n , m; scanf("%d %d" , &n , &m); vector<int> a(n) , b(m); for (auto & x : a)scanf("%d" , &x); for (auto & x : b)scanf("%d" , &x); for (auto x : a){ bool flag = false; 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]; if (sum == x){ flag = true; break; } } if (!flag){ puts("NO"); return 0; } } puts("YES"); }

Compilation message (stderr)

bank.cpp: In function 'int main()':
bank.cpp:6:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |     scanf("%d %d" , &n , &m);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~
bank.cpp:8:28: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |     for (auto & x : a)scanf("%d" , &x);
      |                       ~~~~~^~~~~~~~~~~
bank.cpp:9:28: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |     for (auto & x : b)scanf("%d" , &x);
      |                       ~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...