国产午夜精品久久久久九九,天天影视色香欲综合久久,亚洲国产精品久久66http://www.shnenglu.com/logics-space/category/9532.htmlmath & geometryzh-cnSat, 19 Sep 2009 04:13:13 GMTSat, 19 Sep 2009 04:13:13 GMT602187 Beauty Contesthttp://www.shnenglu.com/logics-space/articles/94940.htmllogics_spacelogics_spaceTue, 01 Sep 2009 00:48:00 GMThttp://www.shnenglu.com/logics-space/articles/94940.htmlhttp://www.shnenglu.com/logics-space/comments/94940.htmlhttp://www.shnenglu.com/logics-space/articles/94940.html#Feedback0http://www.shnenglu.com/logics-space/comments/commentRss/94940.htmlhttp://www.shnenglu.com/logics-space/services/trackbacks/94940.html 1 #include<iostream>
 2 #include<cmath>
 3 #include<vector>
 4 #include<algorithm>
 5 #include<cstdio>
 6 using namespace std;
 7 const int maxn  = 60000;
 8 
 9 struct Point {              // 二維點或矢量
10     int x, y;
11     Point() {}
12     Point(int x0, int y0): x(x0), y(y0) {}
13 };
14 
15 
16 struct Polygon{
17     Point p[maxn];
18     int n;
19 };
20 
21 //二維矢量運算
22 bool operator==(Point p1, Point p2)
23 {
24     return ( p1.x - p2.x==0 &&  p1.y - p2.y==0);
25 }
26 bool operator!=(Point p1, Point p2)
27 {
28     return ( p1.x - p2.x != 0 ||  p1.y - p2.y != 0);
29 }
30 bool operator<(Point p1, Point p2)
31 {
32     return p1.x < p2.x || p1.x - p2.x==0 &&  p1.y < p2.y;
33 }
34 Point operator+(Point p1, Point p2)
35 {
36     return Point(p1.x + p2.x, p1.y + p2.y);
37 }
38 Point operator-(Point p1, Point p2)
39 {
40     return Point(p1.x - p2.x, p1.y - p2.y);
41 }
42 int operator*(Point p1, Point p2) // 計算叉乘 p1 × p2
43 {
44     return (p1.x * p2.y - p2.x * p1.y);
45 }
46 int operator&(Point p1, Point p2) { // 計算點積 p1·p2
47     return (p1.x * p2.x + p1.y * p2.y);
48 }
49 
50 
51 //Graham 凸包
52 
53 Polygon Convex_Hull( Point FP[], int fn)
54 {
55     int i, k;
56     Polygon res;
57     sort(FP, FP+fn );
58     res.n = 0;
59     for(i = 0; i < fn; ++i )
60     {
61         while(res.n>=2 &&  ( res.p[res.n-1- res.p[res.n-2] ) *( FP[i] - res.p[res.n-2] ) <= 0) res.n--;
62         res.p[res.n++= FP[i];
63     }
64     k = res.n;
65     for(i = fn-2; i>=0; i--)
66     {
67         while(res.n > k && ( res.p[res.n-1- res.p[res.n-2]) * ( FP[i] - res.p[res.n-2] ) <= 0 ) res.n--;
68         res.p[res.n++= FP[i];
69     }
70     res.n--;
71     return res;
72 }
73 
74 Polygon ans;
75 Point FP[maxn];
76 int FN;
77 
78 int main(){
79     int i, j;
80     int dis, best = -1;
81     scanf("%d",&FN);
82     for(i = 0; i < FN; i++)
83         scanf("%d%d",&FP[i].x , &FP[i].y);
84     ans = Convex_Hull( FP, FN);
85     for(i = 0; i < ans.n; i++)
86         for(j = 0; j < ans.n; j++)
87         {
88             dis = (ans.p[i].x - ans.p[j].x)*(ans.p[i].x - ans.p[j].x)+(ans.p[i].y - ans.p[j].y)*(ans.p[i].y - ans.p[j].y);
89             if(dis > best)best = dis;
90         }
91     printf("%d\n",best);
92 }

能使用整點函數(shù)的盡量使用整點函數(shù),避免精度問題



logics_space 2009-09-01 08:48 發(fā)表評論
]]>
pku 題目大意http://www.shnenglu.com/logics-space/articles/91160.htmllogics_spacelogics_spaceSat, 25 Jul 2009 12:10:00 GMThttp://www.shnenglu.com/logics-space/articles/91160.htmlhttp://www.shnenglu.com/logics-space/comments/91160.htmlhttp://www.shnenglu.com/logics-space/articles/91160.html#Feedback0http://www.shnenglu.com/logics-space/comments/commentRss/91160.htmlhttp://www.shnenglu.com/logics-space/services/trackbacks/91160.html

1031 fence

有一個封閉的籬笆(簡單多邊形),現(xiàn)有一光源(0,0),問他能照亮多少角度的籬笆?

1039  Pipe

有一根管道(折線型),管道不反光,現(xiàn)在管道的一端射入一束光,調(diào)整入射角度使得光射的最遠,求最遠距離。

1066 Treasure Hunt

有一個正方形區(qū)間被隔板隔成若干個小房間。房間的墻的中點是門?,F(xiàn)在有一個寶藏放在某個房間的某個位置,問人從區(qū)間外至少經(jīng)過幾道門能找到寶藏?

1106 Transmitters

有一個雷達的探測范圍是一個以雷達為圓心的半圓區(qū)間,目標散落在雷達的周圍。轉(zhuǎn)動雷達,使最多的目標在探測范圍內(nèi)。求最多目標數(shù)量?

1113 Wall

有一棟城堡(簡單多邊形)要建一個城墻圍住自己,要求

1城堡的每個點到城墻的距離至少為d

2城墻的長度必須最短

1118 Lining Up

平面上有一片點集(數(shù)量700),找一條直線使得它經(jīng)過的點最多。

1133   Stars

給你一個星空的描述(一系列點的坐標)。在給你幾個星系的描述。讓你在星空中找有沒有對應(yīng)的星系。給你的星系如果能按比例縮放,旋轉(zhuǎn)成星空的星系,則查找成功。

1151 Atlantis

給你幾個長方形(平行于x,y軸),求它們面積的交

1259 The Picnic

有一片點集,求一個最大空凸多邊形。

1265   Area

網(wǎng)格坐標系上有一個簡單多邊形,求它的面積,邊上有多少格點,內(nèi)部有多少格點。

1266  Cover an Arc.

有一段圓弧,已知圓弧的起點,終點和中間一點。找一塊最小的長方形(該長方形的邊平行x,y軸)覆蓋他。

1279   Art Gallery

有一個畫廊(簡單多邊形),只有一個看守,該看守必須要找一個點使得他能看到畫廊所有的墻。找出滿足條件的點所構(gòu)成的區(qū)域

1375 Intervals

二維平面里,天花板上有盞燈,半空中有很多圓,問在地上的影子的情況。

 

1379 Run Away

平面里有一點集,在平面中找一個最大空圓。



logics_space 2009-07-25 20:10 發(fā)表評論
]]>
pku 1066 Treasure Hunthttp://www.shnenglu.com/logics-space/articles/91048.htmllogics_spacelogics_spaceFri, 24 Jul 2009 08:20:00 GMThttp://www.shnenglu.com/logics-space/articles/91048.htmlhttp://www.shnenglu.com/logics-space/comments/91048.htmlhttp://www.shnenglu.com/logics-space/articles/91048.html#Feedback5http://www.shnenglu.com/logics-space/comments/commentRss/91048.htmlhttp://www.shnenglu.com/logics-space/services/trackbacks/91048.html閱讀全文

logics_space 2009-07-24 16:20 發(fā)表評論
]]>
EXOCENTER OF A TRIANGLE 證明http://www.shnenglu.com/logics-space/articles/89814.htmllogics_spacelogics_spaceSat, 11 Jul 2009 12:58:00 GMThttp://www.shnenglu.com/logics-space/articles/89814.htmlhttp://www.shnenglu.com/logics-space/comments/89814.htmlhttp://www.shnenglu.com/logics-space/articles/89814.html#Feedback0http://www.shnenglu.com/logics-space/comments/commentRss/89814.htmlhttp://www.shnenglu.com/logics-space/services/trackbacks/89814.html
已知ABDE, BCHJ 和 ACFG 是正方形,L, M, N 分別是中點,求證 o 是三角形ABC的垂心。





隊友lwc的證明就是證 三角形ABC 和 三角形BJQ 全等, 其中BM == MQ;


直接暴搞的代碼:
 1 #include<iostream>
 2 #include<cmath>
 3 #include<stdio.h>
 4 using namespace std;
 5 const double PI = 3.1415926535897932384626433832795;
 6 const double eps = 1e-8;
 7 int dcmp(double x){return x < -eps ? -1 : x > eps ;}
 8 
 9 double fix(double x){
10     if(dcmp(x)==0)return 0;
11     return x;
12 }
13 
14 struct Point {
15     double x, y;
16     Point() {}
17     Point(double x0, double y0): x(x0), y(y0) {}
18 };
19 
20 double operator*(Point p1, Point p2) // 計算叉乘 p1 × p2
21 {
22     return (p1.x * p2.y - p2.x * p1.y);
23 }
24 Point operator-(Point p1, Point p2)
25 {
26     return Point(p1.x - p2.x, p1.y - p2.y);
27 }
28 Point operator+(Point p1, Point p2)
29 {
30     return Point(p1.x + p2.x, p1.y + p2.y);
31 }
32 Point Rotate(Point p, double angle)
33 {
34     Point result;
35     result.x = p.x * cos(angle) - p.y * sin(angle);
36     result.y = p.x * sin(angle) + p.y * cos(angle);
37     return result;
38 }
39 double Area(Point A, Point B, Point C) //三角形面積
40 {
41     return ((B-A)*(C-A) / 2.0);
42 }
43 
44 Point intersection(Point u1,Point u2,Point v1,Point v2){
45     Point ret=u1;
46     double t=((u1.x-v1.x)*(v1.y-v2.y)-(u1.y-v1.y)*(v1.x-v2.x))
47             /((u1.x-u2.x)*(v1.y-v2.y)-(u1.y-u2.y)*(v1.x-v2.x));
48     ret.x+=(u2.x-u1.x)*t;
49     ret.y+=(u2.y-u1.y)*t;
50     return ret;
51 }
52 
53 int main()
54 {
55     int T, cas;
56     Point a, b, c;
57     scanf("%d",&T);
58     for(cas = 0; cas < T; cas++)
59     {
60         scanf("%lf%lf",&a.x, &a.y);
61         scanf("%lf%lf",&b.x, &b.y);
62         scanf("%lf%lf",&c.x, &c.y);
63         if(Area(a,b,c) < 0)swap(b,c);
64         Point p, q, r, s, ans;
65         p = Rotate(b - a,-PI/2+ a;
66         q = Rotate(c - a, PI/2+ a;
67         r = (p + q);
68         r.x/=2; r.y/=2;
69 
70         p = Rotate(c - b,-PI/2+ b;
71         q = Rotate(a - b, PI/2+ b;
72         s = (p + q);
73         s.x/=2; s.y/=2;
74         ans = intersection(a, r, b, s);
75                 printf("%.4lf %.4lf\n",fix(ans.x), fix(ans.y));
76     }
77 }





logics_space 2009-07-11 20:58 發(fā)表評論
]]>
geometry 目錄http://www.shnenglu.com/logics-space/articles/75347.htmllogics_spacelogics_spaceMon, 02 Mar 2009 12:19:00 GMThttp://www.shnenglu.com/logics-space/articles/75347.htmlhttp://www.shnenglu.com/logics-space/comments/75347.htmlhttp://www.shnenglu.com/logics-space/articles/75347.html#Feedback0http://www.shnenglu.com/logics-space/comments/commentRss/75347.htmlhttp://www.shnenglu.com/logics-space/services/trackbacks/75347.html

題號

題目名稱

  知識點

1031

Fence

區(qū)間合并

1039

Pipe

線段相交,枚舉

1066

Treasure Hunt

同異側(cè)位置,枚舉

1106

Transmitters

枚舉

1113

Wall

凸包

1118

Lining Up

枚舉 ,旋轉(zhuǎn),縮放

1133

Stars

枚舉

1151

Atlantis

離散化

1259

The Picnic

動態(tài)規(guī)劃,棧

1265

Area   

pick公式 ?

1266

Cover an Arc.

求圓心,基礎(chǔ)

1269

Intersecting Lines

線段相交

1279

Art Gallery

半平面交

1319

Pipe Fitters

枚舉,數(shù)學(xué)

1375

Intervals

直線與圓的切線

1379

Run Away

逼近 或 三角剖分

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 



logics_space 2009-03-02 20:19 發(fā)表評論
]]>
久久精品人人做人人爽电影| 久久久久久久综合日本| 久久午夜福利无码1000合集| 精品伊人久久大线蕉色首页| 久久国产精品99精品国产| 日本免费一区二区久久人人澡| 99久久综合国产精品二区| 一本综合久久国产二区| 婷婷久久久亚洲欧洲日产国码AV| 青青草原综合久久大伊人精品| 亚洲人成无码www久久久| 欧美一区二区三区久久综| 国产成人无码精品久久久久免费| 中文字幕日本人妻久久久免费 | 国产精品激情综合久久| 久久夜色精品国产噜噜亚洲a| 精品国产91久久久久久久| 久久一区二区三区免费| 国产精品久久精品| 亚洲午夜精品久久久久久app| 久久99国产精品二区不卡| 久久人做人爽一区二区三区 | 久久综合亚洲色HEZYO社区| 久久青草国产手机看片福利盒子| 久久综合亚洲色HEZYO社区| 狠狠久久综合| 亚洲精品高清久久| 精品国产VA久久久久久久冰 | 久久无码国产专区精品| 久久综合狠狠综合久久97色| 久久久精品一区二区三区| 久久精品国产亚洲av麻豆色欲| 18岁日韩内射颜射午夜久久成人| 婷婷久久五月天| 综合久久给合久久狠狠狠97色| 看全色黄大色大片免费久久久| 国产毛片久久久久久国产毛片 | 免费精品久久久久久中文字幕| 久久久精品日本一区二区三区 | 亚洲国产精品无码久久一线| 久久伊人五月丁香狠狠色|