Submission #97373


Source Code Expand

Copy
#include<iostream>
#include<algorithm>
using namespace std;

int n,p[100];
bool dp[10100];

int main(){
  cin >> n;
  for(int i=0;i<n;i++)cin >> p[i];

  memset(dp,0,sizeof(dp));
  dp[0] = 1;

  for(int i=0;i<n;i++){
    for(int j=10000;j>=0;j--){
      if(dp[j])dp[j+p[i]] = 1;
    }
  }

  int ans = 0;
  for(int i=0;i<=10000;i++)
    if(dp[i])ans++;

  cout << ans << endl;
}

Submission Info

Submission Time
Task A - コンテスト
User Darsein
Language C++ (G++ 4.6.4)
Score 0
Code Size 405 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:12:25: error: ‘memset’ was not declared in this scope