摘要:
#include#include#include#include#include#include#includeusing namespace std;const int Max=1000;int Top=1,Mtop=0,add[Max];int High(int a){ add[1]+=a... 阅读全文
posted @ 2014-11-06 20:44
endl
阅读(394)
评论(0)
推荐(0)
摘要:
//差分思想 #include#include#include#include#include#include#includeusing namespace std;const int MAX=100010;int a[MAX],t[MAX];void change(int x,int y,int ... 阅读全文
posted @ 2014-11-06 16:36
endl
阅读(122)
评论(0)
推荐(0)
摘要:
树状数组#include#include#include#include#include#include#includeusing namespace std;const int MAX=100000+10;int N,X;int c[MAX];void add(int x,int v){ w... 阅读全文
posted @ 2014-11-06 16:01
endl
阅读(115)
评论(0)
推荐(0)
摘要:
Dp 适合点少的稠密图。//蒟蒻 最短路 #include#include#include#include#include#include#includeusing namespace std;int main(){ int n,m,edge[110][110]; scanf("%d%d... 阅读全文
posted @ 2014-11-06 15:48
endl
阅读(109)
评论(0)
推荐(0)
摘要:
//最小生成树 用了贪心的思想每次选符合条件的最短边直到边取完 或 所有点之间已可互达。#include#include#include#include#include#include#includeusing namespace std;const int MAXN = 1000;struct e... 阅读全文
posted @ 2014-11-06 15:30
endl
阅读(106)
评论(0)
推荐(0)
摘要:
// find 并查集 #include#include#include#include#include#include#includeusing namespace std;const int MAXN = 10000+10;int f[MAXN]; int find(int x){ if... 阅读全文
posted @ 2014-11-06 11:14
endl
阅读(174)
评论(0)
推荐(0)
摘要:
//gcd 最大公约数#include#include#include#include#include#include#includeusing namespace std;int gcd (int a,int b){ if(b==0) return a; return gcd(b,a%... 阅读全文
posted @ 2014-11-06 10:19
endl
阅读(223)
评论(0)
推荐(0)