题意:给定平面上N个点,问是否存在三角形,其面积为S. 思路:选择Y轴,枚举这个Y轴,面积大小只与|y-Y|有关,然后二分,具体的可以先去做BZOJ3707. 具体的: 1,先对点排序,X坐标为第一关键字,Y坐标为第二关键字,从小到大排序. 2,得到C(N,2)条直线,按照它们的斜率为关键字(叉积排序比较准确),从小到大排序. 3,二分答案,对当前直线,我们只处理线段左边(相对来说)的点,左边的点距离当前“Y轴”具有单调性. 而得到当前直线的两个点,相对于下一条直线,其相对位置会发生改变. 简单…
Given n distinct points on a plane, your task is to find the triangle that have the maximum area, whose vertices are from the given points. Input The input consists of several test cases. The first line of each test case contains an integer n, indica…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Mahmoud has n line segments, the i-th of them has length ai. Ehab challenged him to use exactly 3 line segments to form a non-degenerate triangl…
题目链接:http://codeforces.com/problemset/problem/558/B 题目意思:给出一个序列,然后找出出现次数最多,但区间占用长度最短的区间左右值. 由于是边读入边比较,因此问题最关键的是,记录每个数第一次出现的位置,即左值.因为要保证次数是出现最多,因此需要一个cnt[]数组来记录出现次数.然后当最多出现次数与当前cnt[x]次数相同时,要选择区间较短的,再更新左右区间值. 赛中短路竟然想不出来~~~泪啊~~泪啊- >_< #include <iost…
题目链接:http://codeforces.com/problemset/problem/336/A 好简单的一条数学题,是8月9日的.比赛中没有做出来,今天看,从pupil变成Newbie了,那个伤心啊----不是分数的缘故,而是心态!!!昨晚一直卡机,网页很久才打得开,35min才进入比赛页面,接着做的时候又非常浮躁,静不下心来,提交时再次卡机,临20多min才提交成功,于是罢想!!心态真不好!!!这是第一次做题做得那么糟糕,要端正心态才行,遇到什么紧急情况都要冷静,保持清醒的头脑. 题意…
time limit per test:1 secondmemory limit per test:256 megabytesinput:standard inputoutput:standard output There is a right triangle with legs of length a and b. Your task is to determine whether it is possible to locate the triangle on the plane in s…
D - Vasya and Triangle #include<bits/stdc++.h> using namespace std; #define LL long long LL gcd(LL a,LL b){ ? a:gcd(b,a%b); } int main(){ LL n,m,k; cin>>n>>m>>k; )%k){ cout<<"NO"<<endl; ; } LL g=gcd(n*,k),p=gc…
链接:https://www.nowcoder.com/acm/contest/104/A来源:牛客网 题目描述 Let  be a regualr triangle, and D is a point in the triangle. Given the angle of . Then let AD, CD and BD form a new triangle, what is the size of the three angles?     #include<math.h> #inclu…
题意 给出平面上 \(n\) 个点 \((x_i, y_i)\),问是否存在三个点构成的三角形的面积恰好为 \(S\) ,有的话,输出任意一组解即可. \(n\leq 2000\) 分析 BZOJ3707稍微改动 这种点到直线的问题可以考虑单调性. 将所有点以 \(x\) 为第一关键字, \(y\) 为第二关键字排序.然后枚举二元组 \((i,j)(i< j)\) 代表的直线,并按照极角排序. 顺次枚举直线,记录每个点当前的 \(rank\) ,表示以当前直线为 \(x\) 轴时点的 \(y\)…
After the war, the supersonic rocket became the most common public transportation. Each supersonic rocket consists of two "engines". Each engine is a set of "power sources". The first engine has nn power sources, and the second one has…