上一页 1 2 3 4 5 6 ··· 20 下一页
摘要: 1 #include 2 #define For(i,j,k) for(int i=j;i=k;i--) 4 #define LL long long 5 using namespace std ; 6 inline int read() { 7 int x = 0, f = 1; 8 char ch = getchar(); 9 while(ch'9... 阅读全文
posted @ 2018-02-12 20:38 third2333 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 洛谷P3018 [USACO11MAR]树装饰Tree Decoration树形DP 因为要求最小,我们就贪心地用每个子树中的最小cost来支付就行了 阅读全文
posted @ 2018-02-12 14:52 third2333 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 洛谷P2237 [USACO14FEB]自动完成Auto-completeTrie树 阅读全文
posted @ 2018-02-12 13:42 third2333 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 洛谷P2070 刷墙 离散化题意 区间覆盖 求覆盖了2次以上的线段有多少长 离散化一下,一条线段两个点,2n个点排序一下就行了 阅读全文
posted @ 2018-02-11 21:14 third2333 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #define For(i,j,k) for(int i=j;i=k;i--) 11 #define LL long long 12 using namespace std ; 13 ... 阅读全文
posted @ 2017-12-12 16:00 third2333 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 洛谷 P2979 [USACO10JAN]奶酪塔Cheese Towers 分两种状态 一种最上面有大奶酪 一种没有 阅读全文
posted @ 2017-11-09 15:57 third2333 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 洛谷P3124 [USACO15OPEN]被困在haybales(银)Trapped in the H… 一道二分题,首先我们左边增加,右边不变的情况 枚举右边的点,二分出右边不增加的话,左边最远可以延伸到那边 然后取这个区间中 pos[i]+h[i]最大的点 ,区间最大可以用st表,但因为右端点固 阅读全文
posted @ 2017-10-14 10:05 third2333 阅读(379) 评论(0) 推荐(0) 编辑
摘要: 洛谷P3030 [USACO11NOV]瓦交换Tile Exchangingf[i][j] 表示前i个物品,面积为j的最小代价然后i降维 阅读全文
posted @ 2017-10-13 13:55 third2333 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 洛谷P1475 控制公司 Controlling Companies 一种类似dijstra的算法 阅读全文
posted @ 2017-10-13 12:22 third2333 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 洛谷P2205 [USACO13JAN]画栅栏Painting the Fence这是我的做法,我用了离散化+二分,比较慢 其实差分就行了,不用二分 虽然时间复杂度也是 nlogn但是因为不用而二分了,所以快了不少大概快了300ms另外也可以用map直接水 阅读全文
posted @ 2017-10-13 07:58 third2333 阅读(202) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 20 下一页