[题目链接]:http://codeforces.com/problemset/problem/340/B [题意] 给你n个点,让你在这里面找4个点构成一个四边形; 求出最大四边形的面积; [题解] 枚举四边形的对角线上的对顶点; 然后再枚举每一个点; 看看这个点是在这条线的哪一侧; 是左侧和右侧; 是左侧的话; 看看这3个点构成的三角形有没有比当前获取的左侧的三角形大: 右侧的话同理; 最后把两侧得到的最大的三角形合在一起; 就是最大的四边形了; O(N 3 )  [Number Of WA…
[题目链接]:http://codeforces.com/contest/803/problem/C [题意] 给你一个数字n;一个数字k; 让你找一个长度为k的序列; 要求这个长度为k的序列的所有数字的和为n; 且这k个数字的最大公因数最大; [题解] key:这个最大公因数一定是n的因子! /* 设最后选出来的k个数字为 a[1],a[2]...a[k]; 这些数字的最大公因数为g g*b[1],g*b[2],...g*b[k] n=g*b[1]+g*b[2]+...+g*b[k]; 这里g…
Maximal Area Quadrilateral CodeForces - 340B 三点坐标求三角形面积(可以带正负,表示向量/点的不同相对位置): http://www.cnblogs.com/xiexinxinlove/p/3708147.html https://jingyan.baidu.com/article/a65957f49596ab24e67f9be7.html 枚举对角线,求出在对角线两侧取任意点能得到的三角形的面积,然后对于每条对角线,最大值就是两侧面积最大值之和. #…
Codeforces Round #198 (Div. 2) 题目链接:Maximal Area Quadrilateral Iahub has drawn a set of \(n\) points in the cartesian plane which he calls "special points". A quadrilateral is a simple polygon without self-intersections with four sides (also cal…
B. Maximal Area Quadrilateral time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Iahub has drawn a set of n points in the cartesian plane which he calls "special points". A quadrilateral…
[codeforces 415D]Mashmokh and ACM 题意:美丽数列定义:对于数列中的每一个i都满足:arr[i+1]%arr[i]==0 输入n,k(1<=n,k<=2000),问满足[数列长度是k && 数列中每一个元素arr[i]在1~n之间 && 数列中元素可以重复]的数列有多少个?结果对10^9+7取余 解题思路:dp[i][j]表示长度是j,最后一位是i的种数 if(kk%i==0) dp[kk][j+1]+=dp[i][j] #inc…
time limit per test4 seconds memory limit per test512 megabytes inputstandard input outputstandard output Vanya got bored and he painted n distinct points on the plane. After that he connected all the points pairwise and saw that as a result many tri…
time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard output PolandBall has such a convex polygon with n veritces that no three of its diagonals intersect at the same point. PolandBall decided to improve i…
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…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Long time ago Alex created an interesting problem about parallelogram. The input data for this problem contained four integer points on the Carte…