Submission #656371

#TimeUsernameProblemLanguageResultExecution timeMemory
656371the_ilyasBank (IZhO14_bank)C++14
Compilation error
0 ms0 KiB
#include <iostream> #include <vector> using namespace std; #define ff first #define ss second #define pb push_back #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() const int N = 100001; int dp[N]; signed main(){ ios::sync_with_stdio(0); cin.tie(0); int n, m; cin >> n >> m; int A[n]; for(int i = 0; i < n; i++) { cin >> A[i]; } int M[m]; for(int i = 0; i < m; i++) cin >> M[i]; dp[0] = 1; for(int i = 1; i <= 10000; i++) { for(int j = 0; j < m; j++) { if(i - M[j] >= 0) { dp[i] = dp[i - M[j]]; } } } if(accumulate(dp, dp + N, 0) == n) cout << "YES"; else cout << "NO"; return 0; }

Compilation message (stderr)

bank.cpp: In function 'int main()':
bank.cpp:35:5: error: 'accumulate' was not declared in this scope
   35 |  if(accumulate(dp, dp + N, 0) == n)
      |     ^~~~~~~~~~