![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法--动态规划--状压dp
妖怪吧
这个作者很懒,什么都没留下…
展开
-
BZOJ 1231: [Usaco2008 Nov]mixup2 混乱的奶牛
Time Limit: 10 Sec Memory Limit: 162 MB Submit: 1300 Solved: 763 [Submit][Status][Discuss] Description混乱的奶牛 [Don Piele, 2007] Farmer John的N(4 <= N <= 16)头奶牛中的每一头都有一个唯一的编号S_i (1 <= S_i ...原创 2018-07-17 19:00:13 · 121 阅读 · 0 评论 -
LUOGU P3092 [USACO13NOV]没有找零No Change
题目描述Farmer John is at the market to purchase supplies for his farm. He has in his pocket K coins (1 <= K <= 16), each with value in the range 1..100,000,000. FJ would like to make a sequence o...原创 2018-08-12 07:55:01 · 126 阅读 · 0 评论 -
LUOGU P3112 [USACO14DEC]后卫马克Guard Mark
题目描述Farmer John and his herd are playing frisbee. Bessie throws thefrisbee down the field, but it’s going straight to Mark the field handon the other team! Mark has height H (1 <= H <= 1,0...原创 2018-07-29 19:06:19 · 118 阅读 · 0 评论 -
LUGOU 3959 宝藏 (noip 2017 day2 T2)
传送门 解题思路去年noip现在拿来写。。思路还是听清楚的,记忆化搜索,f[S]表示现在选了集合S时的最小代价,dis[i]表示达到最优时i这个点的深度。f[S| (1< < i-1) ]=f[S]+a[i][j]*(dis[i]+1)代码#include<iostream>#include<cstdio>#include<...原创 2018-07-25 14:51:40 · 151 阅读 · 0 评论 -
LUOGU P2831 愤怒的小鸟 (NOIP 2016)
题面题解好像昨天wxl大爷讲的是O(Tn*2^n)的做法,后来没想通,就自己写了个O(Tn^2*2^n)的暴力状压,莫名其妙过了??数量级二十亿??懵逼,可能到了CCF老爷机上就T了。dp[S]表示现在猪的状态,然后枚举两只鸟,然后开炮。代码#include&amp;lt;bits/stdc++.h&amp;gt;using namespace std;const int ...原创 2018-06-19 11:50:33 · 217 阅读 · 0 评论 -
NOI2001 炮兵阵地 洛谷2704
题目描述司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用“H” 表示),也可能是平原(用“P”表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示:如果在地图中的灰色所标识的平原上部署一支炮兵部队,则图中的黑色的网格表示它能够攻击到的区...原创 2018-06-04 11:22:30 · 151 阅读 · 0 评论 -
BZOJ 1087(SCOI 2005) 互不侵犯
1087: [SCOI2005]互不侵犯KingTime Limit: 10 Sec Memory Limit: 162 MB Submit: 5333 Solved: 3101 [Submit][Status][Discuss] Description 在N×N的棋盘里面放K个国王,使他们互不攻击,共有多少种摆放方案。国王能攻击到它上下左右,以及左上 左下右上右下八个方向上...原创 2018-06-05 19:24:46 · 173 阅读 · 0 评论 -
poj 2411
DescriptionSquares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his ‘toilet series’ (where he had to use his toilet paper to draw on,...原创 2018-03-07 23:10:01 · 140 阅读 · 0 评论 -
LUOGU P3052 [USACO12MAR]摩天大楼里的奶牛Cows in a Skyscraper
题目描述A little known fact about Bessie and friends is that they love stair climbing races. A better known fact is that cows really don’t like going down stairs. So after the cows finish racing to the ...原创 2018-07-17 19:53:03 · 251 阅读 · 0 评论 -
poj 2288
传送门解题思路状压dp,记录路径条数,dp[S][i][j]表示状态为S,前一个点是i,再前一个点是j的最大值,然后在开个一样的数组记录方案数,时间复杂度O(2^n*n^2),注意要用long long,还有数据有一个点的情况。代码#include<iostream>#include<cstdio>#include<cstring>...原创 2018-09-16 14:50:17 · 171 阅读 · 0 评论