# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
929032 | dosts | Regions (IOI09_regions) | C++17 | 3976 ms | 127676 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#pragma GCC optimize("O3,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define sp << " " <<
//#define int long long
#define ff first
#define ss second
#define vi vector<int>
#define pii pair<int,int>
#define all(x) x.begin(),x.end()
const int N = 2e5+1,MOD = 998244353,B = 125,inf = 2e9,R = 25001;
vi c(N),edges[N],tin(N),tout(N);
vi occtin[R],ind(R);
int prec[B][N];
int timer = 1;
vi cc(B+1,0);
void dfs(int node,int p) {
tin[node] = timer++;
occtin[c[node]].push_back(tin[node]);
for (auto it : edges[node]) if (it != p) dfs(it,node);
tout[node] = timer-1;
}
void dfs2(int node,int p) {
if (ind[c[node]] < B) cc[ind[c[node]]]++;
for (int i=1;i<B;i++) prec[i][c[node]]+=cc[i];
for (auto it : edges[node]) if (it != p) dfs2(it,node);
if (ind[c[node]] < B) cc[ind[c[node]]]--;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |