摘要: 题目:http://poj.org/problem?id=2488没什么难度,,,就是字典序,要注意一下,一开始没看见。。。唉。。。View Code 1 #include<iostream> 2 #include<cstring> 3 using namespace std; 4 int a[8][2]={{-2,-1},{-2,1},{-1,-2},{-1,2},{1,-2},{1,2},{2,-1},{2,1}}; 5 char str[2500]; 6 int are; 7 int flag; 8 int m,n; 9 int map[27][27];10 vo 阅读全文
posted @ 2013-01-22 21:20 琳&leen 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 题目:http://poj.org/problem?id=2418二叉排序树:View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<cstdlib> 5 using namespace std; 6 int n=0; 7 typedef struct node 8 { 9 char s[31];10 int num;11 struct node *lchild;12 struct node *rchild;13 }btreenode,*b 阅读全文
posted @ 2013-01-22 17:38 琳&leen 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 题目:http://poj.org/problem?id=2513这个题的题意很好懂,感觉很简单,然后交了之后wa后来意识到是自己的思路不正确,其实就是欧拉回路的问题用到了trie树+并查集+欧拉代码:View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<cstring> 4 #define max 500010 5 using namespace std; 6 struct node 7 { 8 int num; 9 int flag; 10 node *next[26]; 1... 阅读全文
posted @ 2013-01-22 17:35 琳&leen 阅读(125) 评论(0) 推荐(0) 编辑