Submission #414786

#TimeUsernameProblemLanguageResultExecution timeMemory
414786amoo_safarCity (JOI17_city)C++17
Compilation error
0 ms0 KiB
#include "Encoder.h" #include <bits/stdc++.h> using namespace std; const int N = 29e4; const int bl = 125; const int sd = 8585; int mk[N]; mt19937 rng(sd); vector<int> V; vector<int> G[N]; int st[N], fn[N], T = 0; void DFS(int u, int p){ st[u] = T ++; shuffle(G[u].begin(), G[u].end(), rng); for(auto adj : G[u]) if(adj != p) DFS(adj, u); fn[u] = T; while(mk[fn[u] - st[u] ] == -1){ fn[u] ++; T ++; } // cerr << "!! " << u << ' ' << st[u] << ' ' << fn[u] << '\n'; } void Encode(int _n, int A[], int B[]){ memset(mk, -1, sizeof mk); int cnt = 0; for(int i = 1; i < N; i++){ int pr = (i + bl - 1) / bl; // if(i > N / 2) pr += pr; uniform_int_distribution<> Amoo(1, pr); if(Amoo(rng) == 1){ mk[i] = V.size(); V.push_back(i); } } int sz = V.size(); for(int i = 0; i < _n - 1; i++) G[A[i]].push_back(B[i]), G[B[i]].push_back(A[i]); T = 0; DFS(0, -1); cerr << "! " << V.size() << '\n'; // for(int i = 0; i < _n; i++) // cerr << "! " << st[i] << ' ' << fn[i] << '\n'; for(int i = 0; i < _n; i++){ Code(i, 1ll * sz * st[i] + mk[fn[i] - st[i]]); } }

Compilation message (stderr)

Encoder.cpp: In function 'void Encode(int, int*, int*)':
Encoder.cpp:34:6: warning: unused variable 'cnt' [-Wunused-variable]
   34 |  int cnt = 0;
      |      ^~~

/usr/bin/ld: /tmp/ccbCOuQS.o: in function `main':
grader_device.cpp:(.text.startup+0xf8): undefined reference to `InitDevice()'
/usr/bin/ld: grader_device.cpp:(.text.startup+0x19b): undefined reference to `Answer(long long, long long)'
collect2: error: ld returned 1 exit status