摘要: 攻防世界 (xctf.org.cn) robots协议_百度百科 (baidu.com) 如何查看robots协议?怎么写?-阿里云开发者社区 (aliyun.com) 玩转robots协议 - 卢松松博客 (lusongsong.com) Robots协议(爬虫协议、机器人协议) - stards 阅读全文
posted @ 2021-08-25 08:55 infocodez 阅读(43) 评论(0) 推荐(0)
摘要: 803. 区间合并 - AcWing题库 #include <iostream> #include <vector> #include <algorithm> using namespace std; typedef pair<int, int> PII; void merge(vector<PII 阅读全文
posted @ 2021-07-30 21:38 infocodez 阅读(92) 评论(0) 推荐(0)
摘要: 802. 区间和 - AcWing题库 C++ pair的基本用法总结(整理)_sevenjoin的博客-CSDN博客_c++ pair for(auto i : v)遍历容器元素 - ostartech - 博客园 (cnblogs.com) #include <iostream> #includ 阅读全文
posted @ 2021-07-30 16:59 infocodez 阅读(67) 评论(0) 推荐(0)
摘要: 799. 最长连续不重复子序列 - AcWing题库 #include<bits/stdc++.h> #define rep(i,a,b) for(int i=a;i<=b;i++) using namespace std; const int N=1e5+10; int a[N],cnt[N]; 阅读全文
posted @ 2021-07-29 21:35 infocodez 阅读(44) 评论(0) 推荐(0)
摘要: yxc对于负数补码的解释:AcWing 801. 二进制中1的个数 - AcWing(视频末尾部分) 思路:x+(-x)=0,设x≥0,则 -x=0-x,等式右边的二进制形式(以8位举例)为00000000 - x,实际上全0不够减需要向上借一位,即100000000 - x。 而100000000 阅读全文
posted @ 2021-07-22 20:39 infocodez 阅读(357) 评论(0) 推荐(0)
摘要: 双指针算法的核心目的是将o(n2)优化到o(n) 常见问题分类: (1) 对于一个序列,用两个指针维护一段区间 (2) 对于两个序列,维护某种次序,比如归并排序中合并两个有序序列的操作 如何写:先写模拟,再观察两个指针之间的单调关系。 模板: for (int i = 0, j = 0; i < n 阅读全文
posted @ 2021-07-21 21:16 infocodez 阅读(43) 评论(0) 推荐(0)
摘要: 796. 子矩阵的和 - AcWing题库 按自己思路写出来的代码比y总的复杂一些(二维前缀和数组的初始化部分),然后按y总的思路改了一下代码 #include<bits/stdc++.h> #define rep(i,a,b) for(int i=a;i<=b;i++) #define rpe(i 阅读全文
posted @ 2021-07-16 21:05 infocodez 阅读(51) 评论(0) 推荐(0)
摘要: ios::sync_with_stdio(false); ios_base::sync_with_stdio - C++ Reference (cplusplus.com) 优点是提高 cin>> 的读取速度,缺点是不能再使用 scanf() 输入规模≥一百万,建议使用 scanf() ——yxc 阅读全文
posted @ 2021-07-16 20:36 infocodez 阅读(700) 评论(0) 推荐(0)
摘要: 高精度加法: // C = A + B, A >= 0, B >= 0 vector<int> add(vector<int> &A, vector<int> &B) { if (A.size() < B.size()) return add(B, A); vector<int> C; int t 阅读全文
posted @ 2021-07-15 09:45 infocodez 阅读(63) 评论(0) 推荐(0)
摘要: 网络是怎样连接的 (豆瓣) 入门科普类。2018年按目录做的摘录: https://note.youdao.com/s/GsjjGocL ps.无语,里面的截图全挂了。——2023年3月留 ps.奇怪,里面的截图又能正常显示了。——2024年8月留 阅读全文
posted @ 2021-07-14 08:48 infocodez 阅读(51) 评论(0) 推荐(0)
摘要: 整数二分模板: bool check(int x) {/* ... */} // 检查x是否满足某种性质 // 区间[l, r]被划分成[l, mid]和[mid + 1, r]时使用: int bsearch_1(int l, int r) { while (l < r) { int mid = 阅读全文
posted @ 2021-07-13 17:51 infocodez 阅读(46) 评论(0) 推荐(0)
摘要: 788. 逆序对的数量 - AcWing题库 #include<bits/stdc++.h> #define rep(i,a,b) for(int i=a;i<=b;i++) using namespace std; typedef long long ll; const int N=1e5+10; 阅读全文
posted @ 2021-07-13 00:33 infocodez 阅读(39) 评论(0) 推荐(0)
摘要: 787. 归并排序 - AcWing题库 #include<bits/stdc++.h> #define rep(i,a,b) for(int i=a;i<=b;i++) using namespace std; const int N=1e5+10; int q[N],n,tmp[N]; void 阅读全文
posted @ 2021-07-12 21:45 infocodez 阅读(30) 评论(0) 推荐(0)
摘要: 785. 快速排序 - AcWing题库 l + r >> 1的值一定是小于r的,不会取到r。l<r, l+r<2r, (l+r>>1)<(2r>>1), (l+r>>1)<r 而l + r + 1 >> 1的值一定是大于l的,不会取到l。证明类比于上面 >>右移1位,等同于/2 主要注意越界问题 阅读全文
posted @ 2021-07-12 19:10 infocodez 阅读(142) 评论(0) 推荐(0)
摘要: P5461 赦免战俘 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 题解 P5461 【赦免战俘】 - Flandre_495 的博客 - 洛谷博客 (luogu.com.cn) 题解 P5461 【赦免战俘】 - Ritanlisa 的博客 - 洛谷博客 (luogu.org) 阅读全文
posted @ 2021-07-10 17:27 infocodez 阅读(246) 评论(0) 推荐(0)
摘要: P5743 【深基7.习8】猴子吃桃 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 题解 P5743 【【深基7.习8】猴子吃桃】 - 菜鸡 return 的 blog - 洛谷博客 (luogu.com.cn) 题目很简单,循环或者递归都可解决,但这篇题解的思路很有趣。 题目描 阅读全文
posted @ 2021-07-09 23:06 infocodez 阅读(794) 评论(0) 推荐(0)
摘要: 题解 P5736 【【深基7.例2】质数筛】 - HsKr - 洛谷博客 (luogu.com.cn) ps.题没必要看 bool isprime(int n){ if(n<=1) return false; if(n==2||n==3) return true; if(n%6!=1&&n%6!=5 阅读全文
posted @ 2021-07-09 20:03 infocodez 阅读(134) 评论(0) 推荐(0)
摘要: P1321 单词覆盖还原 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 题解 P1321 【单词覆盖还原】 - 又菜又烂,没救了 - 洛谷博客 (luogu.com.cn) ps.naozishigehaodongxikexiwomeiyou #include<bits/stdc 阅读全文
posted @ 2021-07-09 19:52 infocodez 阅读(163) 评论(0) 推荐(0)
摘要: P1957 口算练习题 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 题解 P1957 【口算练习题】 - shangcheng 的博客 - 洛谷博客 (luogu.com.cn) #include<bits/stdc++.h> #define rep(i,a,b) for(in 阅读全文
posted @ 2021-07-09 17:18 infocodez 阅读(135) 评论(0) 推荐(0)
摘要: P1320 压缩技术(续集版) - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 题解 P1320 【压缩技术(续集版)】 - RedContritio 的博客 - 洛谷博客 (luogu.com.cn) 注意:题解的代码,无法跳出第二个循环 for(;~scanf("%c",&c) 阅读全文
posted @ 2021-07-08 15:42 infocodez 阅读(205) 评论(0) 推荐(0)