Blue Bridge Cup Knowledge Points Summary C++ Group B

Summary of the knowledge points of the Blue Bridge provincial competition:
0. Violence (it doesn't matter if you fill in the blanks, programming questions must be optimized, they all say violence, but the violence written by the great god
is not at the same level as the violence we say)
1. String processing (getline , sstream, bitset, lcm, kmp) is
too difficult to basically read and read in vain
2. Greedy, divide and conquer

3. Search (BFS, DFS), recursion, backtracking

4. Mathematics-related knowledge points
1) gcd (greatest common divisor) tossing and dividing method
2) shuffling An=n-1(An-1+An-2)
5. Hexadecimal conversion function (manual conversion is also possible) under csdilib itoa() or...setbase() under iomanip; specific Baidu itoa() and iomanip
format bitset<> (the 9th power of the 10th Blue Bridge Cup 9)
4. Dynamic programming (basic dp)

6. Full permutation (next_pernutation under algorithm) sorting sort() and extended cmp()

7. Minimum spanning tree, and set search-weighted

10. File reading and writing is mainly freopen() under cstdio; I will explain it in detail below to save time (some computers cannot directly copy data to the command line...) (Example 10th Blue Bridge Cup Fill-in-the- blank question maze )
      关于 文件读写 详解加测试案例说明

Create a.txt yourself (store test data such as a string asdasdasadasda)

Put it in the folder where you created .cpp - (heavy) (dot)

#include<cstdio>

#include<iostream>

using namespace std;

int main ()

{
    
    

char  a[100];
#defif io//将这行注释掉就不会进行文件读入
#ifdef io
freopen("a.txt","r",stdin);
#endif
//freopen("aa.txt","w"stdout);//会自动在.cpp所在文件夹下创建一个aa.txt存入输出的数据

cin>>a;

cout<<a<<endl;

return 0;
}

//It has been tested and there is no problem, just write it down

Redirected version:

https://www.cnblogs.com/maxv/p/11734867.html

You can save three for the basics

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324856113&siteId=291194637