# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
501509 | Joo | Regions (IOI09_regions) | C++17 | 8073 ms | 46772 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5+10, BLOCK = 2e5+10, MR = 25010;
int n, R, Q, tin[N], tout[N], sz[N], re[N], cnt[MR], ti;
vector<int> ans[MR]; //stores answer for big regions(precompute)
vector<int> lis[MR], G[N], ch[N]; //lis[i] denotes a list of those whose region is i sorted by tin[i]
inline void add(int p, int u){
ch[p].emplace_back(u);
cnt[re[u]]++;
}
inline bool isbig(int r){
return ((int)lis[r].size() > BLOCK);
}
inline bool isAnc(int p, int u){
return (tin[p] <= tin[u] and tout[u] <= tout[p]);
}
void dfs1(int u){
sz[u] = 1;
lis[re[u]].emplace_back(u);
tin[u] = ++ti;
for(int v : G[u]) dfs1(v), sz[u] += sz[v];
tout[u] = ti;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |