Submission #725351

#TimeUsernameProblemLanguageResultExecution timeMemory
725351AndrijaMDetecting Molecules (IOI16_molecules)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; vector<long long>arr; long long n; long long dp[10005][10005]; long long f(long long idx,long long x,vector<long long>vec,long long mx,vector<long long>weight) { if(idx==n) { arr=vec; return 0; } if(dp[idx][x]!=-1)return dp[idx][x]; long long rez=0; rez=max(rez, f(idx+1,x,vec,mx,weight)); vector<long long>pom; pom=vec; pom.push_back(idx); if(x+weight[idx]<=mx) rez=max(rez, f(idx+1,x+weight[idx],pom,mx,weight)+weight[idx]); return dp[idx][x]=rez; } vector<long long> find_subset(long long l, long long u, vector<long long> w) { memset(dp,-1,sizeof dp); vector<long long>v; queue<long long>Q; n=w.size(); long long kol=f(0,0,v,u,w); if(kol<l) { arr.clear(); } return arr; }

Compilation message (stderr)

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