上一页 1 ··· 5 6 7 8 9 10 下一页
摘要: DFS全排列: #include <iostream> #include <cstring> using namespace std; const int N = 10; int n,path[N]; bool sta[N]; void dfs(int u) { if(u == n) { for(i 阅读全文
posted @ 2020-04-08 22:40 龙雪可可 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 区间和: #include <iostream> #include <vector> #include <algorithm> using namespace std; const int N = 300000; int a[N],s[N]; typedef pair<int, int> PII; 阅读全文
posted @ 2020-04-08 11:39 龙雪可可 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 前缀和子矩阵: #include <iostream> using namespace std; const int N = 1010; int a[N][N],s[N][N]; int main() { int n,m,k; cin>>n>>m>>k; for(int i = 1;i<=n;i++ 阅读全文
posted @ 2020-04-07 00:42 龙雪可可 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 输入样例: 6 3 1 2 2 3 3 4 3 4 5 输出样例: 3 4 5 5 -1 -1 #include <iostream> using namespace std; const int N = 100010; int a[N]; int main() { int n,q,x; cin>> 阅读全文
posted @ 2020-04-04 23:01 龙雪可可 阅读(501) 评论(0) 推荐(0) 编辑
摘要: 模板: //快速排序 #include <iostream> using namespace std; const int N = 100010; int a[N]; void qsort(int l, int r) { if(l >= r) return; int i = l - 1, j = r 阅读全文
posted @ 2020-03-31 11:25 龙雪可可 阅读(113) 评论(0) 推荐(0) 编辑
摘要: (lldb) po a 0x00007ffeefbff60c (lldb) po b 0x00007ffeefbff608 (lldb) p a (int *) $2 = 0x00007ffeefbff60c (lldb) bt * thread #1, queue = 'com.apple.mai 阅读全文
posted @ 2020-03-23 16:45 龙雪可可 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-03-22 12:08 龙雪可可 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 通过运行【5,100000000】之内的回文素数,发现规律: 5 100000000 回文素数没有4、6、8位的,虽然数的范围是到100,000,000,但是最后一个数只到9989899为止(七位数)。所以直接加一个 if(i>=10000000) return 0; 就可以AC了。 火柴棒 24 阅读全文
posted @ 2020-03-16 14:57 龙雪可可 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 双指针算法: 归并、快排等都是。 双指针算法的作用,将O(n^2)的算法优化成O(n)的算法。 输出一行字符串的每个单词: #include <iostream> #include <cstring> using namespace std; int main() { string str; get 阅读全文
posted @ 2020-03-11 22:19 龙雪可可 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 珠心算:给定一列数,其中有几个数是另外两个数之和 1、一开始想到的就是三重for循环: #include <iostream> #include <cstdio> using namespace std; const int maxn = 1001; int a[maxn],n; int main( 阅读全文
posted @ 2020-03-10 07:41 龙雪可可 阅读(404) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 下一页
****************************************** 页脚Html代码 ******************************************