Submission #1164267

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11642672025-03-09 09:51:30OI_AccountCity (JOI17_city)C++20
100 / 100
300 ms29568 KiB
#include "Encoder.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 250'000;
const int T1 = 19;
const int T2 = 9;
static int n, ans[N + 10], len[N + 10];
static int k, x[N + 10], sum[N + 10];
static vector<int> adj[N + 10];
static 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++;
}
}
static 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]];
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...