Submission #6415114


Source Code Expand

#include<bits/stdc++.h>
#define debug(x) cerr << #x << ':' << x << endl
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define ALL(c) (c).begin(), (c).end()
using namespace std;
typedef long long ll;

int main(){
    int n;
    cin >> n;
    vector<int> P(n,0);
    REP(i,n) cin >> P[i];

    set<int> cnt{0};
    for(int use = 0; use<n; use++){
        set<int> cnt_tmp{};
        for(auto num : cnt){
            cnt_tmp.insert(num+P[use]);
        }
        for(auto num : cnt_tmp){
            cnt.insert(num);
        }
    }
    cout << cnt.size() << endl;

    return 0;
}

Submission Info

Submission Time
Task A - コンテスト
User Nifuji
Language C++14 (Clang 3.8.0)
Score 0
Code Size 601 Byte
Status CE

Compile Error

./Main.cpp:1:9: fatal error: 'bits/stdc++.h' file not found
#include<bits/stdc++.h>
        ^
1 error generated.