# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1164265 | OI_Account | City (JOI17_city) | C++20 | 91 ms | 9796 KiB |
#include "Encoder.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 250'000;
const int T1 = 20;
const int T2 = 10;
static int n, ans[N + 10], len[N + 10];
static int k, x[N + 10], sum[N + 10];
static vector<int> adj[N + 10];
void calcX() {
for (int i = 1; i <= 30; i++)
x[i] = i;
k = 30;
while (x[k] < (1 << T1)) {
x[k + 1] = (x[k] * 27) / 26;
k++;
}
}
void dfsLen(int u = 1, int par = 0) {
int t = 1;
for (auto v: adj[u])
if (v != par) {
dfsLen(v, u);
sum[v] += t;
t += x[len[v]];
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |