# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
934110 | Juanchoki | City (JOI17_city) | C++14 | 269 ms | 64140 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 <vector>
#include <iostream>
using namespace std;
static const int maxn = 1<<20;
static vector<int> adj[maxn];
static int ini[maxn], fin[maxn];
static int pos = 1;
static int tam[maxn];
static int dfs(int yo, int pa)
{
ini[yo] = pos++;
int cnt = 1;
for (int v: adj[yo])
if (v != pa) cnt+=dfs(v, yo);
fin[yo] = pos-1;
return tam[yo] = cnt;
}
void Encode(int N, int A[], int B[])
{
//cout << "llama ";
vector<int> v;
for (int i = 0; i < N-1; ++i)
{
adj[A[i]].push_back(B[i]);
adj[B[i]].push_back(A[i]);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |