Fire Net--hdu1045】的更多相关文章

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1045 Fire Net Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 8185    Accepted Submission(s): 4691 Problem Description Suppose that we have a squa…
http://acm.hdu.edu.cn/showproblem.php?pid=1045 Fire Net Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6756    Accepted Submission(s): 3829 Problem Description Suppose that we have a square ci…
Fire Net Problem Description Suppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or a piece of wall. A blockhouse is a small castle that has four openings t…
Fire Net Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15653    Accepted Submission(s): 9474 题目链接:acm.hdu.edu.cn/showproblem.php?pid=1045 Description: Suppose that we have a square city with s…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1045 Fire Net Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12920    Accepted Submission(s): 7840 Problem Description Suppose that we have a squa…
Fire Net Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17669    Accepted Submission(s): 10749 Problem Description Suppose that we have a square city with straight streets. A map of a city is a…
在一张地图上建立碉堡(X),要求每行没列不能放两个,除非中间有强挡着.求最多能放多少个碉堡 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #define N 5 using namespace std; int n,ans; char maps[N][N]; int judge(int x,int y) { int i; if(maps[x][y]=='X'…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1045 题目大意: 给你一幅n*n的图,再给你一些点,这些点的上下左右不能再放其他点,除非有墙('X')隔着,问最多可以放多少个这样的点. 思路: 由于n不大于4,最多16个点,想到可以二进制枚举子集,然后逐个判断每个子集的可行性. #include<iostream> #include<string> #include<vector> #include<cstdio&…
原题链接:点击!   大致题意:白块表示可以放置炮台的位置——每个炮台可以攻击到上下左右的直线上的炮台(也就是说在它的上下左右直线上不可以再放置炮台,避免引起互相攻击),黑块表示隔离墙的位置——不可放置并且可以阻挡炮火:求对于一个最大4*4的格子来说,最大的放置炮台的个数是多少. 简单分析: 简单的dfs();由于本题地图很小,不用考虑太多,尽情暴力即可.先把DFS枝干画出来,然后枝叶就用函数来具体实现. AC代码:(附注释) #include <iostream> #include<s…
题意 有一个 n*n 的图,. 代表空白区域,X 代表墙,现在要在空白区域放置结点,要求同一行同一列只能放一个,除非有墙阻隔,问最多能放多少个点 思路 只有在墙的阻隔情况下,才会出现一行/列出现多个点的情况,那么可以考虑进行缩点,将同一行且没有墙体阻隔的区域缩成一个点,放到左点集中,将同一列且没有墙体阻隔的区域缩成一个点,放到右点集中,从而建成一个二分图 假设 i 为行编号,j 为列编号,若 i-j 之间存在一条边,就相当于在方格 (i,j) 上放了一个点,这个假设使得在没有墙体阻隔的情况下,i…