久久亚洲精品中文字幕三区,久久久久亚洲精品日久生情,亚洲欧美日韩精品久久亚洲区http://m.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://m.shnenglu.com/logics-space/articles/94940.htmllogics_spacelogics_spaceTue, 01 Sep 2009 00:48:00 GMThttp://m.shnenglu.com/logics-space/articles/94940.htmlhttp://m.shnenglu.com/logics-space/comments/94940.htmlhttp://m.shnenglu.com/logics-space/articles/94940.html#Feedback0http://m.shnenglu.com/logics-space/comments/commentRss/94940.htmlhttp://m.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 }

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



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

1031 fence

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

1039  Pipe

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

1066 Treasure Hunt

有一個正方形區間被隔板隔成若干個小房間。房間的墻的中點是門。現在有一個寶藏放在某個房間的某個位置,問人從區間外至少經過幾道門能找到寶藏?

1106 Transmitters

有一個雷達的探測范圍是一個以雷達為圓心的半圓區間,目標散落在雷達的周圍。轉動雷達,使最多的目標在探測范圍內。求最多目標數量?

1113 Wall

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

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

2城墻的長度必須最短

1118 Lining Up

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

1133   Stars

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

1151 Atlantis

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

1259 The Picnic

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

1265   Area

網格坐標系上有一個簡單多邊形,求它的面積,邊上有多少格點,內部有多少格點。

1266  Cover an Arc.

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

1279   Art Gallery

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

1375 Intervals

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

 

1379 Run Away

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



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

logics_space 2009-07-24 16:20 發表評論
]]>
EXOCENTER OF A TRIANGLE 證明http://m.shnenglu.com/logics-space/articles/89814.htmllogics_spacelogics_spaceSat, 11 Jul 2009 12:58:00 GMThttp://m.shnenglu.com/logics-space/articles/89814.htmlhttp://m.shnenglu.com/logics-space/comments/89814.htmlhttp://m.shnenglu.com/logics-space/articles/89814.html#Feedback0http://m.shnenglu.com/logics-space/comments/commentRss/89814.htmlhttp://m.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 發表評論
]]>
geometry 目錄http://m.shnenglu.com/logics-space/articles/75347.htmllogics_spacelogics_spaceMon, 02 Mar 2009 12:19:00 GMThttp://m.shnenglu.com/logics-space/articles/75347.htmlhttp://m.shnenglu.com/logics-space/comments/75347.htmlhttp://m.shnenglu.com/logics-space/articles/75347.html#Feedback0http://m.shnenglu.com/logics-space/comments/commentRss/75347.htmlhttp://m.shnenglu.com/logics-space/services/trackbacks/75347.html

題號

題目名稱

  知識點

1031

Fence

區間合并

1039

Pipe

線段相交,枚舉

1066

Treasure Hunt

同異側位置,枚舉

1106

Transmitters

枚舉

1113

Wall

凸包

1118

Lining Up

枚舉 ,旋轉,縮放

1133

Stars

枚舉

1151

Atlantis

離散化

1259

The Picnic

動態規劃,棧

1265

Area   

pick公式 ?

1266

Cover an Arc.

求圓心,基礎

1269

Intersecting Lines

線段相交

1279

Art Gallery

半平面交

1319

Pipe Fitters

枚舉,數學

1375

Intervals

直線與圓的切線

1379

Run Away

逼近 或 三角剖分

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 



logics_space 2009-03-02 20:19 發表評論
]]>
亚洲综合久久综合激情久久| 久久中文字幕无码专区| 亚洲AV日韩AV天堂久久| 久久亚洲精品国产精品| 国产日韩久久久精品影院首页| 久久国产V一级毛多内射| 亚洲第一极品精品无码久久| 久久精品成人国产午夜| 久久婷婷人人澡人人爽人人爱| 97久久超碰国产精品2021| 色综合久久中文字幕综合网| 人人狠狠综合久久88成人| 精品水蜜桃久久久久久久| 人妻无码中文久久久久专区| 欧美午夜A∨大片久久| 久久国产精品77777| 色妞色综合久久夜夜| 国产福利电影一区二区三区久久久久成人精品综合 | 久久午夜无码鲁丝片午夜精品| 亚洲国产欧美国产综合久久 | 精品久久综合1区2区3区激情| 久久亚洲精品国产亚洲老地址| 国产精品久久久福利| 精品国产99久久久久久麻豆| 精品久久综合1区2区3区激情| 91精品国产高清久久久久久io | 亚洲欧美日韩中文久久 | 精品久久综合1区2区3区激情| 久久久无码精品亚洲日韩按摩 | 久久精品国产色蜜蜜麻豆| 久久精品aⅴ无码中文字字幕不卡| 久久嫩草影院免费看夜色| 久久www免费人成看国产片| a级成人毛片久久| 久久99国产精品久久99果冻传媒| 久久久无码人妻精品无码| 久久久精品国产sm调教网站| 麻豆成人久久精品二区三区免费| 国产偷久久久精品专区 | 99久久精品国产一区二区| 久久综合久久久|