摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1116#include<iostream>#include<string>using namespace std;int in[30],out[30],bin[30],d[30];int findx(int x){if(bin[x]==-1) bin[x]=x;while(x!=bin[x]) x=bin[x];return x;}int main(){int t,n,i,x,y;string str;cin>>t;while(t--){cin>>n;memse 阅读全文
摘要:
http://poj.org/problem?id=1149http://imlazy.ycool.com/post.2059102.html 大牛的见图详解。#include<iostream>#include<queue>using namespace std;#define INF 0x7fffffff#define maxn 1100#define maxe 100010typedef struct {int v,val,next;}Edge;Edge e[maxe];int idx,S,T;int bild[maxn],h[maxn],pre[maxn],pi 阅读全文