上一页 1 ··· 77 78 79 80 81 82 83 84 85 ··· 171 下一页
摘要: 题目传送门 #include <bits/stdc++.h> using namespace std; int n, m; //n*m的棋盘 int x, y; //马的位置 const int N = 410; int ans[N][N]; //到任意点需要最少走几步 //坐标 struct co 阅读全文
posted @ 2021-07-26 17:04 糖豆爸爸 阅读(83) 评论(0) 推荐(0)
摘要: 题目传送门 1、深度优先搜索 #include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; int res; //每一科目试题时间总和 int s[20 + 10]; //科目数量 int a[60 + 10]; 阅读全文
posted @ 2021-07-26 16:30 糖豆爸爸 阅读(430) 评论(0) 推荐(1)
摘要: 题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 100; int a[N], n, ans; int b1[N];//列桶 int b2[N];//正对角线桶 int b3[N];//反对角线桶 //解决:第x行的皇 阅读全文
posted @ 2021-07-26 16:17 糖豆爸爸 阅读(96) 评论(0) 推荐(0)
摘要: IDEA导入/导出live templates或者其他设置 导出 在菜单栏选择 File | Manage IDE Settings | Export Settings 在打开的导出弹窗中,选择需要导出的项目,如果我们只需要导出Live templates,那就只选择Live templates即可 阅读全文
posted @ 2021-07-26 15:05 糖豆爸爸 阅读(920) 评论(1) 推荐(1)
摘要: 题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 100010; const double eps = 1e-6; const double MAX = 1e10; //为什么上限要是1e10?浏览了很多题解,都说是浮 阅读全文
posted @ 2021-07-26 10:44 糖豆爸爸 阅读(130) 评论(0) 推荐(0)
摘要: 题目传送门 1、浮点数二分 2、对于金融知识要了解,这个利息是固定的,但总金额是递减的。 #include <bits/stdc++.h> using namespace std; typedef long long LL; int n; //n:表示贷款的原值 int m; //m:表示每月支付的 阅读全文
posted @ 2021-07-26 09:56 糖豆爸爸 阅读(291) 评论(0) 推荐(0)
摘要: 题目传送门 一、为什么可以使用二分,怎么想到的? 每段和的最大值最小。,提示的很明显,什么最大值最小,最小值最大等等,均可以视为二分答案题。为啥呢?因为二分的本质是区间逼近,这样才能求出极值,不用二分你说用啥? 二、二分查找的是什么? 本题查找的肯定是每段和的最大值,逼近的是让它最小。 三、左右边界 阅读全文
posted @ 2021-07-26 09:12 糖豆爸爸 阅读(227) 评论(0) 推荐(0)
摘要: 题目传送门 #include <bits/stdc++.h> using namespace std; typedef long long LL; const int N = 100010; int a[N]; int L;//表示公路的长度 int n;//原有路标的数量 int k;//最多可增 阅读全文
posted @ 2021-07-26 08:15 糖豆爸爸 阅读(326) 评论(0) 推荐(0)
摘要: 理解 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)
上一页 1 ··· 77 78 79 80 81 82 83 84 85 ··· 171 下一页
Live2D