bfs+优先队列。wa了N次,才发现可以停留等待楼梯变换方向。 1 #include 2
#include 3 #include 4 #include 5 using namespace std; 6 7 #define MAXNUM 55 8 9
typedef struct node...
分类:
其他好文 时间:
2014-06-03 13:26:06
阅读次数:
274
1 #include 2 #include 3 4 #define mymax(a, b)
(a>b) ? a:b 5 6 typedef struct { 7 int x, y, c; 8 } rect_st; 9 10 rect_st
rects[15];11 12 int d...
分类:
其他好文 时间:
2014-05-30 04:35:16
阅读次数:
200
treap模版暂存。以后修改整理。#include#include#include
#includeusing namespace std;struct Node{ Node *ch[2];//左右子树 int
r;//优先级。数值越大,优先级越高 int v;//值 int...
分类:
其他好文 时间:
2014-05-30 01:45:16
阅读次数:
250
1 #include //bfs; 2 #include 3 #include 4
#include 5 using namespace std; 6 struct data 7 { 8 int x,y,t; 9 }now,pos; 10
int n,m,t,dis[...
分类:
其他好文 时间:
2014-05-30 01:26:49
阅读次数:
242
Queue
简单而实用的数据结构,FIFO,通过循环数组避免队列出现“似乎满了”的现象。package Queueimport "errors"const (
defaultQueueSize=10)var queueSize inttype MyQueue struct{ front...
分类:
其他好文 时间:
2014-05-30 00:48:43
阅读次数:
284
题目描述:输入一个链表,输出该链表中倒数第k个结点。(hint:
请务必使用链表。)输入:输入可能包含多个测试样例,输入以EOF结束。对于每个测试案例,输入的第一行为两个整数n和k(0#include typedef
struct node{ int number; struct nod...
分类:
其他好文 时间:
2014-05-30 00:29:13
阅读次数:
325
原因分析:1、在头文件中:#import "C:\Program Files\Common
Files\System\ado\msado15.dll" no_namespace rename("EOF",
"EndOfFile")2、在“stdafx.h ”文件中,#ifndef _AFX_NO_D...
分类:
其他好文 时间:
2014-05-29 13:21:05
阅读次数:
249
先排序预处理,后01背包。 1 #include 2 #include 3 #include 4 5
#define MAX(a, b) (a>b) ? a:b 6 7 int dp[5000]; 8 9 typedef struct {10 int p,
q, v;11 } s...
分类:
其他好文 时间:
2014-05-29 11:40:04
阅读次数:
277
开始没理解题意。原来destinations是指路的序号。而不是点。DP。 1 #include 2
#include 3 4 int dp[2005]; 5 6 typedef struct { 7 int s, e, w; 8 } road_st; 9 10
road_st ro...
分类:
其他好文 时间:
2014-05-29 09:18:50
阅读次数:
325
#include #include #include int gettimeofday(struct
timeval*tv,struct timezone *tz);int main(int argc, char* argv[]){ int timeuse;
struct timeva...
分类:
其他好文 时间:
2014-05-29 09:00:28
阅读次数:
290