摘要:
理解 1、check(int x) 检查x是否满足某种性质 2、模板1为:满足条件向左逼近,不满足条件向右逼近。如果有多个满足条件的数据,返回最左边那个。 3、模板2为:满足条件向右逼近,不满足条件向左逼近。如果有多个满足条件的数据,返回最右边那个。 4、yxc大佬的模板,适用于二分查找和二分答案。 阅读全文
posted @ 2021-07-25 12:54
糖豆爸爸
阅读(132)
评论(0)
推荐(0)
摘要:
题目传送门 #include <bits/stdc++.h> using namespace std; typedef long long LL; //典型的二分答案题, 答案为最短(可以理解为最小)的跳跃距离最大值 int L; int n, m; const int N = 50010; int 阅读全文
posted @ 2021-07-25 10:39
糖豆爸爸
阅读(88)
评论(0)
推荐(0)
摘要:
题目传送门 无脑的二分答案模板,锻炼写一下check函数吧。 同时有一点需要注意,就是$l$的初始值不能是0!,否则第四个测试点RE掉! #include <bits/stdc++.h> typedef long long LL; using namespace std; const int N = 阅读全文
posted @ 2021-07-25 10:37
糖豆爸爸
阅读(90)
评论(0)
推荐(0)

浙公网安备 33010602011771号