本题DFS与BFS都可以
就是判断在两次转弯后 能不能找到。。
BFS
#include
#include
#include
using namespace std;
struct node
{
int x, y;
int t, d;
};
queue q;
int n, m, map[1002][1002], prove;
int visit[1002][1002][...
分类:
其他好文 时间:
2014-07-28 11:40:30
阅读次数:
285
结构体也属于构造类型.结构体比数组更加灵活,可以存放不同类型的变量结构体是由若干组成员组成的,成员既可以是基本数据类型.又可以是构造类型,比如数组结构体属于自定义数据类型1.结构体声明:struct结构体名{类型说明符成员名;…;类型说明符成员名;};//注意此处分号不能少.结构..
分类:
其他好文 时间:
2014-07-28 00:35:40
阅读次数:
207
#import"Struct.h"//导入自定义的头文件时,用""导入系统定义的头文件时使用<>//数组作为函数参数在传递时,值填写数组名即可.//printAllStudentInfo(b,5);/***结构体嵌套,在一个结构体的结构体成员变量是另外一个结构体类型的变量.*/
分类:
其他好文 时间:
2014-07-28 00:32:00
阅读次数:
221
题目链接:点击打开链接
== 难得的y出了一道计算几何
#include
#include
#include
#include
#include
using namespace std;
#define INF 999999999.9
#define PI acos(-1.0)
#define ll long long
struct Point
{
ll x, y,...
分类:
移动开发 时间:
2014-07-28 00:15:29
阅读次数:
326
用优先队列实现
模板:
struct node
{
int pos, dist;
friend bool operator b.dist;
}
};
int Dijkstra(int n,int start,int end)
{
bool visited[maxn]...
分类:
其他好文 时间:
2014-07-28 00:07:00
阅读次数:
305
就是典型的bfs,但这道题目的难点在于其条件的读取和判断并不简单,需要想办法来读取条件,也需要想办法来判断在每个点处能不能满足向下继续走的条件。
#include
#include
#include
#include
#include
#include
using namespace std;
struct note
{
int r;
int c;
int dir;
}...
分类:
其他好文 时间:
2014-07-28 00:02:19
阅读次数:
554
/* Image format-dependent operations. */typedef struct { jas_image_t *(*decode)(jas_stream_t *in, char *opts); /* Decode image data from a stream. */ ...
分类:
其他好文 时间:
2014-07-27 23:14:09
阅读次数:
297
#include #include #include - (NSString *)localIPAddress{ NSString *localIP = nil; struct ifaddrs *addrs; if (getifaddrs(&addrs)==0) { ...
分类:
移动开发 时间:
2014-07-27 22:43:39
阅读次数:
257
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(...
分类:
其他好文 时间:
2014-07-27 22:03:49
阅读次数:
214
#include
#include
#include
#include
#include
#include
using namespace std;
const int maxn = 1000;
char s[maxn];
bool failed;
vector ans;
struct node
{
bool have_value;
int v;
node *left,*...
分类:
其他好文 时间:
2014-07-27 11:54:43
阅读次数:
198