会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
SunCY
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
10
···
12
下一页
2020年4月9日
Toxophily HDU - 2298 三分+二分
摘要: 题目:https://vjudge.net/contest/364745#problem/B 先用三分求出最高点Y,然后在进行二分,求出角度 注意写法 PI的弧度是 acos(-1)/2-EPS接近90度的时候相当于除以0二分的精度可以用迭代次数来保证,比如100次 #include <iostre
阅读全文
posted @ 2020-04-09 23:55 SunCY
阅读(144)
评论(0)
推荐(0)
2020年4月4日
Frodo and pillows CodeForces - 760B 二分 注意l和r的选择
摘要: 以后写l和r的初始值的时候,在不影响合理性的前提下,尽量写大一点 比如下面这个代码,如果r不加以或者l==0就不行 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmat
阅读全文
posted @ 2020-04-04 23:12 SunCY
阅读(178)
评论(0)
推荐(0)
Books ZOJ - 4067 贪心 假二分
摘要: 假二分,并不是钱越多,买的书就越多。 比如你有14块和12块 13 2 3 4 14块买一本,12块买三本 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #
阅读全文
posted @ 2020-04-04 22:33 SunCY
阅读(155)
评论(0)
推荐(0)
二分-M - K Best POJ - 3111 01分数规划
摘要: https://www.cnblogs.com/perseawe/archive/2012/05/03/01fsgh.html 参考这个博客 #include <set> #include <map> #include <queue> #include <math.h> #include <vect
阅读全文
posted @ 2020-04-04 22:22 SunCY
阅读(130)
评论(0)
推荐(0)
Dropping tests POJ - 2976 二分01分数规划
摘要: 参考的事这个博客 #include <set> #include <map> #include <queue> #include <math.h> #include <vector> #include <string> #include <stdio.h> #include <string.h> #
阅读全文
posted @ 2020-04-04 22:21 SunCY
阅读(132)
评论(0)
推荐(0)
The Meeting Place Cannot Be Changed CodeForces - 780B 二分+更新值
摘要: 这个题不难,就是想记录一下这个更新的方式,很漂亮! #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <string> #include <m
阅读全文
posted @ 2020-04-04 21:40 SunCY
阅读(115)
评论(0)
推荐(0)
第六章 数组 指针与字符串 学习笔记
摘要: 注:所有内容源于互联网,如有侵权请和我联系。 数组 数组的概念 •数组是具有一定顺序关系的若干相同类型变量的集合体,组成数组的变量称为该数组的元素。 •数组属于构造类型。 •一维数组的存储数组元素在内存中顺次存放,它们的地址是连续的 例如:a[0]a[1]a[2]a[3]a[4]a[5]a[6]a[
阅读全文
posted @ 2020-04-04 21:00 SunCY
阅读(144)
评论(0)
推荐(0)
Matrix POJ - 3685 枚举+二分
摘要: 传送门:https://vjudge.net/contest/363330#problem/A 题意,nxn的矩阵,每列都是递增的,求整个矩阵中从小到大第m个的数是什么 易错点: 算法中二分找的是一个数x,比它小的数有m个,这样x减一就等等于第m个的数了。 如果直接二分找一个结果res,比res小的
阅读全文
posted @ 2020-04-04 20:59 SunCY
阅读(154)
评论(0)
推荐(0)
2020年3月30日
二分- C - Cable master POJ - 1064
摘要: 题解:使用二分搜索,在输出小数问题上,一般都会指定允许的误差范围或者是输出中小数点后面的位数。因此在使用二分搜索法时,有必要设置合理的结束条件来满足精度的要求。 设定循环次数作为终止条件,1次循环可以把区间的范围缩小一半,100次的循环则可以达到10^(-30)的精度范围,基本上是没有问题的,也可以
阅读全文
posted @ 2020-03-30 22:55 SunCY
阅读(123)
评论(0)
推荐(0)
2020年3月26日
C++的一般组织结构 学习笔记
摘要: 5.6.1 C++程序的一般组织结构 • 一个源程序可以划分为多个源文件: ▫ 类声明文件(.h文件) ▫ 类实现文件(.cpp文件) ▫ 类的使用文件(main()所在的.cpp文件) • 利用工程来组合各个文件。 当代码量很大的时候,可以通过把类写在一个文件中,只需要在main中直接调用就好了
阅读全文
posted @ 2020-03-26 21:48 SunCY
阅读(472)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
10
···
12
下一页
公告