自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

禅境花园

http://www.xiang578.com

  • 博客(15)
  • 资源 (1)
  • 收藏
  • 关注

原创 hdu1542 Atlantis【矩形面积并+线段树】

#include<bits/stdc++.h> using namespace std; const int N=1024; int n; double has[4*N]; struct Tree { int cover; double len; }t[4*N+10];struct line { double a1,a2,b; int f; }li[N];int cm

2016-07-27 16:52:19 357

原创 hdu1527 取石子游戏 【威佐夫博弈】

/* *********************************************** Author :Maltub Email :xiang578@foxmail.com Blog :htttp://www.xiang578.com ************************************************ */#

2016-07-26 22:13:59 290

原创 poj1185炮兵阵地【状压DP】

#include<stdio.h> #include<string.h> #include<algorithm> using namespace std; int g[1024],num[1024],cnt,dp[105][70][70],p[105]; char s[105][15];void init(int m) { cnt=0; int up=1<<m,f,sum=0;

2016-07-24 15:20:46 561

原创 2016年团体程序设计天梯赛-决赛 L2-014. 列车调度 【导弹拦截系统-最长上升子序列nlogn求法】

导弹拦截问题中的本质是求一个序列的最长上升子序列,只有这样才会新开导弹组。也就是本问题中的铁轨。#include<bits/stdc++.h> #include<bits/stdc++.h> using namespace std; int n,a[100000+10],b[100000+10]; int cnt,t;int main() { int n,m,k; scanf("%d

2016-07-21 20:32:25 793

原创 hdu5724 Chess【博弈+sg函数】

/* *********************************************** Author :Maltub Email :xiang578@foxmail.com Blog :htttp://www.xiang578.com ************************************************ */#

2016-07-21 10:19:48 437

原创 POJ 3648 Wedding【2-sat O(n)】

#include<stdio.h> #include<string.h> #include<vector> #include<stack> #include<queue> #include<algorithm> using namespace std; const int N=2*(16000+5); const int B=2; const int W=1; stack<int>st; vecto

2016-07-15 10:52:57 277

原创 poj3683 Priest John's Busiest Day【2-sat n+m算法】

#include<stdio.h> #include<algorithm> #include<vector> #include<string.h> #include<math.h> using namespace std; const int N=1024; int mark[2*N],s[2*N],c,n,st[N][2],ed[N][2],t[N]; vector<int>g[2*N];int

2016-07-13 10:00:30 397

原创 Codeforces Round #361 (Div. 2)B. Mike and Shortcuts【BFS】

没有考虑到问题的本质,自己最初写的是最暴力的搜索,其实只是对左右两点和最短路上的点有关系。#include<bits/stdc++.h> using namespace std; const int N=200000+10; int n,a[N],use[N],ans[N]; vector<int>g[N]; int main() { while(~scanf("%d",&n)) {

2016-07-08 09:52:34 222

原创 hdu1732 Push Box【搜索】

#include<bits/stdc++.h> using namespace std; struct node { int t,x[3],y[3],px,py; } t,p; int n,m,px,py,g[10][10]; bool vis[8][8][8][8][8][8][8][8]; int dx[]= {0,0,1,-1}; int dy[]= {1,-1,0,0};char s

2016-07-07 16:32:19 341

原创 Codeforces Round #358D. Alyona and Strings【DP】

#include<bits/stdc++.h> using namespace std; char a[1024],b[1024]; int dp[1024][1024][20],ans[1024][1024][20];int main() { int n,m,p; scanf("%d%d%d",&n,&m,&p); scanf("%s",a+1); scanf("%

2016-07-06 13:56:22 268

原创 hdu1254 推箱子 【bfs+dfs】

#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #include <vector> #include <queue> #include <stack> #include <set> #include <map> #include <string> #include <cmath> #inclu

2016-07-04 09:48:50 560

原创 hdu2822 Dogs【优先队列】

#include<bits/stdc++.h> using namespace std; struct node { int x,y,t; friend bool operator <(node n1,node n2) { return n2.t<n1.t; } }tp,p; char g[1024][1024]; int n,m,a0,a1,b0,b

2016-07-03 10:35:44 263

原创 Codeforces Round #359 (Div. 2)D. Kay and Snowflake【树的重心】

求某个结点子树的重心 情况1:重链上的儿子结点i为根的树结点数小于父结点j为根的树节点数,j为重心 情况2:与1相反时,重心必在j到i为跟的树的重心的路径上 /* *********************************************** Author :Maltub Email :xiang578@foxmail.com Blog

2016-07-02 22:32:44 196

原创 Codeforces Round #359 (Div. 2)D. Kay and Snowflake【树的重心】

求某个结点子树的重心 情况1:重链上的儿子结点i为根的树结点数小于父结点j为根的树节点数,j为重心 情况2:与1相反时,重心必在j到i为跟的树的重心的路径上 /* *********************************************** Author :Maltub Email :xiang578@foxmail.com Blog

2016-07-02 22:27:50 263

原创 poj1655 Balancing Act【树的重心+树形dp】

#include<stdio.h> #include<algorithm> #include<vector> #include<string.h> using namespace std; vector<int>g[20000+10]; int son[20000+10],n,a,b,ans,mi;void dfs(int x,int fa) { int tmp=0; for(int

2016-07-01 16:21:02 286

图论算法理论、实现及应用--王桂平--PPT--源代码--例图

图论算法理论、实现及应用--王桂平配套使用

2015-07-20

空空如也

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

TA关注的人

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