Submission #1696240


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> pip;
const ll INF = 1e9+100;
const ll MOD = 1e9+7;
const double EPS = 1e-10;
const bool debug = 0;
//------------------------------//

int N;
int p[100];

int main() {
	cin >> N;
	REP(i, N) scanf("%d", p + i);
	
	bitset<10001> dp(1);
	
	REP(i, N) dp |= dp << p[i];
	
	cout << dp.count() << endl;
	
	return 0;
}

Submission Info

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

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:25:30: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  REP(i, N) scanf("%d", p + i);
                              ^

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 1 ms 256 KB
02 AC 1 ms 256 KB
90 AC 1 ms 256 KB
91 AC 1 ms 256 KB