03 2020 档案
摘要:模板: //快速排序 #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
阅读全文
摘要:(lldb) po a 0x00007ffeefbff60c (lldb) po b 0x00007ffeefbff608 (lldb) p a (int *) $2 = 0x00007ffeefbff60c (lldb) bt * thread #1, queue = 'com.apple.mai
阅读全文
摘要:通过运行【5,100000000】之内的回文素数,发现规律: 5 100000000 回文素数没有4、6、8位的,虽然数的范围是到100,000,000,但是最后一个数只到9989899为止(七位数)。所以直接加一个 if(i>=10000000) return 0; 就可以AC了。 火柴棒 24
阅读全文
摘要:双指针算法: 归并、快排等都是。 双指针算法的作用,将O(n^2)的算法优化成O(n)的算法。 输出一行字符串的每个单词: #include <iostream> #include <cstring> using namespace std; int main() { string str; get
阅读全文
摘要:珠心算:给定一列数,其中有几个数是另外两个数之和 1、一开始想到的就是三重for循环: #include <iostream> #include <cstdio> using namespace std; const int maxn = 1001; int a[maxn],n; int main(
阅读全文