# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
427071 | tqbfjotld | City (JOI17_city) | C++14 | 274 ms | 48632 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "Encoder.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> chlist[250005];
int curnodes,n;
vector<int> adjl[250005];
const int numch = 3;
long long expp[250005];
int func(int node, int pa){
set<pair<int,int> > stuff;
for (auto x : adjl[node]){
if (x==pa) continue;
int res = func(x,node);
stuff.insert({res,x});
}
while (stuff.size()>numch){
int nw = curnodes++;
int mxv = -1;
for (int x = 0; x<numch; x++){
auto i = *stuff.begin();
stuff.erase(stuff.begin());
chlist[nw].push_back(i.second);
mxv = i.first;
}
stuff.insert({mxv+1,nw});
}
int mxv = -1;
for (auto x : stuff){
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |