#ifdef LOCAL
#else
#include "doll.h"
#endif
#include <bits/stdc++.h>
#define fi first
#define se second
#define ssize(x) int(x.size())
#define pn printf("\n")
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
int inf = 2e09; ll infll = 2e18;
void create_curcuit(int m, vector<int> t){
t.emplace_back(0); int n = ssize(t);
vector<int> c(m+1);
int base = 1, log = 0;
while(base < n) base <<= 1, ++log;
while(ssize(t) != base) t.emplace_back(-1);
vector<int> tmp0, tmp1;
for(int len = base; len > 2; len >>= 1){
for(int p = 0; p < base; p += len){
tmp0 = vector<int>(), tmp1 = vector<int>();
for(int i = p; i < p+len; ++i) if(i&1) tmp1.emplace_back(t[i]);
else tmp0.emplace_back(t[i]);
for(int i = 0; i < len/2; ++i) t[i+p] = tmp0[i];
for(int i = len/2; i < len; ++i) t[i+p] = tmp1[i-len/2];
}
}
for(int i = 0; i < base; ++i) if(t[i] == 0){ swap(t[i], t[base-1]); break; }
vector<int> X, Y;
for(int i = 1; i < base/2; ++i) X.emplace_back(-(i<<1)), Y.emplace_back(-(i<<1|1));
for(int i = base/2; i < base; ++i) X.emplace_back(t[(i<<1)-base]), Y.emplace_back(t[(i<<1|1)-base]);
for(int i = 0; i <= m; ++i) c[i] = -1;
#ifdef LOCAL
for(int i = 0; i < ssize(X); ++i) printf("%d %d\n", X[i], Y[i]);
#else
answer(c, X, Y);
#endif
}
#ifdef LOCAL
int main(){
int T = 1;
for(++T; --T; ){
int m, n; scanf("%d%d", &m, &n);
vector<int> A(n);
for(int i = 0; i < n; ++i) scanf("%d", &A[i]);
create_curcuit(m, A);
}
return 0;
}
#endif
Compilation message
/usr/bin/ld: /tmp/cc0Xu9vp.o: in function `main':
grader.cpp:(.text.startup+0x168): undefined reference to `create_circuit(int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status