在一张地图上建立碉堡(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 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…
#include<iostream> using namespace std; int count = 0, n = 0; //判断该ch[x][y]是否可以放置 bool isOk(char **ch, int x, int y){ int i; //向上检索 for (i = x - 1; i >=0; --i){ if(ch[i][y]=='0'){ return false; } //碰到墙 if(ch[i][y] == 'X'){ break; } } //向左检索 for (…
Fire Net Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12575 Accepted Submission(s): 7614 Problem Description Suppose that we have a square city with straight streets. A map of a city is a…
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…