#include <bits/stdc++.h>
using namespace std;
#define vec vector
typedef int lli;
typedef pair<lli, lli> ii;
typedef vec<lli> vi;
typedef vec<ii> vii;
typedef vec<vi> vvi;
#define f first
#define s second
#define pb push_back
#define sz(v) (v).size()
#define mid lli((l + r)/2)
#define all(v) sort((v).begin(), (v).end())
#define rall(v) sort((v).rbegin(), (v).rend())
#define SL '\n'
#define fore(a,s,d) for(lli a = (s), asd = (d); a < asd; a++)
#define wd(a,s,d) for(lli a = (s), asd = (d); a > asd; a --)
#define _ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const lli NN = 1500;
vi pd = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048 };
void Alice(int N, int M, int A[], int B[]){
vi ans(N);
lli pp = 512 + N;
fore(i,0,N) ans[i] = pd[i];
fore(i,0,M){
lli a = A[i], b = B[i];
if(b > a) swap(a, b);
ans[a] += pd[b];
} {
lli mans = pp;
for(auto i: ans) mans += i;
InitG(1500, mans);
}
lli nw = 0;
lli pos = 0;
for(lli i = 0; i < N; i ++){
lli o = NN - i - 2;
while(ans[i]--){
MakeG(pos, o, nw);
nw ++, pos ++;
}
}
while(pp--){
MakeG(pos, 1499, nw);
nw ++, pos ++;
}
}
#include <bits/stdc++.h>
using namespace std;
#define vec vector
typedef int lli;
typedef pair<lli, lli> ii;
typedef vec<lli> vi;
typedef vec<ii> vii;
typedef vec<vi> vvi;
#define f first
#define s second
#define pb push_back
#define sz(v) (v).size()
#define mid lli((l + r)/2)
#define all(v) sort((v).begin(), (v).end())
#define rall(v) sort((v).rbegin(), (v).rend())
#define SL '\n'
#define fore(a,s,d) for(lli a = (s), asd = (d); a < asd; a++)
#define wd(a,s,d) for(lli a = (s), asd = (d); a > asd; a --)
#define _ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const lli NN = 1500;
vi pd = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048 };
void Bob(int V, int U, int C[], int D[]){
vi ans(V);
fore(i,0,U){
ans[C[i]] ++;
ans[D[i]] ++;
}
rall(ans);
// for(auto i: ans) cout << i << ' '; cout << SL;
lli nn = ans[0] - 512;
vii aristas;
for(lli i = nn-1; i >= 0; i --){
lli p = ans[nn - i];
// cout << i << ' '<< p << ' ';
p -= pd[i];
// cout << p << SL;
lli y = 0;
while(p){
if(p&1){
aristas.pb(ii({i, y}));
// cout << y << ' ';
}
// cout << "p: " << p << ' ';
p >>= 1; y ++;
}
// cout << SL;
}
InitMap(nn, sz(aristas));
for(auto i: aristas){
MakeMap(i.f, i.s);
}
}
Compilation message
Alice.cpp: In function 'void Alice(int, int, int*, int*)':
Alice.cpp:35:9: error: 'InitG' was not declared in this scope
35 | InitG(1500, mans);
| ^~~~~
Alice.cpp:42:13: error: 'MakeG' was not declared in this scope
42 | MakeG(pos, o, nw);
| ^~~~~
Alice.cpp:47:9: error: 'MakeG' was not declared in this scope
47 | MakeG(pos, 1499, nw);
| ^~~~~
Bob.cpp: In function 'void Bob(int, int, int*, int*)':
Bob.cpp:50:5: error: 'InitMap' was not declared in this scope
50 | InitMap(nn, sz(aristas));
| ^~~~~~~
Bob.cpp:52:9: error: 'MakeMap' was not declared in this scope
52 | MakeMap(i.f, i.s);
| ^~~~~~~