foj 2150 Fire Game(bfs暴力)】的更多相关文章

     Problem Description Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of which refers to the grid (x+, y), (x-, y), (x, y+), (x, y-). This process ends when no new g…
[题目链接]click here~~ [题目大意]: 两个熊孩子要把一个正方形上的草都给烧掉,他俩同一时候放火烧.烧第一块的时候是不花时间的.每一块着火的都能够在下一秒烧向上下左右四块#代表草地,.代表着不能烧的.问你最少花多少时间能够烧掉.假设烧不掉就输出-1 [解题思路]: 数据比較弱的情况下直接暴力枚举每块草坪上能够放的位置,比較高端的写法眼下没有想到.以后想到了文章更新下~~ ps:因为一个细节没注意,导致WA了差点儿一页,还以为FZU 判题出错了.后来突然发现每次从队列里拿出队首的元素…
题目链接:http://acm.fzu.edu.cn/problem.php?pid=2150 Problem Description Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this board is consisting of grass or just empty a…
Problem Description Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this board is consisting of grass or just empty and then they start to fire all the grass. Firstl…
题意,10*10的地图,有若干块草地“#”,草地可以点燃,并在一秒后点燃相邻的草地.有墙壁‘·‘阻挡.初始可以从任意两点点火.问烧完最短的时间.若烧不完输出-1. 题解:由于100的数据量,直接暴力.枚举两个起点,推入队列,然后bfs.烧完就返回深度,更新一个min值. 坑:(帮同学照bug) return t.step+1;bfs后没有算上最后一步 ac代码 #define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <cs…
称号:fzupid=2150"> 2150 Fire Game :给出一个m*n的图,'#'表示草坪,' . '表示空地,然后能够选择在随意的两个草坪格子点火.火每 1 s会向周围四个格子扩散,问选择那两个点使得燃烧全部的草坪花费时间最小? 分析:这个题目假设考虑技巧的话有点难度,可是鉴于数据范围比較小,我们能够暴力枚举随意的草坪所在的点,然后两个点压进队列里面BFS.去一个满足条件的最小值就可以. 顺便说一下 fzu 2141 Sub-Bipartite Graph 的思路,比赛的时候没…
Problem 2150 Fire Game Accept: 2133    Submit: 7494Time Limit: 1000 mSec    Memory Limit : 32768 KB Problem Description Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid…
Problem 2150 Fire Game Accept: 145    Submit: 542 Time Limit: 1000 mSec    Memory Limit : 32768 KB Problem Description Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid o…
FZU 2150 Fire Game(点火游戏) Time Limit: 1000 mSec    Memory Limit : 32768 KB Problem Description - 题目描述 Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this board is co…
                                                                                                                                          Problem 2150 Fire Game Accept: 2185    Submit: 7670Time Limit: 1000 mSec    Memory Limit : 32768 KB Problem Desc…