Submission #1164265

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11642652025-03-09 09:46:25OI_AccountCity (JOI17_city)C++20
8 / 100
91 ms9796 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]];
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...