# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
526464 | PiejanVDC | Regions (IOI09_regions) | C++17 | 8055 ms | 131076 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
vector<int>top;
vector<int>adj[(int)2e5+5];
vector<int>region;
map<pair<int,int>,int>mp;
void dfs(int u, int e = -1) {
for(auto z : top) {
mp[{region[u],region[z]}]++;
}
top.push_back(u);
for(auto z : adj[u]) if(z != e) {
dfs(z,u);
}
top.pop_back();
}
signed main() {
int n,r,q; cin>>n>>r>>q;
region.resize(n);
int h; cin>>h; region[0] = h;
for(int i = 1 ; i < n ; i++) {
int s,h; cin>>s>>h;
s--;
adj[s].push_back(i);
region[i] = h;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |