Submission #19677236


Source Code Expand

Copy
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define vlli vector<ll>
#define vi vector<int>
#define vs vector<string>
#define vplli vector< pair< ll,ll> >
#define plli pair< ll,ll >
#define vps vector< pair< string, string> >
#define vpi vector< pair< int, int> >
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fast ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define forn(i,a,n) for(ll i=a;i<n;i++)
#define forr(i,n,a) for(ll i=n-1;i>=a;i--)
#define scan(arr,a,n) for(ll i=(a);i<(n);i++)cin>>(arr)[i];
#define print(arr,a,n) for(ll i=(a);i<(n);i++)cout<<(arr)[i]<<" ";

const ll inf = 1e18;

ll add(ll x, ll y) {ll res = x + y; return (res >= mod ? res - mod : res);}
ll mul(ll x, ll y) {ll res = x * y; return (res >= mod ? res % mod : res);}
ll sub(ll x, ll y) {ll res = x - y; return (res < 0 ? res + mod : res);}
ll power(ll x, ll y) {ll res = 1; x %= mod; while (y) {if (y & 1)res = mul(res, x); y >>= 1; x = mul(x, x);} return res;}
ll mod_inv(ll x) {return power(x, mod - 2);}


int main(){
    fast;
    #ifndef ONLINE_JUDGE
    freopen("input1.txt","r",stdin);
    freopen("output1.txt","w",stdout);
    #endif
    ll n;
    cin>>n;
    vlli a(n);
    scan(a, 0, n);
    bitset<10002> b;
    b[0]=1;
    for(auto x: a){
        b|=(b<<x);
    }
    ll ans = 0;
    forn(i, 1, 10002){
        ans+=b[i];
    }
    cout<<ans<<endl;
}

Submission Info

Submission Time
Task A - コンテスト
User sarthak74
Language C++ (GCC 9.2.1)
Score 0
Code Size 1575 Byte
Status WA
Exec Time 10 ms
Memory 3572 KB

Judge Result

Set Name All
Score / Max Score 0 / 2
Status
WA × 5
Set Name Test Cases
All 00, 01, 02, 90, 91
Case Name Status Exec Time Memory
00 WA 10 ms 3464 KB
01 WA 3 ms 3572 KB
02 WA 2 ms 3572 KB
90 WA 2 ms 3568 KB
91 WA 3 ms 3568 KB