锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久人人爽人人人人片av,久久精品国产亚洲77777,久久无码人妻一区二区三区午夜 http://www.shnenglu.com/vontroy/category/15066.htmlzh-cnSun, 20 Jan 2013 21:00:21 GMTSun, 20 Jan 2013 21:00:21 GMT60POJ 2653 Pick-up sticks 鍒ゆ柇綰挎鐩鎬氦http://www.shnenglu.com/vontroy/archive/2010/10/03/128488.htmlVontroyVontroySun, 03 Oct 2010 08:21:00 GMThttp://www.shnenglu.com/vontroy/archive/2010/10/03/128488.htmlhttp://www.shnenglu.com/vontroy/comments/128488.htmlhttp://www.shnenglu.com/vontroy/archive/2010/10/03/128488.html#Feedback0http://www.shnenglu.com/vontroy/comments/commentRss/128488.htmlhttp://www.shnenglu.com/vontroy/services/trackbacks/128488.htmlPick-up sticks
Time Limit: 3000MS Memory Limit: 65536K
Total Submissions: 4189 Accepted: 1501

Description

Stan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan tries to find the top sticks, that is these sticks such that there is no stick on top of them. Stan has noticed that the last thrown stick is always on top but he wants to know all the sticks that are on top. Stan sticks are very, very thin such that their thickness can be neglected.                                                             
                                                                                                                                                                                      

Input

Input consists of a number of cases. The data for each case start with 1 <= n <= 100000, the number of sticks for this case. The following n lines contain four numbers each, these numbers are the planar coordinates of the endpoints of one stick. The sticks are listed in the order in which Stan has thrown them. You may assume that there are no more than 1000 top sticks. The input is ended by the case with n=0. This case should not be processed.

Output

For each input case, print one line of output listing the top sticks in the format given in the sample. The top sticks should be listed in order in which they were thrown.

The picture to the right below illustrates the first case from input.

Sample Input

5
1 1 4 2
2 3 3 1
1 -2.0 8 4
1 4 8 2
3 3 6 -2.0
3
0 0 1 1
1 0 2 1
2 0 3 1
0

Sample Output

Top sticks: 2, 4, 5.
Top sticks: 1, 2, 3.

Hint

Huge input,scanf is recommended.

/***********************************
鏆村姏灝辮錛屼粠絎竴涓紑濮嬪垽鏂?br />濡傛灉涓ゆ潯綰挎鐩鎬氦灝辨妸鍓嶉潰涓鏉$瓫閫夋帀
鍒ゆ柇綰挎鐩鎬氦鐩存帴璐寸殑鍚夊ぇ妯℃澘銆傘傘?br />**********************************
*/

#include 
<iostream>
#include 
<cstdio>
#include 
<cstring>

using namespace std;

const int maxn = 100000 + 5;
const double eps=1e-10;

struct point double x, y; };

point p[maxn], b[maxn];
bool ans[maxn];

double min(double a, double b) return a < b ? a : b; }

double max(double a, double b) return a > b ? a : b; }

bool inter(point a, point b, point c, point d)
{
    
if( min(a.x, b.x) > max(c.x, d.x) ||
        min(a.y, b.y) 
> max(c.y, d.y) ||
        min(c.x, d.x) 
> max(a.x, b.x) ||
        min(c.y, d.y) 
> max(a.y, b.y) )
    
return 0;

    
double h, i, j, k;

    h 
= (b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x);
    i 
= (b.x - a.x) * (d.y - a.y) - (b.y - a.y) * (d.x - a.x);
    j 
= (d.x - c.x) * (a.y - c.y) - (d.y - c.y) * (a.x - c.x);
    k 
= (d.x - c.x) * (b.y - c.y) - (d.y - c.y) * (b.x - c.x);

    
return h * i <= eps && j * k <= eps;
}


int main()
{
    
int n;
    
int res[maxn];
    
while( cin >> n, n )
    
{
        memset( ans, 
0sizeof( ans ) );
        
forint i = 0; i < n; i++ )
        
{
            cin 
>> p[i].x >> p[i].y >> b[i].x >> b[i].y;
        }


        
forint i = 0; i < n; i++ )
        
{
            
forint j = i + 1; j < n; j++ )
            
{
                
if( inter(p[i], b[i], p[j], b[j] ) )
                
{
                    ans[i] 
= 1;
                    
break;              //涓嶅姞break浼氳秴鏃躲傘傘?/span>
                }

            }

        }

        
int ct = 0;
        cout 
<< "Top sticks: ";
        
forint i = 0; i < n; i++ )
            
if!ans[i] )  res[ct++= i + 1;
        
forint i = 0; i < ct - 1; i++ )
            cout 
<< res[i] << "";
        cout 
<< res[ct-1<< "." << endl;
    }

    
return 0;
}



Vontroy 2010-10-03 16:21 鍙戣〃璇勮
]]>
POJ 1269 Intersecting Lines 鍒ゆ柇鐩寸嚎鐩鎬氦騫舵眰浜ょ偣http://www.shnenglu.com/vontroy/archive/2010/10/03/128429.htmlVontroyVontroySun, 03 Oct 2010 03:03:00 GMThttp://www.shnenglu.com/vontroy/archive/2010/10/03/128429.htmlhttp://www.shnenglu.com/vontroy/comments/128429.htmlhttp://www.shnenglu.com/vontroy/archive/2010/10/03/128429.html#Feedback0http://www.shnenglu.com/vontroy/comments/commentRss/128429.htmlhttp://www.shnenglu.com/vontroy/services/trackbacks/128429.html
Intersecting Lines

Time Limit: 1000MS Memory Limit: 10000K
Total Submissions: 4260 Accepted: 2049

Description

We all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will intersect in one of three ways: 1) no intersection because they are parallel, 2) intersect in a line because they are on top of one another (i.e. they are the same line), 3) intersect in a point. In this problem you will use your algebraic knowledge to create a program that determines how and where two lines intersect.
Your program will repeatedly read in four points that define two lines in the x-y plane and determine how and where the lines intersect. All numbers required by this problem will be reasonable, say between -1000 and 1000.

Input

The first line contains an integer N between 1 and 10 describing how many pairs of lines are represented. The next N lines will each contain eight integers. These integers represent the coordinates of four points on the plane in the order x1y1x2y2x3y3x4y4. Thus each of these input lines represents two lines on the plane: the line through (x1,y1) and (x2,y2) and the line through (x3,y3) and (x4,y4). The point (x1,y1) is always distinct from (x2,y2). Likewise with (x3,y3) and (x4,y4).

Output

There should be N+2 lines of output. The first line of output should read INTERSECTING LINES OUTPUT. There will then be one line of output for each pair of planar lines represented by a line of input, describing how the lines intersect: none, line, or point. If the intersection is a point then your program should output the x and y coordinates of the point, correct to two decimal places. The final line of output should read "END OF OUTPUT".

Sample Input

5
0 0 4 4 0 4 4 0
5 0 7 6 1 0 2 3
5 0 7 6 3 -6 4 -3
2 0 2 27 1 5 18 5
0 3 4 0 1 2 2 5

Sample Output

INTERSECTING LINES OUTPUT
POINT 2.00 2.00
NONE
LINE
POINT 2.00 5.00
POINT 1.07 2.20
END OF OUTPUT
/*************************************
璁$畻鍑犱綍鍩虹棰橈紝鍒ゆ柇鐩寸嚎鐩鎬氦鍙婃眰浜ょ偣
娉ㄦ剰鏂滅巼涓嶅瓨鍦ㄧ殑鎯呭喌
*************************************
*/

#include 
<iostream>
#include 
<cstdio>

int main()
{
    
double x1, y1, x2, y2, x3, y3, x4, y4;
    
int n;
    
double k1, k2;
    
double b1, b2;
    
double i_x, i_y;
    scanf(
"%d"&n);
    std::cout 
<< "INTERSECTING LINES OUTPUT" << std::endl;
    
while( n-- )
    
{
        scanf(
"%lf%lf%lf%lf%lf%lf%lf%lf"&x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4);

        
if( x1 != x2 && x3 != x4 )
        
{
            k1 
= ( y2 - y1 ) / ( x2 - x1 );
            k2 
= ( y4 - y3 ) / ( x4 - x3 );
            b1 
= y1 - k1 * x1;
            b2 
= y3 - k2 * x3;
            
if( k1 == k2 )
            
{
                
if( b1 == b2 )
                    printf(
"LINE\n");
                
else
                    printf(
"NONE\n");
            }

            
else
            
{
                i_x 
= (b2 - b1) / (k1 - k2);
                i_y 
= k1 * i_x + b1;
                printf(
"POINT %.2lf %.2lf\n", i_x, i_y);
            }

        }

        
else if( x1 == x2 && x3 == x4 )
        
{
            
if( x1 == x3 )
            std::cout 
<< "LINE\n";
            
else
            std::cout 
<< "NONE\n";
        }

        
else if( x1 == x2 && x3 != x4 )
        
{
            k2 
= ( y4 - y3 ) / ( x4 - x3 );
            b2 
= y3 - k2 * x3;
            i_x 
= x1;
            i_y 
= k2 * x1 + b2;
            printf(
"POINT %.2lf %.2lf\n", i_x, i_y);
        }

        
else
        
{
            k1 
= ( y2 - y1 ) / ( x2 - x1 );
            b1 
= y1 - k1 * x1;
            i_x 
= x3;
            i_y 
= k1 * x3 + b1;
            printf(
"POINT %.2lf %.2lf\n", i_x, i_y);
        }

    }

    std::cout 
<< "END OF OUTPUT\n";
    
return 0;
}



Vontroy 2010-10-03 11:03 鍙戣〃璇勮
]]>
国产精品久久久久9999| 久久精品综合一区二区三区| 国产免费久久精品99re丫y| 久久综合色老色| 久久狠狠高潮亚洲精品| 久久这里只精品国产99热| 久久国产精品免费一区二区三区 | 亚洲成人精品久久| 99热成人精品免费久久| 久久天天躁夜夜躁狠狠躁2022| 久久精品欧美日韩精品| 亚洲国产精品成人久久蜜臀 | 少妇人妻综合久久中文字幕| 久久午夜羞羞影院免费观看| 国产成人精品综合久久久| 色婷婷久久综合中文久久蜜桃av| 丁香五月综合久久激情| 久久综合给合久久狠狠狠97色69| 国产高潮国产高潮久久久91| 色妞色综合久久夜夜| 国产成人综合久久精品红| 久久免费美女视频| 婷婷伊人久久大香线蕉AV| 中文字幕一区二区三区久久网站 | 欧美久久精品一级c片片| 亚洲人成精品久久久久| 久久精品一区二区影院| 国产精品欧美久久久久天天影视| 久久久噜噜噜久久熟女AA片| 人妻无码精品久久亚瑟影视| 日韩欧美亚洲国产精品字幕久久久| 久久精品国产亚洲麻豆| 久久精品水蜜桃av综合天堂| 久久天天躁夜夜躁狠狠躁2022| 合区精品久久久中文字幕一区| 国产成人综合久久精品尤物| 亚洲国产成人久久综合碰碰动漫3d | 久久香蕉综合色一综合色88| 久久久精品人妻一区二区三区蜜桃 | 国产成人无码精品久久久免费| 伊人色综合久久天天|