青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

Pick-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.

/***********************************
暴力就行,從第一個開始判斷
如果兩條線段相交就把前面一條篩選掉
判斷線段相交直接貼的吉大模板。。。
**********************************
*/

#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會超時。。。
                }

            }

        }

        
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;
}

posted on 2010-10-03 16:21 Vontroy 閱讀(652) 評論(0)  編輯 收藏 引用 所屬分類: 計算幾何POJ
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            欧美一级专区免费大片| 宅男在线国产精品| 免费在线成人| 日韩一区二区精品在线观看| 99人久久精品视频最新地址| 午夜在线一区二区| 欧美激情视频在线播放| 欧美视频福利| 亚洲高清视频中文字幕| 亚洲欧美激情视频| 欧美激情一区二区三区蜜桃视频| 亚洲网站在线播放| 另类天堂av| 国产欧美精品一区二区三区介绍| 日韩视频在线一区二区| 狼狼综合久久久久综合网| 亚洲无线视频| 国产亚洲综合精品| 午夜综合激情| 一区二区欧美国产| 欧美91福利在线观看| 国产视频在线一区二区 | 一本久道综合久久精品| 欧美三区免费完整视频在线观看| 午夜精品av| 日韩午夜在线电影| 国产精品综合不卡av| 亚洲欧美日韩视频一区| 久久国产88| 国精品一区二区三区| 篠田优中文在线播放第一区| 久久综合久色欧美综合狠狠| 一本久久综合| 一个人看的www久久| 国语自产偷拍精品视频偷| 欧美在线一区二区三区| 亚洲欧美在线观看| 国产精品视频久久久| 午夜在线精品偷拍| 欧美激情亚洲自拍| 久久伊人精品天天| 久久久久成人精品免费播放动漫| 激情偷拍久久| 欧美大片专区| 免费在线观看日韩欧美| 久久精品三级| 久久蜜桃精品| 亚洲美女尤物影院| 一本色道久久综合亚洲91| 在线不卡免费欧美| 亚洲黄色在线观看| 亚洲日本欧美| 欧美天堂在线观看| 欧美激情在线狂野欧美精品| 国产日产高清欧美一区二区三区| 99精品免费| 亚洲最黄网站| 欧美日本在线看| 欧美影院成人| 欧美xxxx在线观看| 午夜国产不卡在线观看视频| 欧美理论在线播放| 最近看过的日韩成人| 亚洲人人精品| 亚洲欧美三级在线| 午夜激情综合网| 国产精品成人免费| 欧美黄色免费| 亚洲电影在线观看| 一区二区三区视频在线| 亚洲少妇自拍| 久久综合久久美利坚合众国| 美国十次了思思久久精品导航| 黄色亚洲网站| 久久婷婷综合激情| 亚洲第一精品在线| 国产香蕉久久精品综合网| 亚洲欧美日韩一区| 久久九九国产精品| 欧美日韩亚洲另类| 欧美高清在线一区| 亚洲精品永久免费| 欧美日韩亚洲天堂| 亚洲一二区在线| 久久er99精品| 在线精品视频一区二区三四| 麻豆精品在线观看| 久久综合电影一区| 91久久国产综合久久蜜月精品| 免费人成网站在线观看欧美高清| 亚洲欧洲一区| 欧美中文字幕视频| 亚洲国产精品热久久| 欧美精品一区二区三区蜜桃| 亚洲天堂免费在线观看视频| 性色av一区二区三区| 伊人色综合久久天天| 欧美—级a级欧美特级ar全黄| 制服丝袜亚洲播放| 久久男人资源视频| 国产一区二区精品久久99| 久久免费国产| 一区二区三区精品视频| 久久亚洲国产精品日日av夜夜| 亚洲人成7777| 国产精自产拍久久久久久| 免费久久99精品国产| 亚洲午夜未删减在线观看| 欧美黄色小视频| 欧美一区二区三区免费观看| 亚洲精品免费网站| 欧美精品xxxxbbbb| 欧美亚洲综合网| 99国产精品一区| 牛牛影视久久网| 亚洲国产精品福利| 国产精品美女久久久免费| 亚洲天堂成人在线观看| 嫩草国产精品入口| 午夜久久久久久久久久一区二区| 亚洲国产精品一区二区尤物区 | 亚洲综合大片69999| 午夜久久99| 亚洲精品资源美女情侣酒店| 好看的av在线不卡观看| 欧美日韩国产系列| 亚洲午夜成aⅴ人片| 亚洲高清中文字幕| 美女主播视频一区| 欧美在线在线| 性欧美xxxx视频在线观看| 亚洲视频axxx| 日韩小视频在线观看| 亚洲国产精品精华液网站| 国产一区二区三区成人欧美日韩在线观看 | 这里是久久伊人| 国产精品亚洲аv天堂网 | 亚洲欧美国产一区二区三区| 99国产精品久久久久老师| 欧美激情一区三区| 欧美岛国在线观看| 欧美14一18处毛片| 久热精品在线视频| 另类综合日韩欧美亚洲| 久久久噜噜噜久久中文字幕色伊伊| 亚洲欧美日韩天堂一区二区| 一区二区精品在线观看| 一本色道久久综合一区| 一区二区三区色| 亚洲特级片在线| 午夜精品一区二区三区四区| 亚洲欧美综合国产精品一区| 亚洲欧美日韩精品一区二区| 亚洲综合精品自拍| 亚洲激情国产精品| 国产欧美日韩不卡免费| 国产亚洲精品bv在线观看| 国产视频一区在线观看一区免费 | 欧美精品黄色| 欧美日韩精品欧美日韩精品 | 欧美中文在线字幕| 亚洲精品欧美精品| 久久综合伊人77777尤物| 久久综合久久88| 欧美激情一区二区三区| 日韩视频精品| 亚洲一区二区视频在线| 亚洲美女中文字幕| 国产精品99久久久久久久久| 亚洲欧美另类久久久精品2019| 欧美在线一级va免费观看| 老司机免费视频一区二区三区| 欧美国产日韩二区| 久久久精品2019中文字幕神马| 亚洲一区二区三区色| 久久精精品视频| 欧美aaa级| 国产毛片精品国产一区二区三区| 尤妮丝一区二区裸体视频| 99精品热视频| 久久精品亚洲热| 亚洲日本在线观看| 欧美亚洲综合久久| 欧美日韩国产999| 国内精品久久久久久久97牛牛| 亚洲精品一区二区三区四区高清| 亚洲在线视频一区| 欧美激情精品久久久久久久变态| 亚洲精品视频在线播放| 欧美怡红院视频| 欧美视频在线播放| 在线观看日韩av先锋影音电影院| 一区二区三区日韩欧美| 麻豆成人精品| 亚洲免费视频在线观看| 欧美激情二区三区| 今天的高清视频免费播放成人| 亚洲一区二区三区精品在线| 午夜精品在线视频| 亚洲精品一区二区在线|