自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(60)
  • 资源 (1)
  • 收藏
  • 关注

原创 学习rfc 7432 多归场景

8. Multihoming FunctionsThis section discusses the functions, procedures, and associated BGProutes used to support multihoming in EVPN. This covers bothmultihomed device (MHD) and multihomed net...

2019-03-23 00:37:04 1403

原创 hdu4544湫湫系列故事——消灭兔子 priority queue

#include #include #include #include using namespace std;const int N=100009;struct node{ int d,p; friend bool operator <(const node &a,const node &b){ return a.p>b.p;//小顶堆 }}

2014-09-24 00:19:18 454

原创 hrbust1176小陈老师、雪人 map&&priority queue

//利用map的去重性存储,很好;再用优先队列排序#include #include #include #include #include using namespace std;const int N=100009;map m;struct node{ int r,n; friend bool operator 重载了也没用 return a.n

2014-09-23 00:28:15 772

原创 poj1017 packets

真是经典的数学思维,还有就是向上取整的

2014-09-19 00:34:50 364

原创 poj1230 Pass-Muraille (Greedy)

#include#include #include #include //和上一题蛮像的,要先排序再搞,还有就是删区间的时候找最能靠右的删using namespace std;const int N=110;struct node{ int x1,y1,x2,y2;}p[N];bool cmp(node a,node b){ return a.x1<b.x1;

2014-09-18 00:49:26 439

原创 POJ1328 radar installation (Greedy)

//主要是以岛为圆心画圆求区间,还有就是区间交并的问题#include #include #include #include #include using namespace std;int n,d,cas;struct node{ double x,y; double l,r;}p[1009];bool cmp(node a,node b){ //i

2014-09-17 00:54:18 356

原创 sgu114 Telecasting station 三分

//sb啦,忘记可以有多种答案#include #include #include #include using namespace std;const double eps=1e-6;const int N=15009;struct node{ double x,p;}p[N];int n;double mi=50000,mx;double cal(double

2014-09-16 22:21:32 366

原创 ural1753Bookshelf 三分

#include #include #include using namespace std;const double eps=1e-6;double h,H,L;double cal(double x){//已左底角为原点,向右为x轴,书的中心为书的H/2处 return H*x/(2*sqrt(x*x+h*h))-x;}int main(){ scanf("%l

2014-09-15 20:50:11 637

原创 hdu2438Turn the corner 三分

#include #include #include #include using namespace std;const double pi=acos(-1.0);double x,y,l,w,s;double cal(double k){//函数的求法是个问题,变量是角度 s=l*cos(k)+w*sin(k)-x; return s*tan(k)+w*cos(k

2014-09-12 23:50:36 405

原创 zoj 3203 Light Bulb 三分入门

#include #include #include using namespace std;const double eps=1e-6;double H,h,D;double len(double x){ return x+(x*H-D*h)/(x-D);}double tripartion(){ double low=0,high=D*h/H;//x可取的最小最

2014-09-10 20:12:38 468

转载 生物钟揭秘

原文:http://blog.csdn.net/xiexievv/article/details/6741125由于人体生物钟的变化,大脑皮层的不同区域的功能也在时时发生着变化,研究的结果表明: 上午8~11点,是组织、计划、写作和进行一些创造性思维活动的最佳时间。最好把一天中最艰巨的任务放在此时完成。同时,这段时间疼痛最不敏感,此时看牙医最合适。 上午11~12点,是开会的最佳时间,

2014-09-09 14:14:29 297

原创 hdu2176取(m堆)石子游戏 nim hdu1848Fibonacci again and again sg

1Bash Gamen%(m+1)!=0,先取者win2Wythoff Game(a,b)k=(b-a);if(a==(int)(k*(1+sqrt(5.0))/2)) 后取者win3Nimm Game(a,b,c,d...)if(a^b^c^d^..==0)后取者win

2014-09-05 00:49:13 438

原创 poj1288poj1228Grandpa's Estate poj1113Wall

poj1288#include #include #include #include using namespace std;const double eps=1e-10;const int N=1005;inline int dcmp(int x){ if(!x) return 0; return x>0?1:-1;}struct pt{ int x

2014-09-05 00:42:55 603

原创 poj2187Beauty Contest 凸包最大距离

#include #include #include #include #include using namespace std;const int N=60005;inline int dcmp(int x){ if(!x)return 0; return x>0?1:-1;}struct pt{ int x,y;}p[N],ans[N];int top,n;int

2014-09-05 00:41:19 408

原创 hdu3549Flow Problem poj1273Drainage Ditches poj3281Dining sgu185 Network flow

hdu3549Flow_Problem#include #include #include #include using namespace std;const int N = 5005;const int M = 30005;struct Enode{ int y, c, next;} e[M * 2];//struct Point//{// int son,c

2014-08-28 00:38:23 375

原创 poj1254Hansel and Grethel poj1269Intersecting_Lines

poj1254Hansel and Grethel#include #include #include using namespace std;const double eps=1e-10;const double pi=acos(-1.0);const int inf=1e8;inline int dcmp(double x){ if(x < eps) return 0

2014-08-28 00:34:46 344

原创 hdu4195Regular Convex Polygon poj2242The Circumference of the Circle

#include #include #include #include using namespace std;const double eps=1e-6;//这个错了可能waconst double pi=acos(-1.0);inline bool dcmp(double x){ if(x<eps)return 0; return x>0?1:-1;}stru

2014-08-28 00:32:59 451

原创 poj2446Chessboard 奇偶建图

/*因为要用1*2的纸片覆盖,那么两个值(i+j)必然一个奇数一个偶数,然后分别给图中的奇数偶数点依次从1开始标号,相邻的按其标号建图,匈牙利、、比较快速,正解!因为必然是一个奇数点对应一个相邻偶数点,那么只要求任意奇数或偶数的最大匹配就可以了。经典的建图方法。*/#include#include#includeusing namespace std;#define maxm 405

2014-08-24 01:04:51 494

原创 poj3692Kindergarten poj2584T-Shirt Gumbo多重匹配 拆点 poj3041Asteroids

/*1.独立集:任意两点都不相连的顶点的集合2.定理:最大独立集=顶点数-最大匹配边3.完全子图:任意两点都相连的顶点的集合(最大完全子图即最大团)4.定理:最大团=原图补图的最大独立集=顶点数-最大匹配数*/#include#include#includeusing namespace std;#define maxm 405int n,m,s;int map[maxm

2014-08-23 23:50:56 483

原创 uva10004 Bicoloring 二分图染色

#include #include #include using namespace std;const int N=500;const int M=40000;struct List{ int v; List *next;}pool[M],*c[N],*pp;int n,m;int col[N];bool flag;inline void add_edge

2014-08-23 23:46:10 365

原创 poj2186Popular Cows

#include #include #include #include #include #include #include #include #include #include #include using namespace std;typedef long long ll;const int MAXE = 22220, MAXV = 11110;struct Ar

2014-08-21 22:51:56 336

原创 poj3352Road Construction 边双连通+伪缩点

统计出树中度为1的节点的个数,即为叶节点的个数,记为leaf。则至少在树上添加(leaf+1)/2条边,就能使树达到边二连通,所以至少添加的边数就是(leaf+1)/2。

2014-08-21 22:48:54 881

原创 hdu2112HDU Today trie+map

trie#include #include #include #include #include #include #include #define MAXN 50010#define MAXM 50010using namespace std;int chd[MAXN][26];//存储节点编号int v[MAXN];//串尾节点标记//对于map为int v[][]

2014-08-20 23:26:14 398

原创 poj2513Colored Sticks trie+merge_set+Eular

#include #include #include using namespace std;const int N=250005*4;char s1[15],s2[15],cnt;int chd[N][26],v[N],ID[128],sz=1,du[N],fa[N],color=1;void init(){ sz=1; color=1; memset(v,

2014-08-20 23:21:17 424

原创 poj1258Agri Net Kruskal+prim

Kruskal#include #include #include #include using namespace std;#define N 100002struct node { int u, v, w; node() {} node(int _u, int _v, int _w):u(_u), v(_v), w(_w) {}};vector ed

2014-08-20 23:18:03 340

原创 hdu1874 Dijkstra(堆优化)+floyd

//#include #include #include #include #include #include #include #define MAXN 2510#define MAXM 6210using namespace std;int n,m,s,t;typedef pair PII;struct edge { int v, w; edge *next;

2014-08-19 22:50:25 408

原创 sgu183 Painting the balls_dp

#include #include #include //F[i, j] = c[j] + min {F[k, i]) ( j - M < k < i}using namespace std;const int N=105;const int inf=0x3fffffff;const int MAXN=10005;int n,m,c[MAXN],dp[N][N];//sgu限内存

2014-08-18 23:31:00 528 1

原创 HDU 3555Bomb数位dp

#include #include #include using namespace std;const int N=20;long long dp[N][3],a[N];int T;long long n;void init(){ dp[0][0]=1; for(int i=1;i<N;i++){ dp[i][0]=dp[i-1][0]*10-dp

2014-08-18 23:00:54 299

原创 HDU 2089不要62 数位dp

#include #include #include using namespace std;const int N=10;int dp[N][3],a[N];int l,r;void init(){ dp[0][0]=1; for(int i=1;i<N;i++){ dp[i][0]=dp[i-1][0]*9-dp[i-1][1];

2014-08-18 22:59:53 314

原创 poj2533Longest Ordered Subsequence LIS(优化)

#include #include #include using namespace std;const int N=1010;const int inf=0x3fffffff;int n,a[N],dp[N];int binary_search(int aim[],int d,int length){ int l=0,r=length,mid; while(l!=

2014-08-18 22:58:01 456

原创 UVA11762 Race to 1

#include #include #include using namespace std;const int N=1000005;int p[N],tmp[N],maxn;double dp[N];void prime(){ for(int i=2;i<N;i++) for(int j=i+i;j<N;j+=i) p[j]=1;

2014-08-16 23:05:07 377

原创 UVA11722Joining with Friend概率dp

#include #include #include using namespace std;double t1,t2,s1,s2,w;//取t为x轴,s为y轴double geta(int b){//y=x+b,-90<=b<=90,取与四线的交点进行比较 int y1=t1+b,y2=t2+b; if(y2<s1) return 0; if(y1<s1){

2014-08-16 23:02:51 578

原创 hdu4336Card Collector_概率dp

//hdu4336#include #include #include using namespace std;const int N=25;double dp[1<<20],p[N];//dp[s] = (1 - ∑( p[i] ))*dp[s]+ ∑( p[i]*dp[ s ^ (1<<i) ] ) +1;//dp[s]=(∑( p[i]*dp[ s ^ (1<<i) ]

2014-08-16 22:59:02 273

原创 hdu3853LOOPS概率dp

#include #include #include #include #include using namespace std;const int N=1005;const double eps=1e-9;int r,c;double p1[N][N],p2[N][N],p3[N][N],dp[N][N];int main(){ while(scanf("%d%d"

2014-08-16 22:57:48 349

原创 poj2828Buy Tickets segment_tree

//后面的点优先权高,思路详解http://www.cnblogs.com/CheeseZH/archive/2012/04/29/2476134.html#include #include #include #define lson l,m,rt<<1#define rson m+1,r,rt<<1|1using namespace std;const int N=200005;

2014-08-14 23:07:34 330

原创 2795Billboard segment_tree

#include #include #include #define lson l,m,rt<< 1#define rson m+1,r,rt <<1 | 1using namespace std;const int N=2200100;long long mx[N<<2];int h,w;//按序号来说,左边的小于右边的,而题中要求选尽量小的,左边优先权大于右边void pu

2014-08-14 23:06:06 356

原创 hdu1394Minimum Inversion Number_forces(segment_tree)

//线段树,后面有暴力解法/*首先要知道如何求一个序列的逆序数,比如2514 : 2之前没有数大于它,所以为0, 5之前也没有数大于它,所以为0, 1之前2,5都大于它,所以为2, 4之前只有5大于它,所以为1, 因此2514的逆序数为:0  + 0 + 2 + 1 = 3; 从前面的描述中,我们可以发现,只要依次累计前面有几个数大于当前数即可。于是我们可以用一个数组b[n](初始化为0)

2014-08-14 23:05:00 305

原创 hdu1698Just a Hook segment_tree

#include #include #include #define lson l,m,rt <<1#define rson m+1,r,rt << 1 |1using namespace std;const int N=100005;int sum[N << 2];int lazy[N<<2];void pushup(int rt){ sum[rt]=sum[rt<<1

2014-08-14 23:03:26 287

原创 poj3691DNA repair

#include #include #include #include using namespace std;const int N=1005;const int INF=0x3ffffff;int tot=0,dp[N][N];struct node{ int son[4],fail; bool dan;}trie[N];void init(){ f

2014-08-13 01:24:10 563

原创 hdu2222Keywords Search

#include #include #include #include using namespace std;const int N=1000000+5;struct node{ int son[26],fail,sum; bool vis;}trie[N];int tot,ans;void init(){ for(int j=0;j<=tot;j++

2014-08-13 01:23:25 306

splay 模板

splay经典代码,hdu1890,经典入门题,可作为模板

2014-09-05

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除