上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 59 下一页
摘要: //http://www.cnblogs.com/bo-tao/archive/2012/04/16/2452633.html#include#includeint main() { int a,b,c; while(scanf("%d%d",&a,&b)!=EOF) { if(a<b) {... 阅读全文
posted @ 2014-03-09 12:00 HYDhyd 阅读(92) 评论(0) 推荐(0) 编辑
摘要: #include//两组数据4 2 2 5 5 结果10 //6 2 5 2 5 5 2 结果12#include//求左右大于等于当前数的长度乘于这个数#define N 101000__int64 l[N],r[N],a[N];int main() { __int64 n,h... 阅读全文
posted @ 2014-03-09 11:26 HYDhyd 阅读(95) 评论(0) 推荐(0) 编辑
摘要: #include#include//此图为无向图#define N 1100int indegree[N];int pre[N];int map[N][N];int find(int x) {if(x!=pre[x]) pre[x]=find(pre[x]);return pre[x];}int... 阅读全文
posted @ 2014-03-08 17:30 HYDhyd 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 欧拉回路 通过图中每条边一次且仅一次,并且过每一顶点的回路。欧拉路径 通过图中每条边一次且仅一次,并且过每一顶点的通路。欧拉图 存在欧拉回路的图。半欧拉图 存在欧拉路径的图。无向图存在欧拉回路的充要条件: 连通且没有奇度顶点。无向图存在欧拉路径的充要条件: 连通且奇度顶点个数为2。有向图存... 阅读全文
posted @ 2014-03-08 17:14 HYDhyd 阅读(315) 评论(0) 推荐(0) 编辑
摘要: #include#include#define N 110000struct node { int father,count;}pre[N];int find(int x) {if(x==pre[x].father) {pre[x].count=0;return x;} int h=pre[... 阅读全文
posted @ 2014-03-08 17:01 HYDhyd 阅读(82) 评论(0) 推荐(0) 编辑
摘要: #include#define N 51000void getkmp(int next[],char s[]) { int j=0,k=-1; next[0]=-1; while(s[j]!=0) {if(k==-1||s[j]==s[k]) {j++;k++;if(s[j]!=s[k])next[... 阅读全文
posted @ 2014-03-08 14:03 HYDhyd 阅读(75) 评论(0) 推荐(0) 编辑
摘要: #include#include#define N 100100void getnext(int next[],char s[]) { int k=-1,j=0;next[0]=-1;while(s[j]!=0) {if(k==-1||s[j]==s[k]) {j++;k++;if(s[j]!=s... 阅读全文
posted @ 2014-03-07 21:35 HYDhyd 阅读(127) 评论(0) 推荐(0) 编辑
摘要: //http://www.cnblogs.com/devil-91/archive/2012/05/16/2502710.html#include#define N 110000#includeint dp[N];int main() {int n,m,i,j,a[N],b[N],k,h;while... 阅读全文
posted @ 2014-03-07 20:33 HYDhyd 阅读(87) 评论(0) 推荐(0) 编辑
摘要: #include#include#includeusing namespace std;struct node {int num;friend bool operatorb.num;}};int main() {int count,n,k,i;char s[3];while(scanf("%d%d"... 阅读全文
posted @ 2014-03-04 11:29 HYDhyd 阅读(90) 评论(0) 推荐(0) 编辑
摘要: #include#include#define N 2100struct node {int u,v,next;}bian[N*N];int min(int a,int b) {return a>b?b:a;}int yong,dfn[N],low[N],ans[N],stac[N],top,ind... 阅读全文
posted @ 2014-03-01 18:52 HYDhyd 阅读(148) 评论(0) 推荐(0) 编辑
上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 59 下一页