first.
1610: [Usaco2008 feb]line tethered game time
limit:5 Sec Memory limit:64 MBsubmit:1810 solved:815[Submit] [Status] [Discuss]
DescriptionFarmer John has recently invented a game to test the pretentious Bessie. At the beginning of the game, FJ would give Bessie a piece of wood with a non-coincident point of N (2 Input* Line 1th: Enter 1 positive integers: N* 2nd. N+1 Line: Line i+1 with 2 spaces separated by the integer x_i, y_i, describes the coordinates of point IOutputL
program would repeatedly read in four points that define, lines in the X-y plane and determine how and where the Li NES intersect. All numbers required by this problem would be reasonable, say between-1000 and 1000.InputThe first line contains an integer N between 1 and ten describing how many pairs of lines is represented. The next N lines would each contain eight integers. These integers represent the coordinates of four points on the plane in the order X1y1x2y2x3y3x4y4. Thus each of these in
Topic PortalTest instructions: A polygon, a point and a B point, meet the PB Analysis: This is a Apollonius circle. Since it is a circle, then the general equation of the Circle: (x + d/2) ^ 2 + (y + e/2) ^ 2 = (D ^ 2 + E ^ 2-4 * F)/4, the center and radius are solved by the PB = = PA * k solution equation. Then is a set of templates, Shanghai Jiaotong University's Red Book./************************************************* author:running_time* Created TIME:2015/11/9 Monday 11:51:27* Fil E Name:
Topic PortalTest instructions: Find a straight line, so that the rest of the points are in the same side of the line, and so that the average distance to get straight lines shortest.Analysis: The training guide P274, the convex hull first, if each side is counted side, is O (n ^ 2), however, according to the formula known straight line ax + by + C = 0. The distance from the point (x0, y0) to the line is: Fabs (ax0+by0+c)/sqrt (a*a+ B*B).So as long as the x's and and Y's and, can be calculated at
fixed-point $I $ root axis, which satisfies $IA ^2 = If^2\rightarrow IA = if$.q$\cdot$ e$\cdot$ DCommentary:1. The root axis refers to the equal power of the two circles (trajectory), that is, a point to the power of the two circumference of the same points of the trajectory. The trajectory is a straight line perpendicular to the two-circle concentric line. In particular,When the two circles intersect, the root axis is two round common chord;When the two circles are tangent, the root axis is th
, E; the intN, M; the intTMP[MAXM]; the intANS[MAXM];94 the intOK (point P, line L) { theRT ((L.B.Y-L.A.Y) * (p.x-l.a.x)-(P.Y-L.A.Y) * (l.b.x-l.a.x)); the }98 About BOOLCMP (line A, line B) { - if(A.A = = B.A)returnA.B b.b;101 returnA.A B.A;102 }103 104 intMain () { the //FRead ();106 intx1, x2;107 BOOLFlag =1;108 while(~rint (n) N) {109 Cls (TMP); Cls (ans); the Rint (m); Rint (s.x); Rint (S.Y); Rint (e.x); Rint (E.Y);111 Rep (i, n) { the Rint (x1); Rint (x2);113Line[
Summer training out of the first one blood feel oneself Meng Meng da ...This problem itself is not a pit point is just a translation giant pit ...Solution Thigh in do B ann seniors in do e i idle also nothing just a word a word translation f ...Finally feel ...Most of the problems do not understand ...It doesn't really work ...Presumably ...is to give you a point of n ...M-Loop ...Ask you which circuit is the outermost ...In the end is to let you ask which circuit composed of the largest graphic
.
The procedure for triangular fee-for-horse points is:
(1) If there is a corner greater than 120 degrees. Then the point at which this corner is located is the Fermi point.
(2) if not present. So for the triangle ABC, take two edges (if AB, AC), outward do equilateral triangle get C ' and A '. Then the intersection of AA ' and CC ' is the fee-for-horse point.
So for this n polygon, the strategy I took is completely different, using simulated annealing practice. This approac
The sum of the areas of all triangles that can be composed of the points on a given planeFirst we enumerate each point to establish a planar Cartesian coordinate with this point as the origin and then sort the points on the first to fourth quadrant and the X, Y axis positive half axes according to the slope.Enumerating the second and third points to do this is an O (n^3) positive timeout But what did we find?For each point K its contribution to the answer is:(X1*YK-Y1*XK) + (X2*YK-Y2*XK) +...+ (
This problem with n^2 algorithm can pass, the first arbitrary enumeration of two points, and the center of the triangle to calculate the area, this area may be added (n-2) times, but note that if there are 3 points in the same side, then to subtract, so in the enumeration, each time enumerating a point, and then enumeration and the point of the degree of the difference between 180 points For area, this area minus 2 * (j-i + 1) timesCode:#include UVA 11186-circum Triangle (computational
Turn the cornerTime limit:3000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)Total Submission (s): 2059 Accepted Submission (s): 785problem DescriptionMr West bought a new car! So he's travelling around the city.One day he comes to a vertical corner. The street he is currently in have a width x, the street he wants to turn to have a width y. The car has a length l and a width d.Can Mr West go across the corner?InputEvery line have four real numbers, X, Y, L and W.Proceed to the e
coordinates A (x1,y1) and B (X2,y2) is given by anticlockwise.OutputFor each test case, you should output the coordinate of C (X3,Y3), the result should is rounded to 2 decimal places in a Li Ne.Sample Input4-100.00 0.00 0.00 0.000.00 0.00 0.00 100.000.00 0.00 100.00 100.001.00 0.00 1.866 0.50Sample Output( -50.00,86.60) ( -86.60,50.00) ( -36.60,136.60) (1.00,1.00)The problem and algorithm analysis: input a point coordinate, then enter B point coordinate, calculate c point coordinates, accordin
Topic Link: UVA 1308-viva confettiEnumerate the two circles, process all arcs, and then determine whether the midpoint of each arc is visible, the circle where the arc is visible, and the circle below the arc is also visible.#include Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced. UVA 1308-viva Confetti (geometry)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.