Submission #332933

#TimeUsernameProblemLanguageResultExecution timeMemory
332933YJUCats or Dogs (JOI18_catdog)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #pragma GCC optimize("unroll-loops,no-stack-protector") using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll,ll> pll; const ll MOD=1e9+7; const ll MOD2=998244353; const ll N=4e5+5; const ll K=350; const ld pi=acos(-1); const ll INF=(1LL<<60); #define SQ(i) ((i)*(i)) #define REP(i,n) for(ll i=0;i<n;i++) #define REP1(i,n) for(ll i=1;i<=n;i++) #define pb push_back #define mp make_pair #define X first #define Y second #define setp setprecision #define lwb lower_bound #define SZ(_a) (ll)_a.size() ll dp[N][3],col[N]; vector<ll> v[N]; void DFS(ll nd,ll pa){ for(auto i:v[nd]){ if(i==pa)continue; DFS(i,nd); dp[nd][1]+=min(dp[i][1],dp[i][2]+1); dp[nd][2]+=min(dp[i][2],dp[i][1]+1); } if(col[nd]){dp[nd][3-col[nd]]=INF;} } void initialize(ll n,vector<ll> a,vector<ll> b){ REP(i,n-1)v[a[i]].pb(b[i]),v[b[i]].pb(a[i]); } ll cat(ll id){ col[id]=1; DFS(1,0); return min(dp[1][1],dp[1][2]); } ll dog(ll id){ col[id]=2; DFS(1,0); return min(dp[1][1],dp[1][2]); } ll neighbor(ll id){ col[id]=0; DFS(1,0); return min(dp[1][1],dp[1][2]); }

Compilation message (stderr)

/tmp/cc1i3SPF.o: In function `main':
grader.cpp:(.text.startup+0x15b): undefined reference to `initialize(int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
grader.cpp:(.text.startup+0x1a9): undefined reference to `neighbor(int)'
grader.cpp:(.text.startup+0x1ea): undefined reference to `dog(int)'
grader.cpp:(.text.startup+0x2b1): undefined reference to `cat(int)'
collect2: error: ld returned 1 exit status