Submission #201982

#TimeUsernameProblemLanguageResultExecution timeMemory
201982SegtreeCats or Dogs (JOI18_catdog)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include"catdog.h" using namespace std; typedef long long ll; typedef vector<ll> vll; #define chmax(a,b) a=max(a,b) #define chmin(a,b) a=min(a,b) #define all(x) x.begin(),x.end() #define rep(i,n) for(int i=0;i<n;i++) #define mod 1000000007 #define mad(a,b) a=(a+b)%mod ll N; vector<ll> g[1010]; ll dp[1010][2],col[1010]; void dfs(ll x,ll from){ rep(k,2)dp[x][k]=1e9; if(col[x]!=1)dp[x][0]=0; if(col[x]!=0)dp[x][1]=0; for(auto y:g[x])if(y!=from){ dfs(y,x); dp[x][0]+=min(dp[y][0],dp[y][1]+1); dp[x][1]+=min(dp[y][0]+1,dp[y][1]); } } ll solve(){ dfs(1,0); return min(dp[1][0],dp[1][1]); } ll cat(ll v){ col[v]=0; return solve(); } ll dog(ll v){ col[v]=1; return solve(); } ll neighbor(ll v){ col[v]=2; return solve(); } void initalize(ll n,vll a,vll b){ rep(i,n-1){ g[a[i]].push_back(b[i]); g[b[i]].push_back(a[i]); } for(int i=1;i<=n;i++)col[i]=2; } /*int main(){ }*/

Compilation message (stderr)

/tmp/ccGmCpak.o: In function `main':
grader.cpp:(.text.startup+0x157): undefined reference to `initialize(int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
grader.cpp:(.text.startup+0x1b1): undefined reference to `neighbor(int)'
grader.cpp:(.text.startup+0x1ee): undefined reference to `dog(int)'
grader.cpp:(.text.startup+0x1f9): undefined reference to `cat(int)'
collect2: error: ld returned 1 exit status