127 - "Accordian" Patience

题目大意:一个人一张张发牌,如果这张牌与这张牌前面的一张或者前面的第三张(后面称之为一位置和三位置)的点数或花式相同,则将这张牌移动到与之对应的位置(优先三位置,也就是说如果一位置与三位置都有以上的性质则移动到三位置之上),移动之后若仍以上的性质,则继续操作,直到已发的所有牌都无法移动之后再继续发牌,(如果一个位置被移空,则删除此位置!)

解题思路:用数组模拟链表,每发一张牌就匹配三位置,如果匹配就移动,否则再看一位置是否满足,如果满足就移动,移动之后,再继续之前的操作,直到所有的都不能移动!如果都不满足,则继续发牌!如此反复直到所有牌都发完!最后只剩下几叠移不动的牌,依次输出每叠的数量。最开始的数是总叠数,如果是1则输出“1 pile remaining: ”其他则输出“6 piles remaining: ”!

解题代码:

  1. //Author: Freetion
  2. //file: 127 - "Accordian" Patience
  3.  
  4. #include <iostream>
  5. #include <math.h>
  6. #include <string.h>
  7. #include <stdio.h>
  8. using namespace std;
  9.  
  10. struct node
  11. {
  12. string pile[];
  13. int num;
  14. }pat[];
  15. bool noth[];
  16.  
  17. int main()
  18. {
  19. freopen("data.in", "r", stdin);
  20. freopen("data.out", "w", stdout);
  21. string tm;
  22. while (cin >> tm && tm[] != '#')
  23. {
  24. memset (noth, false, sizeof (noth));
  25. int i = ;
  26. pat[i].pile[] = "";
  27. pat[i].pile[] += tm;
  28. pat[i++].num = ;
  29. for ( ; i < ; i ++)
  30. {
  31. pat[i].num = ;
  32. cin >> pat[i].pile[pat[i].num++];
  33. }
  34. /* for (i = 0; i < 52; i ++)
  35. cout << pat[i].pile[0] << " ";
  36. for (i = 0; i < 52; i ++)
  37. cout << pat[i].num << " ";
  38. */
  39. int total = ;
  40. for (i = ; i < ; i ++)
  41. {
  42. int bf = , cm = i - ;
  43. while (bf < && cm >= )
  44. {
  45. if (noth[cm --])
  46. continue;
  47. bf ++;
  48. }
  49. if (bf == && !noth[i])
  50. {
  51. node& cmp_1 = pat[i];
  52. node& cmp_2 = pat[cm+];
  53. if ( cmp_1.pile[cmp_1.num-][] == cmp_2.pile[cmp_2.num-][] )
  54. {
  55. cmp_2.pile[cmp_2.num] = "";
  56. cmp_2.pile[cmp_2.num ++] += cmp_1.pile[--cmp_1.num];
  57. if (cmp_1.num <= )
  58. {
  59. noth[i] = true;
  60. total --;
  61. }
  62. i = cm;
  63. continue;
  64. }
  65. else if ( cmp_1.pile[cmp_1.num-][] == cmp_2.pile[cmp_2.num-][] )
  66. {
  67. cmp_2.pile[cmp_2.num] = "";
  68. cmp_2.pile[cmp_2.num ++] += cmp_1.pile[--cmp_1.num];
  69. if (cmp_1.num <= )
  70. {
  71. noth[i] = true;
  72. total --;
  73. }
  74. i = cm;
  75. continue;
  76. }
  77. }
  78. bf = , cm = i - ;
  79. while (bf < && cm >= )
  80. {
  81. if (noth[cm --])
  82. continue;
  83. bf ++;
  84. }
  85. if (bf == && !noth[i])
  86. {
  87. node& cmp_1 = pat[i];
  88. node& cmp_2 = pat[cm+];
  89. if ( cmp_1.pile[cmp_1.num-][] == cmp_2.pile[cmp_2.num-][] )
  90. {
  91. cmp_2.pile[cmp_2.num] = "";
  92. cmp_2.pile[cmp_2.num ++] += cmp_1.pile[--cmp_1.num];
  93. if (cmp_1.num <= )
  94. {
  95. noth[i] = true;
  96. total --;
  97. }
  98. i = cm;
  99. continue;
  100. }
  101. else if ( cmp_1.pile[cmp_1.num-][] == cmp_2.pile[cmp_2.num-][] )
  102. {
  103. cmp_2.pile[cmp_2.num] = "";
  104. cmp_2.pile[cmp_2.num ++] += cmp_1.pile[--cmp_1.num];
  105. if (cmp_1.num <= )
  106. {
  107. noth[i] = true;
  108. total --;
  109. }
  110. i = cm;
  111. continue;
  112. }
  113. }
  114. }
  115. if (total > )
  116. printf ("%d piles remaining:", total);
  117. else printf ("%d pile remaining:", total);
  118. for (i = ; i < ; i ++)
  119. {
  120. if (!noth[i])
  121. printf (" %d", pat[i].num);
  122. }
  123. puts("");
  124. }
  125. return ;
  126. }

开始时我用得字符数组,而不是字符串,但是用字符数组时,运行到此条语句时cmp_2.pile[cmp_2.num ++] 当cmp_2.num == 50时,自加就变成了25529。直到现在也没弄明白为什么!如果哪位大神路过此地又恰巧知道其中原理时请告知!谢谢。。。

101 - The Blocks Problem

题目大意:提供一个大牛的博客http://www.cnblogs.com/devymex/archive/2010/08/04/1792128.html

解题思路:模拟操作就是了!

解题代码:

  1. //Author :Freetion
  2. //file :101 - The Blocks Problem
  3.  
  4. #include <stdio.h>
  5. #include <string.h>
  6.  
  7. struct node
  8. {
  9. int top;
  10. int up[];
  11. }pos[];
  12.  
  13. int main()
  14. {
  15. // freopen("data.in", "r", stdin);
  16. // freopen("data.out", "w", stdout);
  17. int n;
  18. char in[][];
  19. int p1, on1, p2, on2, ope;
  20. int num1, num2;
  21. while (scanf ("%d", &n) == )
  22. {
  23. for (int i = ; i < n; i ++)
  24. {
  25. pos[i].top = ;
  26. pos[i].up[pos[i].top ++] = i;
  27. }
  28. while (scanf("%s", in[]) == )
  29. {
  30. if (in[][] == 'q')
  31. break;
  32. scanf ("%d %s %d", &num1, in[], &num2);
  33. p1 = p2 = -;
  34. for (int i = ; i < n; i ++)
  35. {
  36. for (int j = ; j < pos[i].top; j ++)
  37. {
  38. if (num1 == pos[i].up[j])
  39. p1 = i, on1 = j;
  40. if (num2 == pos[i].up[j])
  41. p2 = i, on2 = j;
  42. if (p1 != - && p2 != -)
  43. break;
  44. }
  45. if (p1 != - && p2 != -)
  46. break;
  47. }
  48. if (p1 == p2)
  49. continue;
  50. if (in[][] == 'm')
  51. ope = ;
  52. else ope = ;
  53. if (in[][] == 'v')
  54. ope ++;
  55. if (ope == )
  56. {
  57. for (int i = on1+; i < pos[p1].top; i ++)
  58. {
  59. node& A = pos[pos[p1].up[i]];
  60. A.up[A.top ++] = pos[p1].up[i];
  61. }
  62. pos[p1].top = on1+;
  63. for (int i = on2+; i < pos[p2].top; i ++)
  64. {
  65. node& A = pos[pos[p2].up[i]];
  66. A.up[A.top ++] = pos[p2].up[i];
  67. }
  68. pos[p2].top = on2 +;
  69. pos[p2].up[pos[p2].top ++] = pos[p1].up[--pos[p1].top];
  70. }
  71. else if (ope == )
  72. {
  73. for (int i = on1+; i < pos[p1].top; i ++)
  74. {
  75. node& A = pos[pos[p1].up[i]];
  76. A.up[A.top ++] = pos[p1].up[i];
  77. }
  78. pos[p1].top = on1+;
  79. pos[p2].up[pos[p2].top ++] = pos[p1].up[--pos[p1].top];
  80. }
  81. else if (ope == )
  82. {
  83. for (int i = on2+; i < pos[p2].top; i ++)
  84. {
  85. node& A = pos[pos[p2].up[i]];
  86. A.up[A.top ++] = pos[p2].up[i];
  87. }
  88. pos[p2].top = on2 +;
  89. for (int i = on1; i < pos[p1].top; i ++)
  90. {
  91. pos[p2].up[pos[p2].top ++] = pos[p1].up[i];
  92. }
  93. pos[p1].top = on1;
  94. }
  95. else if (ope == )
  96. {
  97. for (int i = on1; i < pos[p1].top; i ++)
  98. {
  99. pos[p2].up[pos[p2].top ++] = pos[p1].up[i];
  100. }
  101. pos[p1].top = on1;
  102. }
  103. }
  104. for (int i = ; i < n; i ++)
  105. {
  106. printf ("%d:", i);
  107. for (int j = ; j < pos[i].top; j ++)
  108. printf (" %d", pos[i].up[j]);
  109. printf ("\n");
  110. }
  111. }
  112. return ;
  113. }

133 - The Dole Queue

题目大意:给你一个n个数组成的环,再给出一个顺时钟数的数k,一个逆时钟数的数m。要你从开始的位置同时朝顺时钟和逆时钟两个方向数,将顺时钟数到的第k个数和逆时钟数到的第m个数同时从环中剔除,然后继续数直到环上没有数了。如果数到的是同一个数,则只剔除这一个数。

解题思路:直接操作,水题!ps:样例中三角型代表的是空格。

解题代码:

  1. //Author :Freetion
  2. //file :133 - The Dole Queue
  3. #include <stdio.h>
  4. #include <string.h>
  5. using namespace std;
  6. int pp[];
  7. int k, m;
  8. bool jug[];
  9. int main()
  10. {
  11. // freopen("data.in", "r", stdin);
  12. // freopen("data.out", "w", stdout);
  13. int k, m, n;
  14. while (~scanf ("%d%d%d", &n, &k, &m) && (k+m+n))
  15. {
  16. memset(jug, true, sizeof (jug));
  17. int shu = ;
  18. int ni = n;
  19. int total = n;
  20. int num;
  21. while (total)
  22. {
  23. num = ;
  24. while (num < k)
  25. {
  26. if (shu > n)
  27. shu -= n;
  28. if (jug[shu++])
  29. num ++;
  30. }
  31. shu --;
  32. num = ;
  33. while (num < m)
  34. {
  35. if (ni <= )
  36. ni += n;
  37. if (jug[ni --])
  38. num ++;
  39. }
  40. ni ++;
  41. if (ni == shu)
  42. {
  43. printf ("%3d", ni);
  44. jug[ni] = false;
  45. total --;
  46. }
  47. else
  48. {
  49. printf ("%3d%3d", shu, ni);
  50. jug[ni] = jug[shu] = false;
  51. total -= ;
  52. }
  53. if (total)
  54. printf (",");
  55. }
  56. printf ("\n");
  57. }
  58. }

10152 - ShellSort

题目大意:给出一堆龟壳,我们要将它们按照另一种顺序排好,而每次操作都只能移动一个龟壳,并且只能将其放在这一堆的最上面。问使用最少的移动次数时依次移动龟壳的顺序。

解题思路:

解题代码:

  1. //Author :Freetion
  2. //file :10152 - ShellSort
  3.  
  4. #include <iostream>
  5. #include <stdio.h>
  6. #include <string>
  7. #include <map>
  8. using namespace std;
  9.  
  10. const int max_n = ;
  11.  
  12. string str1[max_n], str2[max_n];
  13.  
  14. int main()
  15. {
  16. // freopen("data.in", "r", stdin);
  17. // freopen("data.out", "w", stdout);
  18. int n, T;
  19. scanf ("%d", &T);
  20. while (T --)
  21. {
  22. scanf ("%d", &n);
  23. getchar();
  24. for (int i = n-; i >= ; i --)
  25. {
  26. getline(cin, str1[i]);
  27. }
  28. for (int i = n-; i >= ; i --)
  29. {
  30. getline(cin, str2[i]);
  31. }
  32. int j = ;
  33. for (int i = ; i < n; i ++)
  34. {
  35. if (str1[i] == str2[j])
  36. j ++;
  37. }
  38. for (; j < n; j ++)
  39. cout << str2[j] << endl;
  40. printf ("\n");
  41. }
  42. return ;
  43. }

673 - Parentheses Balance

解题思路:将 左括号 入栈,如果碰上 右括号 则看是否与前一个左括号匹配,如果匹配则左括号匹配出栈,直到最后看栈是否空,空则Yes,否则No。

解题代码:

  1. //Author :Freetion
  2. //file :uva-673 Parentheses Balance
  3.  
  4. #include <stdio.h>
  5. #include <stack>
  6. #include <string>
  7. #include <iostream>
  8. using namespace std;
  9. string str;
  10. char mat(const char s)
  11. {
  12. if (s == ']')
  13. return '[';
  14. if (s == ')')
  15. return '(';
  16. return ;
  17. }
  18.  
  19. bool jug()
  20. {
  21. stack <char> st;
  22. st.push('');
  23. int len = str.size();
  24. for (int i = ; i < len; i ++)
  25. {
  26. if (st.top() != mat(str[i]))
  27. st.push(str[i]);
  28. else st.pop();
  29. }
  30. return st.size() == ;
  31. }
  32.  
  33. int main()
  34. {
  35. int n;
  36. scanf ("%d", &n);
  37. getchar();
  38. while (n --)
  39. {
  40. getline(cin, str);
  41. if (str.size() == || jug())
  42. printf ("Yes\n");
  43. else printf ("No\n");
  44. }
  45. return ;
  46. }

442 - Matrix Chain Multiplication

题目意思是让我们求矩阵相乘的总次数,另外括号是里面限定了只有两个矩阵!

解题思路:可以利用上题括号匹配,将先算的矩阵找出来,然后判断是否可以相乘,可以则计算次数,不可以则退出循环。

解题代码:

  1. //Author :Freetion
  2. //file :442 - Matrix Chain Multiplication
  3.  
  4. #include <stdio.h>
  5. #include <string.h>
  6. #include <stack>
  7. #include <iostream>
  8. using namespace std;
  9.  
  10. struct node
  11. {
  12. int x, y;
  13. }Matrix[];
  14.  
  15. int main ()
  16. {
  17. // freopen("data.in", "r", stdin);
  18. // freopen("data.out", "w", stdout);
  19. int n;
  20. char s[];
  21. char mul[];
  22. while (~scanf ("%d", &n))
  23. {
  24. for (int i = ; i < n; i ++)
  25. {
  26. scanf ("%s", s);
  27. scanf ("%d%d", &Matrix[s[]-'A'].x, &Matrix[s[]-'A'].y);
  28. }
  29. while (~scanf ("%s", mul))
  30. {
  31. int len = strlen(mul);
  32. node temp[];
  33. int top = ;
  34. int ans = ;
  35. bool falg = ;
  36. for (int i = ; i < len; i ++)
  37. {
  38. if (mul[i] >= 'A' && mul[i] <= 'Z')
  39. temp[top ++] = Matrix[mul[i]- 'A'];
  40. else if (mul[i] == ')' && top > )
  41. {
  42. if (temp[top-].y != temp[top-].x)
  43. { falg = ; break; }
  44. ans += temp[top-].y * temp[top-].x * temp[top-].y;
  45. temp[top-].y = temp[top-].y;
  46. top --;
  47. }
  48. }
  49. if (falg)
  50. printf ("%d\n", ans);
  51. else
  52. printf ("error\n");
  53. }
  54. }
  55. }

11111 - Generalized Matrioshkas

此题与673相似,只是将左括号换成了负数,右括号换成了与之互为相反数的正数。当然依旧需要左右括号匹配,与此同时,这一级数的括号所用的数字,要比下一级括号所用的数字之和要大!

解题代码:

  1. //Author :Freetion
  2. //file :11111 - Generalized Matrioshkas
  3.  
  4. #include <stdio.h>
  5. #include <string>
  6. #include <sstream>
  7. #include <iostream>
  8. #include <stack>
  9. using namespace std;
  10.  
  11. struct node
  12. {
  13. node(const int &a, const int &b):cap(a), left(b) {}
  14. int cap, left;
  15. };
  16.  
  17. int main ()
  18. {
  19. freopen ("data.in", "r", stdin);
  20. freopen ("data.out", "w", stdout);
  21. string line;
  22. while (getline(cin, line))
  23. {
  24. stack <node> ope;
  25. istringstream ss(line);
  26. int t;
  27. bool judge = false;
  28. while (ss >> t)
  29. {
  30. if (t < )
  31. {
  32. if(ope.empty())
  33. ope.push(node(-t, -t));
  34. else
  35. {
  36. ope.top().left += t;
  37. if (ope.top().left <= )
  38. { judge = ; break; }
  39. else
  40. ope.push(node(-t, -t));
  41. }
  42. }
  43. else
  44. {
  45. if (ope.empty() || ope.top().cap != t)
  46. { judge = ; break; }
  47. else
  48. ope.pop();
  49. }
  50. }
  51. if (judge || !ope.empty())
  52. printf (":-( Try again.\n");
  53. else printf (":-) Matrioshka!\n");
  54. }
  55. return ;
  56. }

11234 - Expressions

这题我也是百度思路的,所以直接贴代码:

  1. //Author :Freetion
  2. //file :11234 - Expressions
  3. //´ËÊǺÃÌ⣡
  4.  
  5. #include <stdio.h>
  6. #include <string>
  7. #include <stack>
  8. #include <queue>
  9. #include <iostream>
  10. using namespace std;
  11.  
  12. struct node
  13. {
  14. char ope;
  15. node *left;
  16. node *right;
  17. node (char s, node *l, node *r)
  18. {
  19. ope = s;
  20. left = l;
  21. right = r;
  22. }
  23. node (char s)
  24. {
  25. ope = s;
  26. left = NULL;
  27. right = NULL;
  28. }
  29. };
  30.  
  31. int main()
  32. {
  33. string str;
  34. int T;
  35. scanf ("%d", &T);
  36. getchar();
  37. while (T--)
  38. {
  39. stack <node *> ans;
  40. cin >> str;
  41. int len = str.length();
  42. for (int i = ; i < len; i ++)
  43. {
  44. if (islower(str[i]))
  45. {
  46. node *new_node = new node(str[i]);
  47. ans.push(new_node);
  48. }
  49. else
  50. {
  51. node *a = ans.top();
  52. ans.pop();
  53. node *b = ans.top();
  54. ans.pop();
  55. node *new_node = new node(str[i], b, a);
  56. ans.push(new_node);
  57. }
  58. }
  59. node *root = ans.top();
  60. ans.pop();
  61. queue <node *> p;
  62. p.push(root);
  63. while (!p.empty())
  64. {
  65. node *q = p.front();
  66. p.pop();
  67. if (q -> left != NULL)
  68. p.push(q -> left);
  69. if (q -> right != NULL)
  70. p.push(q -> right);
  71. ans.push(q);
  72. }
  73. while (!ans.empty())
  74. {
  75. printf ("%c", ans.top()->ope);
  76. ans.pop();
  77. }
  78. cout << endl;
  79. }
  80. return ;
  81. }

540 - Team Queue

题目大意:这题不难但是题意好难搞清楚(当然这是对我来说),看看能否说的清楚:给你一个初始队列,这个队列不同于一般的队列,它由多个队列组成一个大队列,然后依次输入操作,ENQUEUE n,代表将数n加入队列,如果在哪个队列里有与n相等的元素则加入该队列之后,如果没有则加入到最后那个队列之后,也就是输入的第一个队列。DEQUEUE 代表删除操作,删除操作是这样的,是按照队列来进行操作的,按队列先进先出的规则,也就是说哪个队列先加入元素,则先输出哪个队列里的元素。输出元素的规则就是先进先出,哪个元素先加入这个队列,则先输出哪个元素, 直到把加入该队列的元素都输出之后,再输出次优先的队列中的元素。每次只删除一个元素!(应该差不多了)

解题思路:运用队列来做!

解题代码:

  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <string>
  4. #include <queue>
  5. #include <map>
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. int n, k, T = ;
  11. while (~scanf ("%d", &n), n)
  12. {
  13. map <int, int> num;
  14. queue <int> que[];
  15. queue <int> que_num;
  16. printf ("Scenario #%d\n", T++);
  17. for (int i = ; i < n; i ++)
  18. {
  19. scanf ("%d", &k);
  20. for (int j = ; j < k; j ++)
  21. {
  22. int x;
  23. scanf ("%d", &x);
  24. num[x] = i;
  25. }
  26. }
  27. string str;
  28. while (cin >> str && str[] != 'S')
  29. {
  30. if (str[] == 'E')
  31. {
  32. int x;
  33. scanf ("%d", &x);
  34. // cout << num[x] << endl;
  35. if (que[num[x]].empty())
  36. que_num.push(num[x]);
  37. que[num[x]].push(x);
  38. // cout << que_num.size() << endl;
  39. }
  40. else
  41. {
  42. int t = que_num.front();
  43. printf ("%d\n", que[t].front());
  44. que[t].pop();
  45. if (que[t].empty())
  46. que_num.pop();
  47. }
  48. }
  49. printf ("\n");
  50. }
  51. }

10050 - Hartals

水题一道

解题代码:

  1. //Author :Freetion
  2. //file :10050 - Hartals
  3.  
  4. #include <stdio.h>
  5. #include <iostream>
  6. #include <string.h>
  7. using namespace std;
  8. const int max_n = ;
  9. bool ba[max_n];
  10.  
  11. int main()
  12. {
  13. int T;
  14. int n, p;
  15. scanf ("%d", &T);
  16. while (T--)
  17. {
  18. scanf ("%d%d", &n, &p);
  19. memset(ba, false, sizeof (ba));
  20. for (int i = ; i < p; i ++)
  21. {
  22. int h;
  23. scanf ("%d", &h);
  24. for (int j = h; j <= n; j += h)
  25. {
  26. int wek = (j+)%;
  27. if (wek != && wek != )
  28. ba[j] = true;
  29. }
  30. }
  31. int ans = ;
  32. for (int i = ; i <= n; i ++)
  33. if (ba[i])
  34. ans ++;
  35. printf ("%d\n", ans);
  36. }
  37. return ;
  38. }

刘汝佳 算法竞赛-入门经典 第二部分 算法篇 第六章 1(Lists)的更多相关文章

  1. 刘汝佳 算法竞赛-入门经典 第二部分 算法篇 第五章 1(String)

    第一题:401 - Palindromes UVA : http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8 ...

  2. 刘汝佳 算法竞赛-入门经典 第二部分 算法篇 第五章 3(Sorting/Searching)

    第一题:340 - Master-Mind Hints UVA:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Item ...

  3. 刘汝佳 算法竞赛-入门经典 第二部分 算法篇 第五章 2(Big Number)

    这里的高精度都是要去掉前导0的, 第一题:424 - Integer Inquiry UVA:http://uva.onlinejudge.org/index.php?option=com_onlin ...

  4. 刘汝佳 算法竞赛-入门经典 第二部分 算法篇 第六章 2(Binary Trees)

    112 - Tree Summing 题目大意:给出一个数,再给一颗树,每个头节点的子树被包含在头节点之后的括号里,寻找是否有从头节点到叶子的和与给出的数相等,如果有则输出yes,没有输出no! 解题 ...

  5. 算法竞赛入门经典第二版 TeX中的引号 P47

    #include<bits/stdc++.h> using namespace std; int main(){ ; while( (c = getchar()) !=EOF) //get ...

  6. 算法竞赛入门经典第二版 蛇形填数 P40

    #include<bits/stdc++.h> using namespace std; #define maxn 20 int a[maxn][maxn]; int main(){ ; ...

  7. 算法竞赛入门经典第二版 竖式问题 P42

    #include<bits/stdc++.h> using namespace std; int inset(char *s,int num) { //判断数字是否在数字集中 int le ...

  8. 算法竞赛入门经典第二版 回文词P49

    #include<bits/stdc++.h> using namespace std; char rev[]="A 3 HIL JM O 2TUVWXY51SE Z 8 &qu ...

  9. 算法竞赛入门经典第二版第二章习题-(练习Java和C++语法)

    习题2-1水仙花数(daffodil) 输出1000-999中所有的水仙花数.若三位数ABC满足ABC = A3+B3+C3,则称其为水仙花数. Java: package suanfa; publi ...

随机推荐

  1. java读取各类型的文件

    java读取各类型的文件 用到的几个包 bcmail-jdk14-132.jar/bcprov-jdk14-132.jar/checkstyle-all-4.2.jar/FontBox-0.1.0-d ...

  2. Python性能优化的20条建议 (转载)

    优化算法时间复杂度 算法的时间复杂度对程序的执行效率影响最大,在Python中可以通过选择合适的数据结构来优化时间复杂度,如list和set查找某一个元素的时间复杂度分别是O(n)和O(1).不同的场 ...

  3. shell-IF判断

    #!/bin/bash echo "-----------------strat---------------" read -p "Enter a number:&quo ...

  4. ORACLE 分区表简介

    参考链接:http://blog.csdn.net/ziwen00/article/details/9158725ORACLE-分区表 此文从以下几个方面来整理关于分区表的概念及操作: 1.表空间及分 ...

  5. 企业该如何进行高效IT运维管理

    企业该如何进行高效IT运维管理 在企业内部也是一样,当大量的生产和经营数据集中在数据中心,一旦人们与数据中心因为IT故障而失去联系,停滞的也许不是个人应用受阻这样简单的后果.我们谁也不想看到自己企业的 ...

  6. 使用JSON的数据格式

      在说JSON之前,我们先来看一下在javascript中创建对象的方式,也就是创建对象的字面量表示法.我们知道js中有五种基本的数据类型,分别是: Undefined(变量可能没有声明或者赋值) ...

  7. 查看图片真正的格式,在不知道扩展名的情况下区分是jpeg还是bmp

    用系统自带的画图软件打开图片,然后按文件-->另存为就会弹出保存窗口.保存窗口的保存类形就是"照片真正的格式".

  8. Object:

    所有类的直接或者间接父类,Java认为所有的对象都具备一些基本的共性内容,这些内容可以不断的向上抽取,最终就抽取到了一个最顶层的类中的,该类中定义的就是所有对象都具备的功能. 具体方法: 1,bool ...

  9. 网络攻防工具介绍——Wireshark

    网络攻防工具介绍 Wireshark 简介 Wireshark(前称Ethereal)是一个网络封包分析软件.它是一个理想的开源多平台网络协议分析工具.网络封包分析软件的功能是撷取网络封包,并尽可能显 ...

  10. VS(C++)编程遇到的错误集合

    编译错误 1.error C1010: 原因:没有在文件开头添加include "stdafx.h". 2.error C2440: "=": 无法从" ...