上一页 1 ··· 43 44 45 46 47 48 49 50 51 ··· 59 下一页
摘要: #include#include#define N 200100struct node {int x,count;}pre[N];int find(int n) {if(n!=pre[n].x) {int h=pre[n].x;pre[n].x=find(pre[n].x);pre[n].count... 阅读全文
posted @ 2013-12-01 18:12 HYDhyd 阅读(95) 评论(0) 推荐(0) 编辑
摘要: http://blog.sina.com.cn/s/blog_803d08c00100y2yy.html#include#include#includeusing namespace std;const int N =10010;struct node {int count,x;}pre[N];in... 阅读全文
posted @ 2013-12-01 17:33 HYDhyd 阅读(136) 评论(0) 推荐(0) 编辑
摘要: #include//题没读懂,没做出来int main() { int n,k,l,r,s,s1,m,a,i;while(scanf("%d%d%d%d%d%d",&n,&k,&l,&r,&s,&s1)!=EOF) {m=s1/k;a=s1-m*k;if(a==0) {printf("%d",m)... 阅读全文
posted @ 2013-12-01 15:34 HYDhyd 阅读(114) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#define N 10010#define inf 999999999int pre[N];struct node {int x,deadline;}map[N];int cmp(const void *a,const void *b) {retur... 阅读全文
posted @ 2013-11-27 21:41 HYDhyd 阅读(93) 评论(0) 推荐(0) 编辑
摘要: //不容易啊,终于自己a了一道这种类型的题//#include#includeusing namespace std;const int N=30010;struct node {int front,last,count;}pre[N];int find(int x) {//指向队尾if(x!=pr... 阅读全文
posted @ 2013-11-27 19:16 HYDhyd 阅读(96) 评论(0) 推荐(0) 编辑
摘要: #include#includeusing namespace std;const int N=40010;int pre[N];//并查集int visit[N];//是否经过int ancestor[N];//祖先int dis[N];//储存距离int result[N];//储存结果stru... 阅读全文
posted @ 2013-11-26 22:58 HYDhyd 阅读(103) 评论(0) 推荐(0) 编辑
摘要: #include#includeusing namespace std;const int MAX=10001;int pre[MAX],visit[MAX],indegree[MAX];vectorqury[MAX],tree[MAX];int ancestor[MAX];void init(in... 阅读全文
posted @ 2013-11-26 20:56 HYDhyd 阅读(152) 评论(0) 推荐(0) 编辑
摘要: #include//典型题#include#define N 40010struct node {int x,y,z;}pre[N];struct fff{int a,b,dis;char s[2];}map[N];//储存int find(int x) {if(x!=pre[x].z) {int ... 阅读全文
posted @ 2013-11-25 16:09 HYDhyd 阅读(181) 评论(0) 推荐(0) 编辑
摘要: #include#include#define N 100010int father[N],link[N];int find(int x) {if(x!=father[x]) {int h=father[x];father[x]=find(father[x]);link[x]=(link[x]+li... 阅读全文
posted @ 2013-11-24 22:27 HYDhyd 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 不会写果断看答案http://cavenkaka.iteye.com/blog/1489588#include#include#define N 50010int father[N],link[N];int find(int x) {if(x!=father[x]) {int h=father[x]... 阅读全文
posted @ 2013-11-24 18:20 HYDhyd 阅读(98) 评论(0) 推荐(0) 编辑
上一页 1 ··· 43 44 45 46 47 48 49 50 51 ··· 59 下一页