Live2d Test Env

随笔分类 -  OJ---HDU

上一页 1 2 3 4 5 6 ··· 9 下一页
只有注册用户登录后才能阅读该文。
posted @ 2019-04-21 20:12 nimphy 阅读(24) 评论(0) 推荐(0)
摘要:pro:给定N个二维平面的关键点,保证两点连线不经过原点。现在让你安排一条经过原点,但是不经过关键点的直线,使得两边的和的乘积最大。 sol:由于连线不经过原点,所以我们极角排序即可。 具体:因为我们的直线只需要180°,所以我们用atan(y/x)来排序,atan的范围是(-pi/2,pi/2); 阅读全文
posted @ 2019-04-21 19:32 nimphy 阅读(194) 评论(0) 推荐(0)
摘要:pro:二维平面上,给点N个导弹的初始位置,射出方向,速度。问你是找一点,可以从这一点向任意方向发出拦截导弹,速度未V,最小化最大拦截导弹的时间。 如果要拦截一个导弹,必须在导弹发射之后才可以发射拦截导弹。 题意满足V>max(v导弹)。 sol:由于V>vmax,所以有二分的性质,那么这道题其实是 阅读全文
posted @ 2019-04-19 16:34 nimphy 阅读(278) 评论(0) 推荐(0)
摘要:pro:现在在X轴上有N个摩天大楼,以及Q个人,人和大楼的坐标各不相同,保证每个人左边和右边都有楼,问每个人能看到天空的角度大小。 sol:不难想到就是维护凸包,此题就是让你模拟斜率优化,此处没有斜率来做,用几何写的。。。。 阅读全文
posted @ 2019-04-10 21:38 nimphy 阅读(273) 评论(0) 推荐(0)
摘要:pro:给定警察的射击位置,设计方向,敌人的位置,敌人的头部半径,问子弹是否可以射到头部。 sol:即问头部中点到子弹射线的距离是否小于等于头部半径。 和二维的点到直线一样的操作。 det/dot; 用平行四边形面积/底。 那么唯一的问题就是三维向量的det怎么求。 如图: 由于是射线,还要判定是否 阅读全文
posted @ 2019-04-10 16:09 nimphy 阅读(495) 评论(0) 推荐(0)
摘要:pro:给定一个蛋糕,一个矩阵房子,一只蚂蚁。最开始三者两两相离,问蚂蚁触摸到蛋糕后再触摸矩阵的最短距离。结果保留两位小数,坐标的绝对值<1e4; sol:由于坐标不大,而且精度要求不高,不难想到可以暴力一点,直接分割圆。 假设分100000份,得到每个点到蚂蚁和矩阵的距离和,更新答案。 (虽然我想 阅读全文
posted @ 2019-04-10 14:34 nimphy 阅读(222) 评论(0) 推荐(0)
摘要:pro:A的监视区域是一个多边形。 如果A的监视区的内满足到A的距离到不超过到B的距离的K倍的面积大小。K<1 sol:高中几何体经验告诉我们满足题意的区域是个圆,那么就是求圆与多边形的交。 阅读全文
posted @ 2019-04-09 22:08 nimphy 阅读(216) 评论(0) 推荐(0)
摘要:pro:给定一枚蛋糕,蛋糕上某个位置有个草莓,寿星在上面切了N刀,最后寿星会吃含有草莓的那一块蛋糕,问他的蛋糕占总蛋糕的面积比。 sol:显然需要半平面交求含有蛋糕的那一块,然后有圆弧,不太方便求交。 所以我们可以直线构成的边界,求出平面交; 然后用这个多边形去和圆求交。 (百度了一下很多人都没过, 阅读全文
posted @ 2019-04-09 21:45 nimphy 阅读(276) 评论(0) 推荐(0)
摘要:pro:飞行员去轰炸一个小岛,给出炸弹落地点的位置信息,以及轰炸半径;按顺时针或者逆时针给出小岛的边界点。 求被轰炸的小岛面积。 sol:即是求圆和多边形的面积交。 (只会套板子的我改头换面,先理解然后手打一遍。 首先,我们还是用三角剖分多边形,求“有向面积”,有向面积可以避免凹多边形存在的情况,或 阅读全文
posted @ 2019-04-09 16:28 nimphy 阅读(583) 评论(0) 推荐(0)
摘要:As everyone known, The Monkey King is Son Goku. He and his offspring live in Mountain of Flowers and Fruits. One day, his sons get n peaches. And ther 阅读全文
posted @ 2019-02-27 11:41 nimphy 阅读(385) 评论(0) 推荐(0)
摘要:Alice get a string S. She thinks palindrome string is interesting. Now she wanna know how many three tuple (i,j,k) satisfy 1≤i≤j<k≤length(S) , S[i..j] 阅读全文
posted @ 2019-02-08 12:34 nimphy 阅读(366) 评论(0) 推荐(1)
摘要:Sample Input 6 1 a 1 b 2 a 2 c 3 4 8 1 a 2 a 2 a 1 a 3 1 b 3 4 Sample Output 4 5 4 5 11 题意:多组输入,开始字符串为空,支持4中操作: 1,在字符串首加字符; 2,在字符串尾加字符; 3,查询字符串不同本质的回文 阅读全文
posted @ 2019-02-08 11:12 nimphy 阅读(380) 评论(0) 推荐(0)
摘要:Sample Input aca aaaa Sample Output 3 15 题意: 多组输入,每次给定字符串S(|S|<1e5),求多少对不相交的回文串。 思路:可以用回文树求出以每个位置结尾的回文串数,那么累加得到前缀和; 倒着再做一遍得到每个位置为开头的回文串数,乘正向求出的前缀和即可。 阅读全文
posted @ 2019-02-08 10:11 nimphy 阅读(344) 评论(0) 推荐(0)
摘要:CA loves strings, especially loves the palindrome strings. One day he gets a string, he wants to know how many palindromic substrings in the substring 阅读全文
posted @ 2019-02-07 20:37 nimphy 阅读(515) 评论(0) 推荐(0)
摘要:The Wall has down and the King in the north has to send his soldiers to sentinel. The North can be regard as a undirected graph (not necessary to be c 阅读全文
posted @ 2018-12-27 10:29 nimphy 阅读(307) 评论(0) 推荐(0)
摘要:There are N boxes on the ground, which are labeled by numbers from 1 to N. The boxes are magical, the size of each one can be enlarged or reduced arbi 阅读全文
posted @ 2018-12-13 22:40 nimphy 阅读(268) 评论(0) 推荐(0)
摘要:签到题这里久懒得写了。 B - 缺失的数据范围 Total Submission(s): 2602 Accepted Submission(s): 559 题意:求最大的N,满足N^a*[log2(N)]^b<=K; 思路:二分即可,log2要手写,然后就是注意判pow是否超过long long。 阅读全文
posted @ 2018-12-10 11:55 nimphy 阅读(939) 评论(0) 推荐(0)
摘要:In your childhood, do you crazy for collecting the beautiful cards in the snacks? They said that, for example, if you collect all the 108 people in th 阅读全文
posted @ 2018-11-10 15:24 nimphy 阅读(432) 评论(0) 推荐(0)
摘要:题意:略。 思路:网上是用卷积或者做的,不太会。 因为上一题莫比乌斯有个类似的部分,所以想到了每个素因子单独考虑。 我们用C(x^p)表示p次减少分布在K次减少里的方案数,由隔板法可知,C(x^p)=C(K+p-1,K-1); 而且满足C(x)有积性,即gcd(x,y)==1时,有C(x*y)=C( 阅读全文
posted @ 2018-11-07 21:42 nimphy 阅读(231) 评论(0) 推荐(0)
摘要:Consider a network G=(V,E) G=(V,E) with source s s and sink t t . An s-t cut is a partition of nodes set V V into two parts such that s s and t t belo 阅读全文
posted @ 2018-11-06 11:00 nimphy 阅读(152) 评论(1) 推荐(0)

上一页 1 2 3 4 5 6 ··· 9 下一页