Submission #650824

# Submission time Handle Problem Language Result Execution time Memory
650824 2022-10-15T13:34:53 Z jiahng Comparing Plants (IOI20_plants) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define int ll
typedef pair<int,int> pi;
typedef vector <int> vi;
typedef vector <pi> vpi;
typedef pair<pi, ll> pii;
typedef set <ll> si;
typedef long double ld;
#define f first
#define s second
#define mp make_pair
#define FOR(i,s,e) for(int i=s;i<=int(e);++i)
#define DEC(i,s,e) for(int i=s;i>=int(e);--i)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define lbd(x, y) lower_bound(all(x), y)
#define ubd(x, y) upper_bound(all(x), y)
#define aFOR(i,x) for (auto i: x)
#define mem(x,i) memset(x,i,sizeof x)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define maxn 200010
#define INF (ll)1e9
#define MOD 1000000007
typedef pair <vi, int> pvi;
typedef pair <int,pi> ipi;
typedef vector <pii> vpii;

unordered_map <int,int> dp[121];
int A[121],X,K;
int dpf(int i,int j){
    if (dp[i].find(j) != dp[i].end()) return dp[i][j];
    if (j == 0 && i > K) return 1;
    dp[i][j] = dpf(i+1,j/2+A[i+1]);
    if (j-X >= 0) dp[i][j] += dpf(i+1,(j-X) / 2 + A[i+1]);
    return dp[i][j];
}
long long count_tastiness(long long x, std::vector<long long> a) {
    K = a.size(); X = x;
    FOR(i,0,120) A[i] = 0;
    FOR(i,0,K-1) A[i] = a[i];
    FOR(i,0,120) dp[i].clear();
    return dpf(0,A[0]);
}

Compilation message

/usr/bin/ld: /tmp/ccqo5K0n.o: in function `main':
grader.cpp:(.text.startup+0x2fb): undefined reference to `init(int, std::vector<int, std::allocator<int> >)'
/usr/bin/ld: grader.cpp:(.text.startup+0x347): undefined reference to `compare_plants(int, int)'
collect2: error: ld returned 1 exit status