Submission #5436060


Source Code Expand

#include<bits/stdc++.h>
using namespace std;


signed main()
{
  int N;
  cin >> N;
  int M=N*100;
  vector<int> p(N);
  vector<bool> dp(M);
  for(int i=0; i<N; i++) cin >> p[i];

  dp[0] = true;
  for(int i=0; i<N; i++) for(int j=M-p[i]-1; j>=0; j--)
    dp[j+p[i]] = dp[j+p[i]] || dp[j];

  cout << count(dp.begin(), dp.end(), true) << endl;

  return 0;
}

Submission Info

Submission Time
Task A - コンテスト
User s4port
Language C++14 (GCC 5.4.1)
Score 2
Code Size 378 Byte
Status AC
Exec Time 3 ms
Memory 256 KB

Judge Result

Set Name All
Score / Max Score 2 / 2
Status
AC × 5
Set Name Test Cases
All 00, 01, 02, 90, 91
Case Name Status Exec Time Memory
00 AC 1 ms 256 KB
01 AC 2 ms 256 KB
02 AC 3 ms 256 KB
90 AC 1 ms 256 KB
91 AC 1 ms 256 KB