POJ1111 Image Perimeters】的更多相关文章

Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 8790   Accepted: 5260 Description Technicians in a pathology lab analyze digitized images of slides. Objects on a slide are selected for analysis by a mouse click on the object. The perimet…
题目大意: 输入一个矩阵,再输入其中一个“X”的位置(从1开始).从该位置向八个方向扩展,如果是“X”就可以并在一起.问最后得到的模块的周长是多少. 解题思路: 按照广搜的思路来做.用一个二维的数组标记每一个点,-1代表着该点不能被搜索了(可能原本就是“.”,也可以该点已经出队列了):0代表着该点还没被搜到:1代表着该点已经被搜到,但是还在队列中. 初始周长为4,代表只有一个X时的周长.对于每一个点,如果是“X”,就初始化为标记为0:如果是"."就初始化为-1. 对于当前进行搜索的X的…
Image Perimeters Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 8632   Accepted: 5168 Description Technicians in a pathology lab analyze digitized images of slides. Objects on a slide are selected for analysis by a mouse click on the ob…
                                                                                                                                              Image Perimeters Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 9183   Accepted: 5426 Descript…
原题链接 题目大意:鼠标点击一块,求与之联通的所有区域的边长之和. 解法:广度优先搜索.从选中的这个点开始,往周围8个点依次搜索,访问过的点做上标记.如果该点上下左右的一个或多个方向没有相邻的点,边长+1.代码BSF函数中,有两个数组存放相邻8个点的坐标,这一段代码感觉很简洁,是从其他地方学习来的. 参考代码: #include<iostream> #include<cstring> #include<cstdio> #include<queue> usin…
J - 搜索 Crawling in process... Crawling failed Time Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d & %I64u Submit Status Practice POJ 1111 Description Technicians in a pathology lab analyze digitized images of slides. Objects on a sli…
Technicians in a pathology lab analyze digitized images of slides. Objects on a slide are selected for analysis by a mouse click on the object. The perimeter of the boundary of an object is one useful measure. Your task is to determine this perimeter…
题目链接:http://poj.org/problem?id=1111 解题报告: 1.这里深搜有一点要注意,对角线上的点,如果为'.',则total不应该增加,因为这不是他的边长. #include <stdio.h> #include <string.h> ][]; ][]; ][]= {{,},{-,},{,},{,-}}; ][]= {{,},{,-},{-,},{-,-}}; int r,c; int click_x,click_y; int total;///周长 vo…
在搜1011的时候误搜了1111,简单BFS吧,多一个X就是多四个面,每次看看他的四个面有多少个重复的,然后剪掉,最后答案加上就好了: code: //#include <bits/stdc++.h> #include<iostream> #include<cstdio> #include<queue> #include<math.h> #include<string.h> #include<algorithm> usin…
Description Technicians in a pathology lab analyze digitized images of slides. Objects on a slide are selected for analysis by a mouse click on the object. The perimeter of the boundary of an object is one useful measure. Your task is to determine th…