Language: C++

#include <cstdio>
#include <vector>
#include <queue>
#define INF (1LL<<60)
using namespace std;

typedef long long Weight;
struct Edge {
  int src, dst;
  Weight weight;
  Edge(int src, int dst, Weight weight) :
    src(src), dst(dst), weight(weight) { }
};
bool operator < (const Edge &e, const Edge &f) {
  return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
    e.src != f.src ? e.src < f.src : e.dst < f.dst;
}

typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

void visit(const Graph & g, int v, int u,
    Edges& brdg, vector< vector<int> >& tecomp,
    stack<int>& roots, stack<int>& S, vector<bool>& inS,
    vector<int>& num, int& time) {
  num[v] = ++time;
  S.push(v); inS[v] = true;
  roots.push(v);
  for(auto &e, g[v]) {
    int w = e.dst;
    if (num[w] == 0)
      visit(g, w, v, brdg, tecomp, roots, S, inS, num, time);
    else if (u != w && inS[w])
      while (num[roots.top()] > num[w]) roots.pop();
  }
  if (v == roots.top()) {
    brdg.push_back(Edge(u, v));
    tecomp.push_back(vector<int>());
    while (1) {
      int w = S.top(); S.pop(); inS[w] = false;
      tecomp.back().push_back(w);
      if (v == w) break;
    }
    roots.pop();
  }
}
void bridge(const Graph& g, Edges& brdg, vector< vector<int> >& tecomp) {
  const int n = g.size();
  vector<int> num(n);
  vector<bool> inS(n);
  stack<int> roots, S;
  int time = 0;
  for(int u=0;u<n;u++) if (num[u] == 0) {
    visit(g, u, n, brdg, tecomp, roots, S, inS, num, time);
    brdg.pop_back();
  }
}

int main(){
	int i,V,E,start,goal,s,t,e;
	//for(scanf("%d",&T);T;putchar(--T?' ':'\n')){
		scanf("%d%d",&V,&E);
		Graph g(V);
		for(i=0;i<E;i++)scanf("%d%d",&s,&t),g[s-1].push_back(Edge(s-1,t-1,1)),g[t-1].push_back(Edge(t-1,s-1,1));
		Edges brdg;
		vector< vector<int> >tecomp;
		bridge(g,brdg,tecomp);
		printf("%d\n",brdg.size());
	//}
}

Compiler output:
a.cc:24:5: error: 'stack' has not been declared
   24 |     stack<int>& roots, stack<int>& S, vector<bool>& inS,
      |     ^~~~~
a.cc:24:10: error: expected ',' or '...' before '<' token
   24 |     stack<int>& roots, stack<int>& S, vector<bool>& inS,
      |          ^
a.cc: In function 'void visit(const Graph&, int, int, Edges&, std::vector<std::vector<int> >&, int)':
a.cc:26:3: error: 'num' was not declared in this scope; did you mean 'enum'?
   26 |   num[v] = ++time;
      |   ^~~
      |   enum
a.cc:26:14: error: 'time' was not declared in this scope
   26 |   num[v] = ++time;
      |              ^~~~
a.cc:4:1: note: 'time' is defined in header '<ctime>'; this is probably fixable by adding '#include <ctime>'
    3 | #include <queue>
  +++ |+#include <ctime>
    4 | #define INF (1LL<<60)
a.cc:27:3: error: 'S' was not declared in this scope
   27 |   S.push(v); inS[v] = true;
      |   ^
a.cc:27:14: error: 'inS' was not declared in this scope; did you mean 'int'?
   27 |   S.push(v); inS[v] = true;
      |              ^~~
      |              int
a.cc:28:3: error: 'roots' was not declared in this scope
   28 |   roots.push(v);
      |   ^~~~~
a.cc:29:7: error: declaration of 'auto& e' has no initializer
   29 |   for(auto &e, g[v]) {
      |       ^~~~
a.cc:29:20: error: expected ';' before ')' token
   29 |   for(auto &e, g[v]) {
      |                    ^
      |                    ;
a.cc:29:20: error: expected primary-expression before ')' token
a.cc:29:20: error: expected ';' before ')' token
   29 |   for(auto &e, g[v]) {
      |                    ^
      |                    ;
a.cc:37:29: error: no matching function for call to 'Edge::Edge(int&, int&)'
   37 |     brdg.push_back(Edge(u, v));
      |                             ^
a.cc:11:3: note: candidate: 'Edge::Edge(int, int, Weight)'
   11 |   Edge(int src, int dst, Weight weight) :
      |   ^~~~
a.cc:11:3: note:   candidate expects 3 arguments, 2 provided
a.cc:8:8: note: candidate: 'constexpr Edge::Edge(const Edge&)'
    8 | struct Edge {
      |        ^~~~
a.cc:8:8: note:   candidate expects 1 argument, 2 provided
a.cc:8:8: note: candidate: 'constexpr Edge::Edge(Edge&&)'
a.cc:8:8: note:   candidate expects 1 argument, 2 provided
a.cc: In function 'void bridge(const Graph&, Edges&, std::vector<std::vector<int> >&)':
a.cc:51:3: error: 'stack' was not declared in this scope
   51 |   stack<int> roots, S;
      |   ^~~~~
a.cc:4:1: note: 'std::stack' is defined in header '<stack>'; this is probably fixable by adding '#include <stack>'
    3 | #include <queue>
  +++ |+#include <stack>
    4 | #define INF (1LL<<60)
a.cc:51:9: error: expected primary-expression before 'int'
   51 |   stack<int> roots, S;
      |         ^~~
a.cc:54:34: error: 'roots' was not declared in this scope
   54 |     visit(g, u, n, brdg, tecomp, roots, S, inS, num, time);
      |                                  ^~~~~
a.cc:54:41: error: 'S' was not declared in this scope
   54 |     visit(g, u, n, brdg, tecomp, roots, S, inS, num, time);
      |                                         ^