概述:本文主要讲述一些搜索算法的使用,以及其中奥妙思想的思考。 一:广度搜索与深度搜索---BFS与DFS 1:实现算法导论中的BSF #include #define MAX 1000000struct Node{ int d; int p; int color; int id;};int _tm...
分类:
其他好文 时间:
2014-07-16 23:08:16
阅读次数:
224
简单字典树。 1 #include 2 #include 3 #include 4 5 #define MAXN 128 6 7 typedef struct Trie { 8 int count; 9 Trie *next[MAXN];10 Trie() {11 ...
分类:
其他好文 时间:
2014-07-10 13:43:34
阅读次数:
239
HWND GetConsoleHwnd(void){#define MY_BUFSIZE 1024 // Buffer size for console window titles. HWND hwndFound; // This is what is returned to the...
分类:
其他好文 时间:
2014-07-10 11:55:44
阅读次数:
265
1 #import 2 3 #define FILE_PATH(filePath) [File path:(filePath)] 4 #define ROOT_PATH [File rootPath] 5 #define BUNDLE_PATH(fi...
分类:
其他好文 时间:
2014-07-10 11:32:48
阅读次数:
155
《编程之美》第一章 让CPU暂用率听你指挥的粗糙实现,如何控制CPU的暂用率固定在50%#include #include #ifdef __cplusplus extern "C" { #endif #include #ifdef __cplusplus } #endif #define Get....
分类:
其他好文 时间:
2014-07-10 10:36:20
阅读次数:
213
http://acm.hdu.edu.cn/showproblem.php?pid=1874SPFA#include #include #include #include #define N 1000001using namespace std;int n,m;int v[202],dis[202]...
分类:
其他好文 时间:
2014-07-08 00:16:33
阅读次数:
256
selected device is not a touchscreen I understandarm交叉编译工具中的头文件库中的linux/input.h中的EV_VERSION定义为#define EV_VERSION 0x010000而linux内核include/linux/...
分类:
其他好文 时间:
2014-07-08 00:14:34
阅读次数:
200
原题: HDU 3362http://acm.hdu.edu.cn/showproblem.php?pid=3362开始准备贪心搞,结果发现太难了,一直都没做出来。后来才知道要用状压DP。题意:题目给出n(n #include #include #include #include #define M...
分类:
其他好文 时间:
2014-07-07 23:35:56
阅读次数:
323
循环同构的最小表示法。 1 #include 2 #include 3 4 #define MAXN 10005 5 #define MAXL 105 6 7 char map[MAXN][MAXL]; 8 char buf[MAXL]; 9 10 int Min_exp(char str[...
分类:
其他好文 时间:
2014-07-07 23:06:44
阅读次数:
213
http://acm.hdu.edu.cn/showproblem.php?pid=2544DJ#include #include #include #include #include #define N 1000001using namespace std;int map[101][101];in...
分类:
其他好文 时间:
2014-06-29 18:27:50
阅读次数:
285