Also want to remember these questions are not really difficult difficult ...
1. Parallelogram ...
The parallelogram area is the largest of the two points on the two straight lines and two points in the given point.
After you determine two points, the points on the line are determined. Then we solve the point on the line and then ask for an area expression, simplifying ....
The process worked well.
Found S = (a*a ' (x1^2-x2^2) +b*b ' (y1^2-y^2) + (a*b ' +b*a ') * (X1*Y1-X2*Y2))/(AD-BC)
................................................. Then O (n) the scanning point ....... .......
Is this really ACM's problem? ......... ............ I feel like I'm back in junior high school .......... .......
#include <cstdio>#include<iostream>#include<algorithm>#include<vector>#include<Set>#include<string.h>#include<cctype>#include<climits>#include<cmath>using namespaceStd;typedefLong Longll;Const intN =1e5;voidUMAX (ll& x,ll y) {if(x<y) x=y;};voidUmin (ll& x,ll y) {if(x>y) x=y;}; ll A,b,c,d;ll P,q,o;ll Calc (ll X,ll y) {returnp*x*x+q*y*y+o*x*y;}intMain () { while(SCANF ("%i64d%i64d%i64d%i64d", &a,&b,&c,&d) = =4) {p= A *C; Q= b*D; o= a*d+b*C; ll MX= LONG_LONG_MIN,MN =Long_long_max; intN; scanf ("%d",&N); while(n--) {ll x, y; scanf ("%i64d%i64d",&x,&y); ll Val=Calc (x, y); UMAX (Mx,val); Umin (Mn,val); } printf ("%.f\n", Fabs ((MX-MN) *Double(1)/(a*d-b*c)); } return 0;}
Calculate Geometry
CCPC Hefei Division//Blacksmith record ..... Back pot or am I here @ctr 233