acwing-递归实现排列型枚举


#include <iostream>using namespace std;const int N = 10;int path[N];//保存序列bool state[N];//保存状态int n;void dfs(int u){ if(u>n){ //递归边界

acwing 递归实现指数型枚举


#include <iostream>using namespace std;const int N=20;int n;bool vis[N]; //判断选还是不选void DFS(int u) //第几层就是筛选第几个数字{ if(u>n) //不可以有等号,如果有等号会少

Acwing-二进制中1的个数


题目a >> k & 1 可以取第该数字的二进制第k位的值比如 10 >> 2 & 110的二进制为 1010 ,右移2位为 0010,&1得0000,也就是0,第二位也是0参考答案

字符串匹配BF


参考:https://blog.csdn.net/raelum/article/details/128823560#include <iostream>#include <string>using namespace std;/*1、s[ ]是模式串,即比较长的字符串。2、p

acwing-单调栈问题


图来自:https://www.acwing.com/solution/content/27437/参考:https://raelum.blog.csdn.net/article/details/128969669//数组栈 #include <iostream>using namesp

Linux全局代理设置


https://www.cnblogs.com/EasonJim/p/9826681.html说明:为什么说是http代理,其实这个还不能说是全称走代理,罪名写的区别就是ICMP协议这个设置就无效,只能说是90%的应用都可以使用这个设置来实现代理访问,只有个别不行,比如一些软件根本不走http协议的

选择排序详解


选择排序 (Selection Sort)选择排序是一种简单的排序算法。它的基本思想是:第一次从待排序的数据元素中选出最小(或最大)的一个元素,存放在序列的起始位置,然后再从剩余的未排序元素中寻找到最小(大)元素,然后放到已排序的序列的末尾。以此类推,直到全部待排序的数据元素的个数为零。步骤:首先在

【PAT B1009】说反话


#include <iostream>#include <cstdio>using namespace std;int main(void) { string str; getline(cin,str); int len = str.size(),r = 0

回文串题解


#include <iostream>#include <string>using namespace std;bool judge(string s){ int len = s.size(); for (int i = 0; i < len / 2; i+

十进制转2进制数


#include <iostream>using namespace std;//十进制转2进制数int main(void) { int y; cin >> y ; int z[40]; int num = 0; while(y!=0) {