# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1100355 | vjudge1 | Regions (IOI09_regions) | C++17 | 1154 ms | 72520 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
int n,r,q,ly[200005],h[200005],dp[2505][2505];
vector<int>v[200005],c[200005];
void dfs(int x)
{
for(auto i:v[x])
{
if(ly[x]>ly[i])continue;
dfs(i);
if(h[x]!=h[i])dp[h[x]][h[i]]++;
for(int y=1;y<=r;y++)
{
if(h[i]==y||h[x]==y)continue;
dp[h[x]][y]+=dp[h[i]][y];
}
}
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cin>>n>>r>>q;
int hm,sp;
cin>>hm;
h[1]=hm;
c[hm].push_back(1);
for(int x=2;x<=n;x++)
{
cin>>sp>>hm;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |