04 2021 档案

摘要:易错知识点: 1.sort函数的一般没有声明第三部分也就是cmp函数的话是从小到大排序,声明cmp之后,他会按照对应的cmp规则进行排序比如 int cmp(int x, int t) { return x > y; } 上面的x, y也看也可以是结构体 上面的代码是按照从大到小的顺序排列, 因为只 阅读全文
posted @ 2021-04-24 20:09 梨花满地 阅读(1080) 评论(0) 推荐(0)
摘要:参考快速幂 什么意思呢? 就是优化指数 传统的指数计算 比如计算510000,那么就要计算10000次 而快速幂计算 510000,我们可以计算 255000,一下就把运算次数减少了5000,也可以继续优化,比如可以继续化成625 * 2500就这样一直优化,举一个简单的例子 计算25 如果当前指数 阅读全文
posted @ 2021-04-18 22:00 梨花满地 阅读(105) 评论(0) 推荐(0)
摘要:位运算计算出每一个当前2n(n的范围是0道2n-1)然后加上字符'0'就可以 #include <iostream> #include <cstring> #include <algorithm> using namespace std; int main() { int n; cin >> n; 阅读全文
posted @ 2021-04-15 21:01 梨花满地 阅读(59) 评论(0) 推荐(0)
摘要:题目描述 Lightning McQueen, Strip Weathers, and Chick Hicks are cars that compete in different races against each other. Some races — such as the Piston C 阅读全文
posted @ 2021-04-15 20:31 梨花满地 阅读(109) 评论(0) 推荐(0)
摘要:#### 题目描述 Merida wants some help in predicting her score for an archery tournament. When she fires an arrow, we can compute that arrow’s trajectory gi 阅读全文
posted @ 2021-04-15 20:12 梨花满地 阅读(73) 评论(0) 推荐(0)
摘要:字符串哈希-aciwng原题链接 定一个长度为 n 的字符串,再给定 m 个询问,每个询问包含四个整数 l1,r1,l2,r2,请你判断 [l1,r1] 和 [l2,r2] 这两个区间所包含的字符串子串是否完全相同。 字符串中只包含大小写英文字母和数字。 输入格式 第一行包含整数 n 和 m,表示字 阅读全文
posted @ 2021-04-12 21:52 梨花满地 阅读(61) 评论(0) 推荐(0)
摘要:该算法的作用 可以把多个点纳入同一个集合,可以在将近O(1)的时间复杂度内找到两个点是否在同一个集合 原理实现 原理 : 比如说有10个点(1-10),开始时把他们都分到10个不同的集合里面,然后开始合并集合,例如合并1,2,3为一个集合 那么,把2, 3的祖宗结点都设为1,p[2] = 1, p[ 阅读全文
posted @ 2021-04-12 21:36 梨花满地 阅读(71) 评论(0) 推荐(0)
摘要:问题 E: Pesky Publicans 时间限制: 1 Sec 内存限制: 128 MB 题目描述 Tax collectors in the Roman empire, called publicans, are not well perceived, and for good reason. 阅读全文
posted @ 2021-04-12 20:10 梨花满地 阅读(63) 评论(0) 推荐(0)
摘要:题目描述 You are teaching kindergarten! You wrote down the numbers from 1 to n, in order, on a whiteboard. When you weren’t paying attention, one of your 阅读全文
posted @ 2021-04-11 22:16 梨花满地 阅读(510) 评论(0) 推荐(0)
摘要:题目描述 There is a group of people in an internet email message group. Messages are sent to all members of the group, and no two messages are sent at the 阅读全文
posted @ 2021-04-11 20:46 梨花满地 阅读(445) 评论(0) 推荐(0)
摘要:题目描述 A group of students is taking a True/False exam. Each question is worth one point. You, as their teacher, want to make your students look as good 阅读全文
posted @ 2021-04-11 20:11 梨花满地 阅读(639) 评论(0) 推荐(0)