上一页 1 2 3 4 5 6 7 ··· 12 下一页
摘要: 恢复内容开始 B.Problem - B - Codeforces 代码: #include<iostream> #include<algorithm> #include<cstring> #include<cstdio> #include<cmath> using namespace std; c 阅读全文
posted @ 2021-08-12 15:59 bonel 阅读(31) 评论(0) 推荐(0)
摘要: 201. 可见的点 - AcWing题库 #include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<algorithm> using namespace std; #define int long l 阅读全文
posted @ 2021-08-06 15:56 bonel 阅读(30) 评论(0) 推荐(0)
摘要: A.Problem - A - Codeforces #include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<algorithm> using namespace std; #define int 阅读全文
posted @ 2021-08-05 16:36 bonel 阅读(26) 评论(0) 推荐(0)
摘要: 1.1291. 轻拍牛头 - AcWing题库 #include<iostream> #include<algorithm> #include<cstdio> #include<cstring> using namespace std; #define int long long const int 阅读全文
posted @ 2021-08-04 16:39 bonel 阅读(35) 评论(0) 推荐(0)
摘要: 1.1292. 哥德巴赫猜想 - AcWing题库 #include<iostream> #include<algorithm> #include<cstdio> #include<cstring> using namespace std; const int maxn = 10000001; bo 阅读全文
posted @ 2021-08-02 18:12 bonel 阅读(57) 评论(0) 推荐(0)
摘要: 一、AcWing背包模型(三) 1.未完 2.从i-XX的状态值过来的,都是从大到小进行循环遍历的,反之 3.记录状态的背包问题:(最短路问题,采用贪心的想法) 1)从下到上判断方案的选取 2)从下到上判断值是加上这个w[i]还是没有你加上这个w[i]的状态进来的,也就是判断dp[i][j]和dp[ 阅读全文
posted @ 2021-07-27 12:29 bonel 阅读(27) 评论(0) 推荐(0)
摘要: F-F Musical Chairs_2019 East Central North America (nowcoder.com) 1)一个是分离两个坐标的关系,原数组中的坐标已经没有用了,只是需要那个change到底是多少; 2)是需要change和那个现在新数组的 3)期间size也是变化的 # 阅读全文
posted @ 2021-07-23 10:54 bonel 阅读(63) 评论(0) 推荐(0)
摘要: 1.滑动窗口 (nowcoder.com) deque容器为一个给定类型的元素进行线性处理,像向量一样,它能够快速地随机访问任一个元素,并且能够高效地插入和删除容器的尾部元素。但它又与vector不同,deque支持高效插入和删除容器的头部元素,因此也叫做双端队列 deque<int>big,sml 阅读全文
posted @ 2021-07-22 16:32 bonel 阅读(37) 评论(0) 推荐(0)
摘要: 1.最大值的最小/最小值的最大一般情况下二分/贪心/动态规划 二分:用已知结果去验证答案是否符合 2.K-th Number (nowcoder.com)(求值->验证)+二分+双指针(定一动一滑动) 3.三分:整数域上进行三分,一个峰顶找最大值,mid=(left+right)/2,midmid= 阅读全文
posted @ 2021-07-22 09:23 bonel 阅读(42) 评论(0) 推荐(0)
摘要: 1.二分查找: binary_search:返回bool值,是否存在 lower_bound:返回可插入的最小位置的迭代器,返回第一个符合条件的元素位置 upper_bound:返回可插入的最大位置的迭代器,返回最后一个符合条件的元素位置 eg:122233456 lower_bound(a,a+9 阅读全文
posted @ 2021-07-20 11:57 bonel 阅读(64) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 12 下一页