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
转载 2020-07-31 14:03:00
60阅读
2评论
DescriptionSuppose 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 ...
原创 2021-08-04 11:22:10
150阅读
A - Fire Net(DFS)题意:给n×nn\times nn×n地图,问最多能放多少炮台,炮台不能互相(有墙或者不在同一行或同一列)思路:从左到右,从上到下将每个点做为起点开始搜,如果从某一个点开始搜,它之前的点是不用搜的,因为若它之前有点可以作为炮台,说明这个点已经被搜过了。所以这种搜法是正确的。这里有个简化的技巧,用一维编号表示二维坐标 以(0,0)(0,0)(0,0)作为起...
原创 2022-01-22 14:51:06
58阅读
A - Fire Net(DFS) 题意:给 n × n n\times n n×n地图,问最多能放多少炮台,炮台不能互相攻击(有墙或者不在同一行或同一列) 思路:从左到右,从上到下将每个点做为起点开始搜,如果从某一个点开始搜,它之前的点是不用搜的,因为若它之前有点可以作为炮台,说明这个点已经被搜过了。所以这种搜法是正确的。这里有个简化的技巧,用一维编号表示二维坐标 以 ( 0 , 0 ) (0
原创 2021-08-10 10:08:33
222阅读
Fire NetTime Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 1Accepted Submission(s) : 1Font:Times New Roman|Verdana|GeorgiaFont Size:←→Problem DescriptionSuppose that we have a square city with straight streets. A map of a city is a square board with n
转载 2013-03-16 10:41:00
59阅读
Fire Net Time Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 13Accepted Submission(s) : 5Font: Times Ne...
转载 2014-04-13 17:08:00
74阅读
2评论
Fire NetTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7944Accepted Submission(s): 4534Problem De...
转载 2015-08-06 20:13:00
77阅读
2评论
一、内容 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 cas...
原创 2022-02-03 14:07:52
69阅读
题目地址:点击打开链接思路:好题AC代码:#includeusing namespace std;int ibest,m;char a[5][5];bool canput(int x,int y){ int i; for(i=y-1;i>=0;i--) { if(a[x][i]=='o') return false; if(a[x][i]=='X')
原创 2022-08-04 09:04:46
12阅读
Fire NetTime Limit: 2 Seconds      Memory Limit: 65536 KBSuppose 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 representin
原创 2022-08-10 10:22:42
14阅读
Fire NetTime
原创 2022-12-02 00:33:37
72阅读
Fire NetTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7922Accepted Submission(s): 4514Problem De...
转载 2015-08-05 11:23:00
118阅读
2评论
题意: 一个n * n 的棋盘 上面有些障碍物 放棋子 棋子不能在同一行 同一列 但可以在同一行或同一列隔着障碍物放 这题与poj1321 的思想差不多 对于一个位置 有两种状态放还是不放 参数inx 从1到n*n递增 inx/n表示x轴坐标 inx%n表示y轴坐标 k 为当前所用的棋子
转载 2018-06-05 15:48:00
107阅读
2评论
Fire NetTime Limit: 2000/1000 MS (Java
原创 2022-08-10 10:22:00
52阅读
Fire Net Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 246   Accepted Submission(s) : 143 Font: Times New Roman | Verdana | Georgia Font Size:
原创 2021-08-30 16:38:04
79阅读
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1045Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionSuppose that we have a square city with straig...
原创 2021-07-14 10:45:28
38阅读
columns, each representing a street or a piece of wall.A blockhouse is a small castle that has four openings through which to shoot. The four openings...
原创 2021-07-15 17:45:39
92阅读
一、内容 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 cas...
原创 2021-08-27 14:14:50
103阅读
原题链接 考察:暴力搜索或二分图匹配 暴力搜索的思路: 对地图的每一个位置dfs,如果放炮就要判断该处上下左右有没有其他炮,如果不放就继续搜索 关于判断:我们需要选定一个方向一直走,可以用while,我一开始的思路是bfs标记放了炮的上下左右.这种做法是错的,如果炮在(1,1)按bfs(2,1)会被
转载 2021-01-23 12:07:00
77阅读
2评论
Fire Net Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 246   Accepted Submission(s) : 143 Font: Times New Roman | Verdana | Georgia Font Size:
原创 2021-08-31 10:13:07
54阅读
  • 1
  • 2
  • 3
  • 4
  • 5