随笔分类 -  算法竞赛入门经典笔记

摘要:总结:通常最短路(最优解)问题会考虑用BFS来进行求解 阅读全文
posted @ 2017-02-03 19:26 douzujun 阅读(654) 评论(0) 推荐(0) 编辑
摘要:1 //Uva725 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 void evalu(int n) 9 { 10 const int maxn = 1024 + 10; 11 char num[10]; //将数... 阅读全文
posted @ 2017-01-19 23:45 douzujun 阅读(261) 评论(0) 推荐(0) 编辑
摘要:这里有一篇关于:istringstream, ostringstream, stringstream的文章,感觉不错. http://www.cnblogs.com/gamesky/archive/2013/01/09/2852356.html 阅读全文
posted @ 2016-08-18 15:49 douzujun 阅读(256) 评论(0) 推荐(0) 编辑
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 6 int Find(char *fstr, char *sstr) 7 { 8 int lenf = strlen(fstr), lens = strlen(sstr), i; 9 for (i = 0; i > s >> t; 41 ... 阅读全文
posted @ 2016-06-14 17:49 douzujun 阅读(228) 评论(0) 推荐(0) 编辑
摘要:1 #include 2 #include 3 using namespace std; 4 5 int main(void) 6 { 7 int *count, T, k = 0, j = 0; 8 string c; 9 cin >> T; 10 count = new int[T]; 11 if (!count) 12 {... 阅读全文
posted @ 2016-06-14 17:44 douzujun 阅读(165) 评论(0) 推荐(0) 编辑
摘要:1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const int maxn = 1010; 7 8 void get_num(int &num,string c,int j) 9 { 10 while (isdigit(c[j]) && c[j]) 11 { 12 ... 阅读全文
posted @ 2016-06-14 17:43 douzujun 阅读(231) 评论(0) 推荐(0) 编辑
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 const int maxn = 10010; 6 7 int main(void) 8 { 9 int N, n; //N组数据 , n前n个整数顺次 10 cin >> N; 11 for (int ... 阅读全文
posted @ 2016-06-14 17:42 douzujun 阅读(171) 评论(0) 推荐(0) 编辑
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 const int maxn = 1010; 8 9 char str[maxn][maxn] = {0}; 10 11 int main(void) 12 { 13 int T, m, n; ... 阅读全文
posted @ 2016-06-14 17:41 douzujun 阅读(207) 评论(0) 推荐(0) 编辑
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 const int maxn = 1010; 6 7 int equ(const char *a,int beg,int beh) //总是与首字符形成的串相比,beh为后一个的序列 8 { 9 int n = strlen(a), i;... 阅读全文
posted @ 2016-06-14 17:40 douzujun 阅读(182) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示