摘要: 树形dp经典题 考虑只维护一个最长路会使得所选路径重复 因此可以再维护一个次长路来消除路径重复... 然后这题就结束了 #include<bits/stdc++.h> #define MAXN 10005 using namespace std; int n,tot; int h[MAXN],f[M 阅读全文
posted @ 2020-02-12 19:38 After_rain 阅读(90) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #define MAXN 105 using namespace std; int n,k,tot; int a[MAXN],h[MAXN]; int 阅读全文
posted @ 2020-02-12 16:17 After_rain 阅读(99) 评论(0) 推荐(0)
摘要: 没有上司的舞会....初一就做过了..... #include<bits/stdc++.h> #define MAXN 6005 using namespace std; int n,tot,ans; int a[MAXN],h[MAXN],in[MAXN],f[MAXN][3]; struct n 阅读全文
posted @ 2020-02-12 16:07 After_rain 阅读(127) 评论(0) 推荐(0)