Submission #304409

# Submission time Handle Problem Language Result Execution time Memory
304409 2020-09-21T09:39:33 Z Masalmah Packing Biscuits (IOI20_biscuits) C++14
Compilation error
0 ms 0 KB
#include "biscuits.h"
#include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(), (v).end()
#define int long long
#define sz(v) (int)(v).size()
#define mod 998244353

int count_tastiness(int x, vector<int> &v) {
        const int N= 100001;
        int k= v.size();
        int dp[N]= {0};
        dp[0]= 1;
        for (int i= 0; i< k; i++) {
                int cnt= (1<< i);

                for (int kk= 0; kk< N; kk++) {
                        if (dp[kk]==(i+ 1)) {
                                for (int j= 1; j<= v[i]; j++){
                                       if(dp[kk+ (j* cnt)]== 0)
                                                dp[kk+ (j* cnt)]= i+ 2;
                                }
                        }
                }

        }

        int an= 0;
        for (int i= 0; i< N; i++) if (dp[i]) an++;
        return an;
}

Compilation message

/tmp/cc2Cv98g.o: In function `main':
grader.cpp:(.text.startup+0x423): undefined reference to `count_tastiness(long long, std::vector<long long, std::allocator<long long> >)'
collect2: error: ld returned 1 exit status