http://poj.org/problem?id=2398This problem and the previous toys is the same is the output is not the same as this gives is the chaos you have to sort the bezel first#include #include#include#include#include#include#include#include#includeusing namespacestd;#defineMemset (A, B) memset (A,b,sizeof (a))#defineN 5500typedefLong Longll;structnode{intx, Y, V;} P[n],u[n];intY2;intcmpConst void*a,Const void*b) { structNode *c, *F; C=(structNode *) A; F=(structNode *) b; returnC->x-f->x;}intFind (int
to 10000. It is guaranteed that the cake and the ant's home don ' t overlap or contact, and the ant's starting point also are not insid E The cake or his home, and doesn ' t contact with the cake or his home.If the ant touches any part of home, then he's at home.Input ends with a line of 0 0. There may is a blank line between the test cases.Outputfor each test case, print the shortest distance to achieve his goal. Round the result to 2 digits after decimal point.Sample Input1 1-1 1 10-1 1 00 2-
Given two straight lines, determine intersection, overlap, or find the intersectionThe topic of the test templateCode:#include POJ 1269 intersecting Lines (computational geometry)
$ (-y_1,x_1) $. Three-point co-line The angle is $0$ and $a\;\times\;b=0$. Whether the point is on the ray The angle is $0$ and the point multiplication $\geq\;0$. $ Polygon Area Set the polygon vertices to $p_1,p_2,..., p_n$ in turn. $\large{s=|\frac{\sum_{i=1}^{n-1}\overrightarrow{op_i}\times\overrightarrow{op_{i+1}}+\overrightarrow{op_n}\ times\overrightarrow{op_{1}}}{2}}|$. Point to line perpendicular Point to line perpendicular $d,ed\;\perp\; ab$. Rotate the $\overrightarrow{ab}\pi/2$. Str
Title AddressBrief test Instructions:Given the coordinates of two points, and a, B, C of some general linear equation ax+b+c=0, these straight lines act as streets, seeking from one point to another the number of streets to cross. (Not in the street at two o ' All)Thinking Analysis:The street from one point to the other must span the equivalent of 2.1 points on one side of the line and the other on the other side. Only need to take two point coordinates in, a positive one minus. These lines are
Title Address: http://acm.hdu.edu.cn/showproblem.php?pid=3365Idea: Take a[0] as the origin, construct vector a[i]-a[0]. First rotate (note the direction of rotation), then stretch, and finally pan to the end.#include Hdu 3365 New Ground (computational geometry)
Title: The topic is very simple, that is, a matrix is solid, give a line segment, ask if line and matrix intersectProblem-solving ideas: The use of line segments and segments are crossed, and then determine whether the line is inside the matrix, it should be noted that the coordinates of the matrix he gives is obviously not the upper left and right coordinates, it is necessary to judge the bottom left and right point of the coordinates.#include POJ 1410 intersection (
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
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 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 (
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
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.