# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
716371 | manizare | Cat in a tree (BOI17_catinatree) | C++14 | 11 ms | 9456 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define ll long long
using namespace std ;
const int maxn = 1520 ;
int dp[maxn][maxn] , n , d;
vector <int>G[maxn] ;
void dfs(int v){
for(int i =0 ; i < G[v].size() ; i++){
int u = G[v][i] ;
dfs(u) ;
}
dp[v][0] = 1;
int sum[d+10] ;
for(int i = 0 ; i <= d ; i++)sum[i] = 0 ;
for(int i =0 ; i < G[v].size() ; i++){
int u = G[v][i] ;
dp[v][0]+=dp[u][d-1] ;
for(int j = 0 ; j <= d ; j++){
sum[j+1] += dp[u][j] ;
}
}
for(int i =0 ; i < G[v].size() ; i++){
int u = G[v][i] ;
for(int j = (d+1) / 2 ; j <= d ; j++){
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |