![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
状压DP
creator平
期望破茧成蝶时的飞翔,向往突破蝉蛹后的鸣叫。
展开
-
POJ - 1185——炮兵阵地 (状压DP)
题目链接:http://poj.org/problem?id=1185思路:dp【i】【j】【k】,i表示当前行数,j表示状态,k表示上一个状态。#include<algorithm>#include<string.h>#include<stdio.h>#include<vector>using namespace std;int...原创 2019-04-09 17:21:27 · 102 阅读 · 0 评论 -
HDU - 1438——钥匙计数之一 (状压DP)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1438思路:dp【i】【j】【k】【flag】:i代表第i个槽,j表示状态,k表示最后一个槽的深度,flag表示是否满足有两个相邻槽深度差为3#include<algorithm>#include<string.h>#include<stdio.h>u...原创 2019-04-09 20:24:00 · 201 阅读 · 0 评论 -
CCPC-Wannafly & Comet OJ 夏季欢乐赛(2019)-G 篮球校赛(状压DP)
题目链接:https://cometoj.com/contest/59/problem/G?problem_id=2697思路:dp[i][j],i表示前i个人,j变成二进制后,为1的位置表示这个位置有人打了#include<string.h>#include<stdio.h>#include<algorithm>using namespace ...原创 2019-07-30 09:21:03 · 117 阅读 · 0 评论 -
UVA - 11825 ——Hackers' Crackdown (状压DP)
题目链接:https://vjudge.net/problem/UVA-11825思路:每个电脑与它相邻的电脑都看成一个集合,求包含所有电脑的最多集合 dp[s]=max(dp[s],dp[s^s0]+1) s0能形成一个全集的情况下#include<string.h>#include<stdio.h>#include<algor...原创 2019-08-05 18:22:12 · 160 阅读 · 0 评论