上一页 1 2 3 4 5 6 7 ··· 16 下一页
摘要: http://poj.org/problem?id=2153二分查找 1 #include <stdio.h> 2 #include <iostream> 3 #include <string> 4 #include <string.h> 5 #include <map> 6 7 using namespace std; 8 9 int n, m;10 map<string, int> map1;11 int count1[10010] = {0};12 int sort1[10010];13 14 string ctos 阅读全文
posted @ 2013-05-29 10:18 Yuan1991 阅读(120) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2007计算几何,凸包,逆时针排序 1 #include <stdio.h> 2 #include <vector> 3 #include <queue> 4 #include <algorithm> 5 #include <math.h> 6 7 using namespace std; 8 9 const double eps = 1e-8; 10 11 int cmp(double x) 12 { 13 if(fabs(x) < eps) return 0; 14 if( 阅读全文
posted @ 2013-05-28 20:43 Yuan1991 阅读(128) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2084组合数学,Catalan数,高精度 1 #include <stdio.h> 2 #include <string> 3 #include <iostream> 4 5 using namespace std; 6 7 const int ten[4] = {1, 10, 100, 1000}; 8 const int max1=1000; 9 10 struct BigNumber{ 11 int d[max1]; 12 BigNumber(string s) 13 { 14 ... 阅读全文
posted @ 2013-05-28 16:48 Yuan1991 阅读(155) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2001数据结构,Trie 1 #include <stdio.h> 2 #include <string.h> 3 4 const int CHARSET = 26, BASE = 'a', MAX_NODE = 20100; 5 6 struct trie 7 { 8 int tot, root, child[MAX_NODE][CHARSET]; 9 bool flag[MAX_NODE];10 int cnt[MAX_NODE];11 trie()12 {13 memset(... 阅读全文
posted @ 2013-05-27 20:51 Yuan1991 阅读(109) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2051数据结构,优先队列 1 #include <stdio.h> 2 #include <string.h> 3 #include <queue> 4 5 using namespace std; 6 7 priority_queue<pair<int, int> > q; 8 9 int main()10 {11 char s[12] = "\0";12 int i, n, id, t[3003];13 pair<int, int> pair1; 阅读全文
posted @ 2013-05-27 19:11 Yuan1991 阅读(135) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 16 下一页