# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
118379 | Mamnoon_Siam | City (JOI17_city) | C++17 | 545 ms | 66536 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;
const double R = 1.054;
const int maxn = 2.5e5 + 5;
int tym = 0;
vector<int> lg, g[maxn];
int length(int x) {
return *lower_bound(lg.begin(), lg.end(), x); }
int Log(int x) {
return lower_bound(lg.begin(), lg.end(), x) - lg.begin(); }
void dfs(int u, int p) {
int L = tym++;
for(int v : g[u]) if(v != p) {
dfs(v, u);
}
tym = L + length(tym - L);
Code(u, L << 8 | Log(tym - L));
}
void Encode(int N, int A[], int B[]) {
{
lg.clear();
double p = 1;
while(p < 1000000000.0) {
lg.emplace_back(floor(p));
p *= R;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |