# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
485692 | qwerasdfzxcl | Regions (IOI09_regions) | C++14 | 3475 ms | 54396 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> adj[200200], S[25025], dfn[25025], S2[25025], dfn2[25025], P[25025];
int a[200200], in[200200], out[200200], cnt;
map<int, ll> ans[25025];
void dfs(int s){
in[s] = ++cnt;
S[a[s]].push_back(S[a[s]].back()+1);
dfn[a[s]].push_back(in[s]);
S2[a[s]].push_back(S2[a[s]].back()+1);
dfn2[a[s]].push_back(in[s]);
P[a[s]].push_back(s);
for (auto &v:adj[s]) dfs(v);
out[s] = ++cnt;
S[a[s]].push_back(S[a[s]].back()-1);
dfn[a[s]].push_back(out[s]);
}
int main(){
int n, r, q;
scanf("%d %d %d", &n, &r, &q);
scanf("%d", a+1);
for (int i=2;i<=n;i++){
int x;
scanf("%d %d", &x, a+i);
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |