随笔分类 -  算法-模拟

摘要:"传送门" Solution 好水的题(ーー;) Code cpp //By Menteur_Hxy include include include include include include include include include define Re register define M 阅读全文
posted @ 2018-10-11 18:16 Menteur_hxy 阅读(189) 评论(0) 推荐(0)
摘要:子串 "传送门" Solution $f[i][j][k]$表示A到i,B到j第k个子串的答案 $g[i][j][k]$表示A到i,B到j第k个子串且A[i]一定使用 $g[i][j][k]=(A[i]==B[j])?f[i 1][j 1][k 1]+g[i 1][j 1][k]:0$ $f[i][ 阅读全文
posted @ 2018-08-21 19:38 Menteur_hxy 阅读(170) 评论(0) 推荐(0)
摘要:原题:传送门大模拟… 两个剪枝: 1.如果左边不为空就不往左边走(因为一定不如左边的移到右边优) 2.如果相邻两颜色相同不需移动 当然也有别的小剪枝(我没写)比如如果当前某一颜色剩余块数满足1#include #include #define F(i,a,b) for... 阅读全文
posted @ 2018-05-19 14:47 Menteur_hxy 阅读(116) 评论(0) 推荐(0)