摘要: #include#includeint d[15],map[15][15],vis[15];int main(){ int i,j,k,f,n,m,u,v; while(~scanf("%d%d",&n,&m)) { memset(d,0,sizeof(d)); memset(map,0,sizeo... 阅读全文
posted @ 2014-06-15 20:04 人艰不拆_zmc 阅读(274) 评论(0) 推荐(0) 编辑
摘要: Flip Game 思想很不成熟, #include <stdio.h>#include <string.h>#include <stdlib.h>int map[4][4];int ans=100; int f(){ for(int i=0;i<4;i++) { for(int j=0;j<4;j 阅读全文
posted @ 2014-06-14 19:47 人艰不拆_zmc 阅读(253) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <stdio.h>#include <string.h>#include <stdlib.h>using namespace std;int n,m;int bin[50001];int findx(int x){ int r=x; while 阅读全文
posted @ 2014-06-13 16:25 人艰不拆_zmc 阅读(621) 评论(0) 推荐(0) 编辑
摘要: 比较抽象吧,看到题时一点思想也没有,参考了别人的代码才知道。。。渣渣 #include <iostream>#include <stdio.h>#include <string.h>#include <stdlib.h>using namespace std;int map[10][10];int 阅读全文
posted @ 2014-06-13 15:22 人艰不拆_zmc 阅读(173) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <string.h>int map[51][51][51];int v[51][51][51];int a,b,c,t11;struct node{ int x,y,z,ans;}q[200001];int jx[6]={0,0,0,0,-1,1 阅读全文
posted @ 2014-06-12 20:31 人艰不拆_zmc 阅读(209) 评论(0) 推荐(0) 编辑
摘要: dfs #include <stdio.h> #include <string.h> char Map[16][16]; int mv[16][16]; //mv[i][j] == 0 没有被访问 //mv[i][j] == 1 已经被访问 struct N { int x,y; } ; int j 阅读全文
posted @ 2014-06-12 19:30 人艰不拆_zmc 阅读(362) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3259 Description While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is ver 阅读全文
posted @ 2014-06-09 21:09 人艰不拆_zmc 阅读(334) 评论(0) 推荐(0) 编辑
摘要: BF是对边进行操作,DJ是对点进行操作。N个顶点的最短路是N-1条边,所以循环N-1次。 学的好吃力。。。自己好渣渣。。。不愧是渣渣二号,还是贴贴思想吧 1,.初始化:将除源点外的所有顶点的最短距离估计值 d[v] ←+∞, d[s] ←0; 2.迭代求解:反复对边集E中的每条边进行松弛操作,使得顶 阅读全文
posted @ 2014-06-09 14:45 人艰不拆_zmc 阅读(299) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1611 Description Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a g 阅读全文
posted @ 2014-06-08 21:00 人艰不拆_zmc 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 被坑了3个小时,本来以为算法错了,谁知道,竟然是素数筛弄错了 !!! #include <iostream>#include <stdio.h>#include <string.h>#include <stdlib.h>#include <math.h>using namespace std;int 阅读全文
posted @ 2014-06-08 14:03 人艰不拆_zmc 阅读(231) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3278 Catch That Cow Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 47010 Accepted: 14766 Description Farmer John 阅读全文
posted @ 2014-06-08 10:40 人艰不拆_zmc 阅读(394) 评论(0) 推荐(0) 编辑
摘要: sort: 一、对int类型数组排序 int a[100]; int cmp ( int a , int b ) //不必强制转换 { return a < b;//升序排列。 } sort (a(数组名) , a+100(数组最后一个元素), cmp); 头文件 #include<algorith 阅读全文
posted @ 2014-04-20 19:52 人艰不拆_zmc 阅读(427) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <string.h>#include <stdlib.h>int n,m;typedef struct node{ int date; struct node *next;}node; int main(){ int i,sum=0,count= 阅读全文
posted @ 2014-04-17 20:32 人艰不拆_zmc 阅读(144) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <string.h>int map[200][200],v[200],dis[200];int n,s,t;#define N 100001void DJ(){ int i,j,k,min; memset(v,0,sizeof(v)); mems 阅读全文
posted @ 2014-04-17 20:01 人艰不拆_zmc 阅读(166) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>void qsort(int a[],int l,int r){ int x=a[l]; int i=l; int j=r; if(l>=r) return ; while(i<j) { while(i<j&&a[j]>=x) j--; if(i<j) { a[i 阅读全文
posted @ 2014-04-15 21:26 人艰不拆_zmc 阅读(157) 评论(0) 推荐(0) 编辑