摘要:题目:http://acm.hdu.edu.cn/showproblem.php?pid=1251这个相当简单就不解释了。直接上代码。View Code #include "iostream"#include "cstdio"#include "cstring"#include "string"using namespace std;typedef struct node{ int Cross; struct node *next[26];}node;node *head;void InitHead(){ head
阅读全文
摘要:题目:http://acm.swust.edu.cn/oj/problem/842/这个题目是有一点复杂的,因为在存储内容的时候又再次用了链表。可以说它是链表题目的相当典型的例子了。还是直接上代码吧。View Code #include "iostream"#include "cstring"#include "string"#include "cstdio"#include "algorithm"#include "malloc.h"using namespace std;
阅读全文
摘要:题目:http://poj.org/problem?id=2503就是一个字典树的简单应用, 不解释。View Code #include "iostream"using namespace std;typedef struct node{ char word[21]; int mark; struct node * next[26];}node;node * root;void InitRoot(){ root = new node(); root->mark=0; memset(root->next, NULL, sizeof(root->next))
阅读全文