随笔分类 - 算法竞赛入门经典笔记
摘要:总结:通常最短路(最优解)问题会考虑用BFS来进行求解
阅读全文
摘要: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]; //将数...
阅读全文
摘要:这里有一篇关于:istringstream, ostringstream, stringstream的文章,感觉不错. http://www.cnblogs.com/gamesky/archive/2013/01/09/2852356.html
阅读全文
摘要: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 ...
阅读全文
摘要: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 {...
阅读全文
摘要: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 ...
阅读全文
摘要: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 ...
阅读全文
摘要: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; ...
阅读全文
摘要: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;...
阅读全文