// High above the clouds there is a rainbow...
#include<bits/stdc++.h>
#include<Boblib.h>
#define F first
#define S second
#define PB push_back
#define sz(s) int((s).size())
#define bit(n,k) (((n)>>(k))&1)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int maxn=1111,lg=13;
static bool bad[maxn];
static int lab[maxn];
static vector<int>v[maxn];
static vector<pii>ans;
static void solve(int u,int bt=0){
bad[u]=1;
int nxt=-1;
for(int y:v[u]){
if(bad[y])
lab[y]+= (1<<bt);
else
nxt=y;
}
if(nxt!=-1) solve(nxt,bt+1);
}
void Bob(int n,int m,int a[],int b[]){
for(int i=0;i<m;i++)
v[a[i]].PB(b[i]), v[b[i]].PB(a[i]);
int w=0;
for(int i=0;i<n;i++){
if(sz(v[i])>sz(v[w])) w=i;
}
bad[w]=1;
for(int y:v[w]){
bad[y]=1;
}
for(int i=0;i<n;i++){
if(bad[i]) continue;
int C=0;
for(int y:v[i])
C+= !bad[y];
if(C==1 && sz(v[i])!=1) solve(i);
}
int N=0,M=0;
for(int i=0;i<m;i++){
if(lab[a[i]]!=0 && lab[b[i]]!=0)
ans.PB( { lab[a[i]]-1, lab[b[i]]-1 } ),M++;
}
for(int i=0;i<n;i++){
if(lab[i]!=0)
N++;
}
InitMap(N,M);
for(pii p:ans){
MakeMap(p.F,p.S);
}
}
// High above the clouds there is a rainbow...
#include<bits/stdc++.h>
#include<Boblib.h>
#define F first
#define S second
#define PB push_back
#define sz(s) int((s).size())
#define bit(n,k) (((n)>>(k))&1)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int maxn=1111,lg=13;
static bool bad[maxn];
static int lab[maxn];
static vector<int>v[maxn];
static vector<pii>ans;
static void solve(int u,int bt=0){
bad[u]=1;
int nxt=-1;
for(int y:v[u]){
if(bad[y])
lab[y]+= (1<<bt);
else
nxt=y;
}
if(nxt!=-1) solve(nxt,bt+1);
}
void Bob(int n,int m,int a[],int b[]){
for(int i=0;i<m;i++)
v[a[i]].PB(b[i]), v[b[i]].PB(a[i]);
int w=0;
for(int i=0;i<n;i++){
if(sz(v[i])>sz(v[w])) w=i;
}
bad[w]=1;
for(int y:v[w]){
bad[y]=1;
}
for(int i=0;i<n;i++){
if(bad[i]) continue;
int C=0;
for(int y:v[i])
C+= !bad[y];
if(C==1 && sz(v[i])!=1) solve(i);
}
int N=0,M=0;
for(int i=0;i<m;i++){
if(lab[a[i]]!=0 && lab[b[i]]!=0)
ans.PB( { lab[a[i]]-1, lab[b[i]]-1 } ),M++;
}
for(int i=0;i<n;i++){
if(lab[i]!=0)
N++;
}
InitMap(N,M);
for(pii p:ans){
MakeMap(p.F,p.S);
}
}
Compilation message
/tmp/cck9pbcE.o: In function `main':
grader_alice.cpp:(.text.startup+0xe0): undefined reference to `Alice(int, int, int*, int*)'
/tmp/cczdYvF4.o: In function `Bob(int, int, int*, int*)':
Alice.cpp:(.text+0x2da): undefined reference to `InitMap(int, int)'
Alice.cpp:(.text+0x302): undefined reference to `MakeMap(int, int)'
collect2: error: ld returned 1 exit status