JOIN
 Select a Forum     Round Tables New Member Discussions News Discussions Algorithm Matches Marathon Matches NASA Tournament Lab TopCoder Cookbook High School Matches Sponsor Discussions Development Forums Design Forums Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings View: Flat (newest first)  | Threaded  | Tree Previous Thread  |  Next Thread Forums TopCoder Cookbook Algorithm Competitions - New Recipes Uva networks
 Uva networks | Reply I was trying this problem on articulation points after reading about it. But i am getting wrong answer everytime#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;#define sz size()#define pb push_back#define _(x,a) memset(x,a,sizeof(x))#define LET(x,a) typeof(a) x(a)#define FOR(i,a,b) for(LET(i,a);i!=(b);++i)#define REP(i,n) FOR(i,0,n)#define EACH(i,v) FOR(i,(v).begin(),(v).end())#define LL long long#define M 1000000007#define f first#define INF 1<<30#define sec secondint ct;vector vis(101);vector parse(string s){ stringstream ss(s); ss< ret; while(ss>>temp) ret.pb(temp); return ret;} vector < vector > g(101);vector low(101),num(101),parent(101);int ans;vector art(101);void dfs(int u){ vis[u]=1; low[u]=num[u]=ct++; REP(i,g[u].sz) { int w=g[u][i]; if(!vis[w]) { parent[w]=u; dfs(w); if(low[w]>=num[u]&&!art[u]){art[u]=1;ans++;} low[u]=min(low[w],low[u]); } else { if(parent[u]!=w) low[u]=min(low[u],num[w]); } }}int main(){ int n; cin>>n; while(n!=0) { REP(i,n){g[i].clear();low[i]=-1;num[i]=-1;vis[i]=0;parent[i]=0;art[i]=0;} string s; getline(cin,s); while(getline(cin,s)) { //cout<< v(101); int k=0; while(ss>>temp){v[k++]=temp;} //REP(i,k)cout<<<" ";cout<<1) cout<<<>n; } return 0;}thnx in advance
 Forums TopCoder Cookbook Algorithm Competitions - New Recipes Uva networks Previous Thread  |  Next Thread