自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(32)
  • 收藏
  • 关注

原创 最大公约数gcd.cpp

最大公约数gcd.cpp

2016-10-17 20:18:42 1195

原创 poj 3612 Telephone Wire

poj 3612 Telephone Wire

2016-09-16 15:29:30 466

原创 openjudge 海贼王之伟大航路(luoge.cpp/1000ms/128M)

描述 “我是要成为海贼王的男人!”,路飞一边喊着这样的口号,一边和他的伙伴们一起踏上了伟大航路的艰险历程。路飞他们伟大航路行程的起点是罗格镇,终点是拉夫德鲁(那里藏匿着“唯一的大秘宝”——ONE PIECE)。而航程中间,则是各式各样的岛屿。 因为伟大航路上的气候十分异常,所以来往任意两个岛屿之间的时间差别很大,从A岛到B岛可能需要1天,而从B岛到A岛则可能需要1年。当然,任意两个岛之间的航行时

2016-09-15 16:04:35 492

原创 openjudge 旅行(travel.cpp/1000ms/128M)

描述 转眼毕业了,曾经朝夕相处的同学们不得不都各奔东西,大家都去了 不同的城市开始新的生活。在各自城市居住了一段时间后,他们都感到了一些厌倦,想去看看其他人的生活究竟如何,于是他们都选择到另一个同学所在城市去旅 游,并且希望旅游的城市各不相同,他们想知道有多少种不同的方案,可是数量实在太多了,他们无法计算出来,你能帮助他们吗。 输入 一个正整数n(n<200),表示人数。 输出 一个数,表

2016-09-15 15:44:19 1102

原创 noip2015 day1 斗地主

noip2015 day1 斗地主

2016-08-31 19:58:42 394

原创 poj3126 Prime Path 简单BFS

poj3126 Prime Path 简单BFS

2016-08-24 13:39:10 288

原创 poj1945 Power Hungry Cows BFS

poj1945 Power Hungry Cows BFS

2016-08-24 11:50:28 504

原创 poj2331 Water pipe IDA*

poj2331 Water pipe IDA*

2016-08-24 09:38:18 257

原创 poj3170 Knights of Ni BFS

poj3170 Knights of Ni BFS

2016-08-23 16:52:52 307

原创 poj1915Knight Moves BFS

poj1915Knight Moves BFS

2016-08-23 14:29:34 279

原创 poj3249Test for Job记忆化搜索

poj3249Test for Job记忆化搜索

2016-08-23 12:47:10 265

原创 manacher算法

manacher是一种O(n)寻找回文串的算法;

2016-08-12 14:04:44 208

原创 poj2400===km

#include#include#include#includeconst int maxn=21,inf=10000010;int n,lx[maxn],ly[maxn],w[maxn][maxn],d[maxn],t,ans,num,h[maxn];bool px[maxn],py[maxn];bool dfs1(int x){ int i; px[x]=true; for

2016-02-16 14:01:38 7061

原创 km算法------poj3686

此题为一个建模很好的题,有点坑~~~~~~注:1.不加return 0;会超时2.输出一定要%.6f\n#include#include#include#includeconst int maxn=2501,maxm=51,inf=-10000010;int w[maxm][maxn],lx[maxm],ly[maxn],d[maxn],slack[maxn];in

2016-02-15 19:03:27 7634

原创 usaco Your Ride Is Here

#include#includechar a[10],b[10];int main(){ int i,j,k,n=1,m=1,l1,l2; freopen("ride.in","r",stdin); freopen("ride.out","w",stdout); scanf("%s%*c%s",&a,&b); l1=strlen(a); l2=strlen(b); for(i=

2016-02-13 19:39:57 7646

原创 usaco transform

#include#includechar c[10][10],d[10][10],a[10][10],b[10][10];int n;bool pd(){ int i,j; bool b=true; for(i=0;i<n;i++) for(j=0;j<n;j++) if(a[i][j]!=d[i][j]) b=false; return b;

2016-02-13 19:38:34 7346

原创 usaco sprime

#include#include#include#includeint i,j,k,n,m;int prime[10010],p[10010],num,d[10010];bool pd(int x){ m=d[(int)sqrt(x)]; for(j=1;j<=m;j++) if(x%prime[j]==0) return false; return true;

2016-02-13 19:37:25 7614

原创 usaco rect1

#include#include#include#include#includeusing namespace std;const int dmax=2001,maxn=10001;int a[1501][1501];int x[maxn],ux[maxn],y[maxn],uy[maxn];struct node{ int x,y,x1,y1; int color;};

2016-02-13 19:36:25 7935

原创 usaco pprime

#include#include#include#includeint prime1[110],prime2[1010],prime3[10010],p[10010],u,v,num1,num2,num3;bool pd1(int x){ for(u=1;u<=num1;u++) if(x%prime1[u]==0) return false; return tru

2016-02-13 19:35:22 7966

原创 usaco palsquare

#include#includeint c[30],b;bool pd(int n){ int i; for(i=1;i<=n;i++) if(c[i]!=c[n-i+1]) return false; return true;}void jz(int n){ int ch[30],i=1,j,m=n; while(m>0){ ch[i]=m%b;

2016-02-13 19:34:43 8096

原创 usaco numtri

#include#include#include#includeint a[1010][1010],n,d[1010][1010];int max(int x,int y){ if(x>y) return x; return y;}int main(){ int i,j,k,m; freopen("numtri.in","r",stdin); freopen("numtri

2016-02-13 19:33:44 9325

原创 usaco milk3

#include#include#include#includeint a,b,c,ans[500],n;short may[30][30][30];int find(int a1,int b1,int c1){ if(may[a1][b1][c1]) return 0; if(a1+b1+c1!= c) return 1; if(a1==0){ ans[++n] =

2016-02-13 19:32:28 9045

原创 usaco milk

#include#includeint p[5010],a[5010],sum=0;int main(){ int n,m; freopen("milk.in","r",stdin); freopen("milk.out","w",stdout); scanf("%d%d",&n,&m); int i,j,k; for(i=1;i<=m;i++) scanf("%d%d",

2016-02-13 19:31:42 9830

原创 usaco Friday the Thirteenth

#include#includeint m[12]={31,28,31,30,31,30,31,31,30,31,30,31};int d[7];main(){ freopen("friday.in","r",stdin); freopen("friday.out","w",stdout); int i,j,l=6,n; scanf("%d",&n); n+=1900; for

2016-02-13 19:30:24 9724

原创 usaco calfflac

#include#includechar a[20010],b[20010];int n=0,c[20010],m=0,num1,num2,max=0;bool hw(int x,int y){ int i,j; for(i=x;i<=y;i++) if(b[i]!=b[y-i+x]) return false; return true;}int main(){

2016-02-13 19:26:05 7360

原创 usaco ariprog

#include#include#include#includebool p[125000+10],flag;int n,max,i1;bool pd(int x,int y){ for(i1=0;i1<n;i1++) if(!p[x+i1*y] || x+i1*y>max) return false; return true;}int main(){ int i,j,

2016-02-13 19:24:50 6374

转载 vim精通

转自:http://blog.csdn.net/niushuai666/article/details/7275406#vim的学习曲线相当的大(参看各种文本编辑器的学习曲线),所以,如果你一开始看到的是一大堆VIM的命令分类,你一定会对这个编辑器失去兴趣的。下面的文章翻译自《Learn Vim Progressively》,我觉得这是给新手最好的VIM的升级教程了,没有列举所有的命令

2016-02-13 17:32:11 6597

原创 石子合并

#include #include int n,f[101][101],sum[101][101],a[101];int main(){ int i,j,k,t; scanf("%d",&n); for(i=1;i<=n;i++) scanf("%d",&a[i]); for(i=1;i<=n;i++){ f[i][i]=0; sum[i][i]=a[i];

2016-02-13 17:31:08 6330

原创 匈牙利算法

#include#includeint a[101][101],d[101],m,n,p[101];int dfs(int x){ int i,j,k; for(i=1;i<=n;i++) if(a[x][i] && !p[i]){ p[i]=1; if(!d[i] || dfs(d[i])){

2016-02-13 17:23:49 6457

原创 km入门-----hdu2255

奔小康赚大钱问题描述传说在遥远的地方有一个非常富裕的村落,有一天,村长决定进行制度改革:重新分配房子。这可是一件大事,关系到人民的住房问题啊。村里共有n间房间,刚好有n家老百姓,考虑到每家都要有房住(如果有老百姓没房子住的话,容易引起不安定因素),每家必须分配到一间房子且只能得到一间房子。另一方面,村长和另外的村领导希望得到最大的效益,这样村里的机构才会有钱.由于老百姓

2016-02-13 17:08:24 7400

原创 维护图的联通性

4    维护图的连通性       Source file:        graph.cpp/pas       Input file:         graph.in       Output file:        graph.out       Time limit:        1s 4.1    Description      给定一个无向图,写一个程序处理

2014-09-21 11:32:30 7932

原创 关于01背包的问题

01背包是在M件物品取出若干件放在空间为W的背包里,每件物品的体积为W1,W2……Wn,与之相对应的价值为P1,P2……Pn。

2014-09-20 20:29:40 5359

空空如也

空空如也

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

TA关注的人

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