#include "Anthony.h"
#include "bits/stdc++.h"
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define sz(x) (int)x.size()
const int N = 2e4+5;
namespace sol1{
vector<int> res;
vector<int> patt = {1, 0, 0, 1, 1, 0};
vector<pair<int, int>> edges[N];
void dfs(int u, int p = -1, int cur = 0, int in = 0){
for(auto x : edges[u]){
if(x.ff == p) continue;
if(sz(edges[u]) == 2){
res[x.ss] = patt[in];
dfs(x.ff, u, res[x.ss], (in + 1) % 6);
} else {
res[x.ss] = cur ^ 1;
if(cur) dfs(x.ff, u, cur ^ 1, 0);
else dfs(x.ff, u, cur ^ 1, 0);
}
}
}
vector<int> Mark1(int n, int m, int a, int b, vector<int> u, vector<int> v){
res.resize(m);
for(int i=0;i<m;i++){
int a = u[i] + 1, b = v[i] + 1;
edges[a].pb({b, i}), edges[b].pb({a, i});
res[i] = -1;
}
edges[1].pb({-1, -1});
dfs(1);
//~ for(int i=0;i<m;i++) cout<<res[i]<<" ";
//~ cout<<"\n";
return res;
}
}
namespace sol2{
vector<int> Mark2(int n, int m, int a, int b, vector<int> u, vector<int> v){
return {};
}
}
vector<int> Mark(int n, int m, int a, int b, vector<int> u, vector<int> v) {
if(a == 2) {
return sol1::Mark1(n, m, a, b, u, v);
} else {
return sol2::Mark2(n, m, a, b, u, v);
}
}
Compilation message
/usr/bin/ld: /tmp/cc1BWyqO.o: in function `main':
grader_catherine.cpp:(.text.startup+0x41c): undefined reference to `Init(int, int)'
/usr/bin/ld: grader_catherine.cpp:(.text.startup+0xcfa): undefined reference to `Move(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status