# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
627339 | clams | Regions (IOI09_regions) | C++17 | 8095 ms | 34632 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int R = 25e3 + 5;
const int Q = 2e5 + 5;
const int R1 = 505;
int n, r, q;
int home[N], par[N];
vector<int> adj[N];
vector<int> reg[R];
namespace sub1 {
map<int, int> mp[N];
int pre[R1][R1];
void dfs(int u, int p) {
for (int v : adj[u]) {
if (v == p) continue;
dfs(v, u);
if (mp[u].size() < mp[v].size()) swap(mp[u], mp[v]);
for (auto i : mp[v]) mp[u][i.first] += i.second;
}
for (auto i : mp[u]) {
pre[home[u]][i.first] += i.second;
}
mp[u][home[u]]++;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |