• <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>

            Uriel's Corner

            Research Associate @ Harvard University / Research Interests: Computer Vision, Biomedical Image Analysis, Machine Learning
            posts - 0, comments - 50, trackbacks - 0, articles - 594

            POJ 1687 Buggy Sat---計算幾何

            Posted on 2010-08-28 23:22 Uriel 閱讀(324) 評論(0)  編輯 收藏 引用 所屬分類: POJ計算幾何
                    計算幾何大水題,題目求哪個多邊形是最外層的,只要算每個多邊形的面積,找出最大的一個就行,因為題目給的坐標標號已經是排過序的,所以求面積只要叉積即可~

            //Problem: 1687  User: Uriel 
            //Memory: 388K  Time: 0MS 
            //Language: G++  Result: Accepted 
            //Computational Geometry -> Cross Product
            //2010.08.29

            #include
            <math.h>
            #include
            <stdio.h>
            #include
            <stdlib.h>

            struct point{
                
            int x,y;
            }
            p[55];

            int cross_product(point a,point b)
            {
                
            return a.x*b.y-a.y*b.x;
            }


            int main(){
                
            int i,j,cse,n,x,y,tmp,id,pre,sum,maxs,ans;
                scanf(
            "%d",&cse);
                
            while(cse--){
                    scanf(
            "%d",&n);
                    
            for(i=0;i<n;i++){
                        scanf(
            "%d %d",&p[i].x,&p[i].y);
                    }

                    scanf(
            "%d",&x);
                    maxs
            =-1;ans=0;
                    
            for(i=0;i<x;i++){
                        scanf(
            "%d",&y);
                        sum
            =0;
                        
            for(j=0;j<y;j++){
                            scanf(
            "%d",&id);
                            id
            --;
                            
            if(j==0){
                                pre
            =id;
                                tmp
            =id;
                            }

                            
            else{
                                sum
            +=cross_product(p[pre],p[id]);
                                pre
            =id;
                            }

                        }

                        sum
            +=cross_product(p[id],p[tmp]);
                        
            if(sum>maxs){
                            maxs
            =sum;
                            ans
            =i+1;
                        }

                    }

                    printf(
            "%d\n",ans);
                }

                
            return 0;
            }
            亚洲综合日韩久久成人AV| 久久久久久久国产免费看| 久久久婷婷五月亚洲97号色 | 亚洲∧v久久久无码精品| 久久精品国产第一区二区三区| 国产激情久久久久影院老熟女免费| 久久天天婷婷五月俺也去| 久久精品国产亚洲AV香蕉| 久久本道综合久久伊人| 久久久婷婷五月亚洲97号色| 亚洲色欲久久久久综合网| 久久国产乱子精品免费女| 99蜜桃臀久久久欧美精品网站| 2020最新久久久视精品爱| 无码AV波多野结衣久久| 性做久久久久久免费观看| 亚洲午夜久久久精品影院| 久久精品中文无码资源站| 久久综合亚洲色HEZYO社区| 久久强奷乱码老熟女网站| 国产高潮国产高潮久久久91 | 性做久久久久久久久浪潮| 久久精品国产亚洲AV不卡| 日韩一区二区久久久久久| 97久久超碰国产精品2021| 日本强好片久久久久久AAA| 久久毛片一区二区| 色综合久久天天综线观看| 九九久久精品国产| 久久精品国产99久久香蕉| 99久久国产亚洲高清观看2024 | 韩国三级中文字幕hd久久精品| 久久91综合国产91久久精品| 国产精品福利一区二区久久| 久久精品国产91久久麻豆自制| 国产精品福利一区二区久久| 久久久久久综合一区中文字幕| 99久久婷婷国产一区二区| 色综合久久中文字幕综合网| 久久人人爽人人人人爽AV| 蜜臀久久99精品久久久久久小说|