poj 1654 Area 多邊形面積

/*poj 1654 Area 多邊形面積題目意思很簡單,但是1000000的point開不了*/#include<stdio.h>#include<math.h>#include<string.h>const int N=1000000+10;const double eps=1e-8;struct point {double x,y;point(){}point(double a,double b):x(a),y(b){}};int

poj 2451 Uyuw’s Concert – 半平面交

/*poj 2451 Uyuw's Concert - 半平面交很裸的半平面交*/#include<stdio.h>#include<math.h>#include <algorithm>using namespace std;const double eps=1e-10;struct point{double x,y;point(){}point(double a,double b):x(a),y(b){}}jiao[20000+10];struct

hdu 4643 GSM 計算幾何 – 點線關係

/*hdu 4643 GSM 計算幾何 -

hdu 4255 A Famous Grid–類比–篩素數–bfs

#include<stdio.h>#include<string.h>#include<queue>using namespace std;int s,t;struct node{ int x,y;}shu[40001];node ss,tt;int suy[40001];int map[201][201];int fang[201];void inif()//計算平方數{ for(int i=1;i<=200;i++)

poj 3660 Cow Contest —-floyd 傳遞閉包

/*和poj1975(求其可能為中間那個不)有點像,此題也是先floyd,然後求比他小的和比他大的數量是否為n-1,是則他的位置可以確定保證(guaranteed)所給資料不衝突*/#include<stdio.h>#include<string.h>int g[101][101];//g[i][j]表示j比i若void floyd(int n){int i,j,k;for(k=1;k<=n;k++)for(i=1;i<=n;i++)for(j=1;j<

zoj1119–雙連通–尋找關節點—計運算元網數

/*通過這個過程,可以發現一條規律:當v是樹根,如果它有2個或者更多兒子,那麼它是一個關節點。當v不是樹根,若且唯若它有至少一個兒子w, 且從w出發,不能通過w的後代頂點組成的路徑和一條回退邊到底u 的任意一個祖先頂點,此時v 是一個關節點。 其道理很明顯,如果樹根包含多個兒子,那麼把根節點去掉,整棵樹自然被分成多個不相干的部分,圖也就斷開了。如果v是非根頂點,如果其子樹中的節點均沒有

POJ 3662 Telephone Lines 二分答案+djk

/*POJ 3662 Telephone Lines題意:從1到N修一條電纜,有p對電線杆之間是可以串連的,電信公司可以提供k條電纜,其他的由John提供,求john提供的電纜的最長的那根的長度(ret)這應該有很多方案,但是還有一個條件,求所有方案中ret最小的那個所以應該讓電信公司提供那k跟比較長的,剩下的那些有john提供,然後挑出最長的(長度L),也就是說只要是長度比L長的且在這條路上用到的電纜,那麼就應該由電信公司提供。現在假設john提供的最長的電纜的長度是L,從1到N找出一條路來,

hdu 1082 Matrix Chain Multiplication–運算式求值

/*簡單的運算式求解,計算過程是求兩個矩陣乘法運算過程中有多少次元乘法(兩個數字相乘),可能出現兩個矩陣無法相乘的情況輸出error*/#include<stdio.h>#include<string.h>struct node//矩陣資訊{char n;//矩陣的名稱int x,y,num;//矩陣的行數和列數以及得到這個矩陣前有多少次元乘法}p[30];char s[100];//儲存運算式int len;//運算式的長度int n;int findk(int i){

hdu 2544 最短路–Dijkstra

#include<stdio.h>#include<string.h>int map[110][110];int vis[110],dist[110];int xun(int n)//在剩餘的節點中尋找到1最近的{int xia=-1,i;for(i=1;i<=n;i++)if(vis[i]==0&&(xia==-1||dist[i]<dist[xia]))xia=i;return xia;}void dijkstra(int n){int

poj 1258 Agri-Net–Prim和Kruskal演算法

/*prim演算法*/#include<stdio.h>#include<string.h>int map[110][110],vis[110],dist[110];int n;void geng(int j)//更新剩餘節點到樹的最小距離{int max=999999999,i;for(i=1;i<=n;i++)if(vis[i]&&map[i][j]<max)max=map[i][j];dist[j]=max;}int

hdu 4251 The Famous ICPC Team Again–劃分樹

/*求區間中間值可以轉化為求kth值 所以用了劃分樹直接套用了上一篇的函數上篇有講解*/#include<iostream>#include<algorithm>using namespace std;const int N=100010;int srted[N];struct node{int num[N];int val[N];}t[40];int n,m;void build(int l,int r,int d)//建樹 此樹並非由節點構成

hdu 1690 Bus System–floyd

#include<stdio.h>__int64 map[110][110];__int64 station[110];#define Max 0x7fffffffffffff//設一最大值__int64 l1,l2,l3,l4,c1,c2,c3,c4,d;int n,m;__int64 deng(__int64 d)//計算費用{if(d==0)return 0;else if(d<=l1)return c1;else if(d<=l2)return

poj 3648 Wedding+2-sat+SCC+縮點+拓撲排序

/*2-sat問題,題意:有對情侶結婚,請來n-1對夫婦,算上他們自己共n對,編號為0~~n-1,他們自己編號為0所有人坐在桌子兩旁,新娘不想看到對面的人有夫妻關係或偷奸關係,若有解,輸出一組解,無解輸出bad luck思路:1.根據偷奸關係建圖(1h和2h有偷奸關係,建邊1h->2w 2h->1w)2.求強連通分量3.判斷有無解(任一對夫婦不在同一強連通分量中,有解;否則無解)4.縮點建圖(建反向圖)5.拓撲排序6.由底向上求解(由於上面建的是反向圖,所以自頂(無入度)向下)

hdu 1173 採礦

#include<stdio.h>#include<stdlib.h>double x[1000000],y[1000000];int cmp(const void *a,const void *b){return *(double *)a>*(double *)b?1:-1;}int main(){int

poj 3335 Rotating Scoreboard – 半平面交

/*poj 3335 Rotating Scoreboard - 半平面交點是順時針給出的*/#include <stdio.h>#include<math.h>const double eps=1e-8;const int N=103;struct point{ double x,y;}dian[N];inline bool mo_ee(double x,double y){double ret=x-y;if(ret<0)

hdu 4635 Strongly connected 強連通

/*hdu 4635 Strongly connected

poj 3130 How I Mathematician Wonder What You Are! – 求多邊形有沒有核 – 模版

/*poj 3130 How I Mathematician Wonder What You Are! - 求多邊形有沒有核*/#include <stdio.h>#include<math.h>const double eps=1e-8;const int N=103;struct point{ double x,y;}dian[N];inline bool mo_ee(double x,double y){double ret=x-y;if(ret<0)

poj 1474 Video Surveillance – 求多邊形有沒有核

/*poj 1474 Video Surveillance - 求多邊形有沒有核*/#include <stdio.h>#include<math.h>const double eps=1e-8;const int N=103;struct point{ double x,y;}dian[N];inline bool mo_ee(double x,double y){double ret=x-y;if(ret<0)

poj 1511 Invitation Cards–SPFA

/*SPFA*/#include<stdio.h>#include<queue>using namespace std;#define nMax 1000050#define eMax 10000050#define inf 1000000050__int64 sum,dist[nMax];int vis[nMax],p,q,tou[nMax],re_tou[nMax];struct node{int v,w,next;}e[nMax],re_e[nMax];void

總頁數: 61357 1 .... 21003 21004 21005 21006 21007 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.