Submission #1059121

#TimeUsernameProblemLanguageResultExecution timeMemory
1059121jamjanekCity (JOI17_city)C++14
Compilation error
0 ms0 KiB
#include "Encoder.h" #include<bits/stdc++.h> using namespace std; vector<int>graf[250010]; int preorder[250010], post[250010], preit, postit; int r[250010]; vector<int>rozmiary; void dfs(int x, int o){ preorder[x]=preit++; for(auto j: graf[x]) if(j!=o){ dfs(j, x); r[x]+=r[j]+1; } int pom = *lower_bound(rozmiary.begin(), rozmiary.end(), r[x]); preit+=pom-r[x]; r[x]+=pom-r[x]; } void Encode(int n, int A[], int B[]) { rozmiary.push_back(0); while(rozmiary.size()<=20){ rozmiary.push_back(max(rozmiary.back()+1, int(2*rozmiary.back()))); } int i; for(i=0;i<n-1;i++){ graf[A[i]].push_back(B[i]); graf[B[i]].push_back(A[i]); } dfs(0,-1); // for(int i=0;i<n;i++) // printf("%d: %d %d %d\n", i, preorder[i], r[i], int(lower_bound(rozmiary.begin(), rozmiary.end(), r[i])-rozmiary.begin())); for (int i = 0; i < n; ++i) { Code(i, preorder[i]*rozmiary.size()+int(lower_bound(rozmiary.begin(), rozmiary.end(), r[i])-rozmiary.begin())); } }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccGNk1Yp.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