上一页 1 ··· 78 79 80 81 82 83 84 85 86 ··· 171 下一页
摘要: 题目传送门 无脑的二分答案模板,锻炼写一下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)
摘要: 题目传送门 浮点数二分的模板 https://www.acwing.com/problem/content/792/ C++ 代码 #include <bits/stdc++.h> using namespace std; const double eps = 1e-8; // eps 表示精度,取 阅读全文
posted @ 2021-07-23 10:32 糖豆爸爸 阅读(89) 评论(0) 推荐(0)
摘要: 首先在官网找到需要下载的文件,点击下载。 在浏览器或者下载软件中就可以看到这么一个下载地址了,将其复制下来(如下图箭头所指)。 然后将红框内的部分更换为如下内容: vscode.cdn.azure.cn ← 就是左边这个 更新后的地址为:http://vscode.cdn.azure.cn/stab 阅读全文
posted @ 2021-07-23 08:28 糖豆爸爸 阅读(754) 评论(0) 推荐(1)
摘要: 题目传递门 本题是一道二分答案的板子题,有一点点贪心。 总结: 1、$l$与$r$的确定,我喜欢使用数组排序来获取最终的最大值,即$r$;而$l$不一定是数组的最小值,这个和题意有关,也可能是$0$。 2、即然是二分答案的模板题,那板子是必须的,另一个重要的问题就是$check$函数了,它需要检查什 阅读全文
posted @ 2021-07-22 17:10 糖豆爸爸 阅读(540) 评论(0) 推荐(2)
摘要: 题目传送门 #include <bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e6 + 10; int a[N]; int n; LL m; bool check(int x) { LL sum = 阅读全文
posted @ 2021-07-22 11:16 糖豆爸爸 阅读(102) 评论(0) 推荐(0)
摘要: 题目传送门 一、二分法解法 #include <bits/stdc++.h> using namespace std; const int N = 200010; int a[N]; int c; typedef long long LL; LL cnt; int main() { int n; c 阅读全文
posted @ 2021-07-22 09:50 糖豆爸爸 阅读(93) 评论(0) 推荐(0)
摘要: 题目传送门 #include <bits/stdc++.h> using namespace std; int n, m, k; const int N = 1e6 + 10; int a[N]; bool check(int mid) { return a[mid] >= k; } int mai 阅读全文
posted @ 2021-07-22 08:50 糖豆爸爸 阅读(87) 评论(0) 推荐(0)
摘要: 题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 15; char a[N][N];//原始图案 char c[N][N];//目标图案 char t[N][N];//转换后的图案 char t2[N][N]; int 阅读全文
posted @ 2021-07-21 16:36 糖豆爸爸 阅读(95) 评论(0) 推荐(0)
摘要: 题目传送门 本题目是$P1319$的逆运算,计入的是压缩码,输出的是字符矩阵。 #include <bits/stdc++.h> using namespace std; const int N = 210; string a[N]; //注意这里的是字符串数组! int sum; int main 阅读全文
posted @ 2021-07-21 16:34 糖豆爸爸 阅读(109) 评论(0) 推荐(0)
摘要: 题目传送门 #include <bits/stdc++.h> using namespace std; int n; //汉字点阵的长和宽 int num; //输出1还是0呢?默认是0 int m; //每次输入的值是几个 int k; //已经处理完的数字个数 int main() { cin 阅读全文
posted @ 2021-07-21 16:30 糖豆爸爸 阅读(105) 评论(0) 推荐(0)
上一页 1 ··· 78 79 80 81 82 83 84 85 86 ··· 171 下一页
Live2D