제출 #656371

#제출 시각아이디문제언어결과실행 시간메모리
656371the_ilyas은행 (IZhO14_bank)C++14
컴파일 에러
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;
}

컴파일 시 표준 에러 (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)
      |     ^~~~~~~~~~