Submission #90511

#TimeUsernameProblemLanguageResultExecution timeMemory
90511daniel_02Bank (IZhO14_bank)C++14
19 / 100
61 ms504 KiB
#include <bits/stdc++.h> #define fr first #define pb push_back #define sc second #define ll long long using namespace std; int b[27]; main() { int n, m, x; cin >> n >> m; cin >> x; if (n > 1) { puts("NO"); return 0; } for (int i = 1; i <= m; i++) { scanf("%d", &b[i]); } for (int msk = 1; msk < (1 << m); msk++) { int sm = 0; for (int i = 0; i < m; i++) { if (msk & (1 << i)) { sm += b[i + 1]; } } if (sm == x) { puts("YES"); return 0; } } puts("NO"); }

Compilation message (stderr)

bank.cpp:12:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main()
      ^
bank.cpp: In function 'int main()':
bank.cpp:28:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &b[i]);
   ~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...