online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <bits/stdc++.h> using namespace std; #define ll long long #define mod 1000000007 int timer=1; int vis[2000]; int low[2000],in[2000]; map<int,vector<int>> mp; void dfs(int curr,int parr){ vis[curr] = 1; low[curr]=in[curr]=timer; timer++; for(auto x:mp[curr]){ if(x==parr){ continue; } else if(vis[x]){ low[curr] = min(low[curr],in[x]); } else{ dfs(x,curr); if(in[curr]<low[x]){ cout<<"bridge "<<curr<<" -> "<<x<<"\n"; } low[curr] = min(low[curr],low[x]); } } } int main(){ #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif int n; cin >> n; for(int i=1;i<=n;i++){ int a,b; cin >> a>>b; mp[a].push_back(b); mp[b].push_back(a); } dfs(1,-1); }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue