Live2d Test Env

随笔分类 -  数学

摘要:A point belongs to a triangle if it lies inside the triangle or on one of its sides. Two triangles are disjoint if there is no point on the plane that 阅读全文
posted @ 2018-08-26 21:53 nimphy 阅读(403) 评论(0) 推荐(0)
摘要:Nowadays all circuses in Berland have a round arena with diameter 13 meters, but in the past things were different. In Ancient Berland arenas in circu 阅读全文
posted @ 2018-08-21 15:20 nimphy 阅读(475) 评论(0) 推荐(1)
摘要:Nikita likes tasks on order statistics, for example, he can easily find the kk-th number in increasing order on a segment of an array. But now Nikita 阅读全文
posted @ 2018-08-16 19:02 nimphy 阅读(373) 评论(0) 推荐(0)
摘要:After the war, the supersonic rocket became the most common public transportation. Each supersonic rocket consists of two "engines". Each engine is a 阅读全文
posted @ 2018-08-16 14:55 nimphy 阅读(272) 评论(0) 推荐(0)
摘要:题意:给定平面上N个点,问是否存在三角形,其面积为S。 思路:选择Y轴,枚举这个Y轴,面积大小只与|y-Y|有关,然后二分,具体的可以先去做BZOJ3707。 具体的: 1,先对点排序,X坐标为第一关键字,Y坐标为第二关键字,从小到大排序。 2,得到C(N,2)条直线,按照它们的斜率为关键字(叉积排 阅读全文
posted @ 2018-08-15 22:50 nimphy 阅读(530) 评论(0) 推荐(0)
摘要:Mrs. Smith is trying to contact her husband, John Smith, but she forgot the secret phone number! The only thing Mrs. Smith remembered was that any per 阅读全文
posted @ 2018-08-15 09:36 nimphy 阅读(235) 评论(0) 推荐(0)
摘要:Notice: unusual memory limit! After the war, destroyed cities in the neutral zone were restored. And children went back to school. The war changed the 阅读全文
posted @ 2018-08-14 21:50 nimphy 阅读(214) 评论(0) 推荐(0)
摘要:题意:给定一个N,让你把它拆成若干个只含素因子2和3的数之和,且两两之间没有倍数关系,比如10=4+6。 思路:即是2因子的幂递增,3因子的幂递减;或者反之。 对于当前N,我们拆分出的数为num=2^x*3^y;满足2^x|N,而且y最大,然后把继续拆分N-num。不难推出,N-num是个偶数,且至 阅读全文
posted @ 2018-08-14 09:34 nimphy 阅读(310) 评论(0) 推荐(0)
摘要:题意:现在有函数,每一项Xi=(A*X(i-1)+B)%C。现在给定N个函数以及K:X0,A,B,C。然你再每个函数选择一个数,使得其和最大,而且不被K整除。 X0,A,B,C<=1e3 ;K<=1e9 思路:因为C比较小,我们可以找到循环节(不一定是从0开始就循环了,所以用vis判定是否出现过)。 阅读全文
posted @ 2018-08-13 09:58 nimphy 阅读(298) 评论(0) 推荐(0)
摘要:题意:给定长度为N的01串,现在让你猜这个串,猜的次数要不超过N+500次。 每次你猜一个串,系统会返回N/2,或N,或0。当且当有N/2个位置猜对,N个位置猜对,其他。 思路:因为信息不多,没有关联性,所以前期只有瞎猜,直到猜到一个N/2,(如果是N也ok)。猜到N/2之后,我们从这个N/2串考虑 阅读全文
posted @ 2018-08-13 08:31 nimphy 阅读(282) 评论(0) 推荐(0)
摘要:题意:给定一个凸包,现在让你连接凸包上两点,把凸包变为两个多边形,满足两个多边形的面积都是整数。 思路:我们知道整点的三角形面积S=叉积/2,则S要么是整数,要么是整数+0.5。那么多边形有多个三角形组成=So01+So12+So23+...(o是原点),也有这样的性质。因此,我们现在在算面积的时候 阅读全文
posted @ 2018-08-11 10:54 nimphy 阅读(573) 评论(0) 推荐(0)
摘要:题意:给定几个圆,求最短的围合,把这几个包围起来,而且到圆的距离都不小于10. 思路:把每个圆的半径+10,边等分5000份,然后求凸包即可。 阅读全文
posted @ 2018-08-04 11:59 nimphy 阅读(379) 评论(0) 推荐(0)
摘要:手抄码板大法。 阅读全文
posted @ 2018-08-04 09:25 nimphy 阅读(793) 评论(0) 推荐(0)
摘要:Description osu 是一款群众喜闻乐见的休闲软件。 我们可以把osu的规则简化与改编成以下的样子: 一共有n次操作,每次操作只有成功与失败之分,成功对应1,失败对应0,n次操作对应为1个长度为n的01串。在这个串中连续的 X个1可以贡献X^3 的分数,这x个1不能被其他连续的1所包含(也 阅读全文
posted @ 2018-07-18 09:22 nimphy 阅读(330) 评论(0) 推荐(0)
摘要:You are given an integer sequence a1,a2,…,ana1,a2,…,an. Find the number of pairs of indices (l,r)(l,r) (1≤l≤r≤n1≤l≤r≤n) such that the value of median 阅读全文
posted @ 2018-07-10 21:15 nimphy 阅读(306) 评论(0) 推荐(0)
摘要:Allen and Bessie are playing a simple number game. They both know a function f:{0,1}n→Rf:{0,1}n→R, i. e. the function takes nn binary arguments and re 阅读全文
posted @ 2018-06-25 16:45 nimphy 阅读(284) 评论(0) 推荐(0)
摘要:For a vector →v=(x,y)v→=(x,y), define |v|=√x2+y2|v|=x2+y2. Allen had a bit too much to drink at the bar, which is at the origin. There are nn vectors  阅读全文
posted @ 2018-06-25 16:36 nimphy 阅读(624) 评论(0) 推荐(1)
摘要:对于一个 11 到 nn 的排列 p1,p2,⋯,pnp1,p2,⋯,pn ,我们可以轻松地对于任意的 1≤i≤n1≤i≤n 计算出 (li,ri)(li,ri) ,使得对于任意的 1≤L≤R≤n1≤L≤R≤n 来说 min(pL,pL+1,⋯,pR)=pimin(pL,pL+1,⋯,pR)=pi  阅读全文
posted @ 2018-06-14 21:03 nimphy 阅读(399) 评论(0) 推荐(0)
摘要:jyy就一直想着尽快回地球,可惜他飞船的燃料不够了。 有一天他又去向火星人要燃料,这次火星人答应了,要jyy用飞船上的瓶子来换。jyy的飞船上共有 N个瓶子(1<=N<=1000) ,经过协商,火星人只要其中的K 个 。 jyy将 K个瓶子交给火星人之后,火星人用它们装一些燃料给 jyy。所有的瓶子 阅读全文
posted @ 2018-06-12 16:54 nimphy 阅读(290) 评论(0) 推荐(0)
摘要:给定一个长度为 N 的正整数序列Ai对于其任意一个连续的子序列{Al,Al+1...Ar},我们定义其权值W(L,R )为其长度与序列中所有元素的最大公约数的乘积,即W(L,R) = (R-L+1) ∗ gcd (Al..Ar)。 JYY 希望找出权值最大的子序列。 Input 输入一行包含一个正整 阅读全文
posted @ 2018-06-12 16:32 nimphy 阅读(899) 评论(0) 推荐(0)