摘要: dp。状态转移方程在代码里 #include #include #include using namespace std; const int maxn = 100 + 10; int a[maxn][3]; int f[maxn][maxn][maxn]; int s[maxn],s2[maxn][3]; int n,m,k; int main() { scanf("%d%d... 阅读全文
posted @ 2016-05-01 21:22 invoid 阅读(119) 评论(0) 推荐(0) 编辑
摘要: dp。转移方程在代码里。。 阅读全文
posted @ 2016-05-01 21:21 invoid 阅读(90) 评论(0) 推荐(0) 编辑
摘要: dp。 状态转移方程题解稳。 #include #include #include using namespace std; const int maxn = 100 + 10; int a[maxn][3]; int f[maxn][maxn][maxn]; int s[maxn],s2[maxn][3]; int n,m,k; int main() { scanf("%d... 阅读全文
posted @ 2016-05-01 21:19 invoid 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 块状链表。维护一个点f[i]次能到达下一个块,和到哪个位置。 #include #include using namespace std; const int maxn = 400000 + 100; int k[maxn],jump[maxn],st[maxn],belong[maxn],f[maxn]; int n,m,tot=1; void build() { scanf("... 阅读全文
posted @ 2016-05-01 21:16 invoid 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 动态规划. 首先,如果一个强连通分量的一个点在子图里,这个强连通分量所有点都在子图。所以先用tarjan算法求出强连通分量,缩点,当成一个点来处理。然后进行俩次动态规划就行了,注意判重边。 #include #include #include #include using namespace std; set > edge; const int maxn = 100000 + 10; c... 阅读全文
posted @ 2016-05-01 15:05 invoid 阅读(172) 评论(0) 推荐(0) 编辑