Submission #97374


Source Code Expand

Copy
#include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
//--
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<cstdio>
#include<cstring>
#include<sstream>
#define X first
#define Y second
#define pb push_back
#define pqPair priority_queue<pair<int,int>,vector<pair<int,int> >,greater<pair<int,int> > >


using namespace std;
typedef __int64 ll;

bool scores[6000];
int n,num;

int main(){
  scanf("%d",&n);
  int i,j;

  scores[0]=1;

  for(i=0;i<n;i++){
    scanf("%d",&num);
    for(j=5050;j>=0;j--){
      if(scores[j]){
        scores[j+num]=1;
      }
    }
  }

  int ans=0;
  for(j=0;j<=5050;j++){
    if(scores[j]){
      ans++;
    }
  }

  cout<<ans<<endl;
  return 0;
}

Submission Info

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

Compile Error

./Main.cpp:27:9: error: ‘__int64’ does not name a type
./Main.cpp: In function ‘int main()’:
./Main.cpp:33:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
./Main.cpp:39:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]