Language: C++

#include <algorithm>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <vector>
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
 
typedef vector<int> vertex;
typedef vector<vertex> graph;
 
ll n, m;
graph g;
 
void add_edge(int a, int b){
	g[a].push_back(b);
	g[b].push_back(a);
}
 
int used[100000];
 
ll cnt(ll u, ll d, bool &tr){
	if(used[u]){
		if(used[u]!=2-d) tr = true;
		return 0;
	}
	used[u] = 2-d;
	ll res = 0;
	if(d==0) res++;
	for(int v: g[u]){
		res += cnt(v, !d, tr);
	}
	return res;
}
 
int main(){
	cin>>n>>m;
	g = graph(n);
	rep(i, m){
		int a, b;
		cin>>a>>b;
		a--; b--;
		add_edge(a, b);
	}
	bool tr = false;
	ll t = cnt(0, 0, tr);
	if(tr) cout<<n*(n-1)/2-m<<endl;
	else cout<<t*(n-t)-m<<endl;
	return 0;
}

Compiler output:
a.cc:9:9: error: 'vector' does not name a type
    9 | typedef vector<int> vertex;
      |         ^~~~~~
a.cc:10:9: error: 'vector' does not name a type
   10 | typedef vector<vertex> graph;
      |         ^~~~~~
a.cc:12:1: error: 'll' does not name a type
   12 | ll n, m;
      | ^~
a.cc:13:1: error: 'graph' does not name a type
   13 | graph g;
      | ^~~~~
a.cc: In function 'void add_edge(int, int)':
a.cc:16:9: error: 'g' was not declared in this scope
   16 |         g[a].push_back(b);
      |         ^
a.cc: At global scope:
a.cc:22:1: error: 'll' does not name a type
   22 | ll cnt(ll u, ll d, bool &tr){
      | ^~
a.cc: In function 'int main()':
a.cc:37:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   37 |         cin>>n>>m;
      |         ^~~
      |         std::cin
In file included from a.cc:5:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:37:14: error: 'n' was not declared in this scope
   37 |         cin>>n>>m;
      |              ^
a.cc:37:17: error: 'm' was not declared in this scope; did you mean 'tm'?
   37 |         cin>>n>>m;
      |                 ^
      |                 tm
a.cc:38:9: error: 'g' was not declared in this scope
   38 |         g = graph(n);
      |         ^
a.cc:38:13: error: 'graph' was not declared in this scope; did you mean 'isgraph'?
   38 |         g = graph(n);
      |             ^~~~~
      |             isgraph
a.cc:7:37: error: 'll' was not declared in this scope
    7 | #define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
      |                                     ^~
a.cc:39:9: note: in expansion of macro 'rep'
   39 |         rep(i, m){
      |         ^~~
a.cc:46:9: error: 'll' was not declared in this scope
   46 |         ll t = cnt(0, 0, tr);
      |         ^~
a.cc:47:16: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   47 |         if(tr) cout<<n*(n-1)/2-m<<endl;
      |                ^~~~
      |                std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:47:35: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   47 |         if(tr) cout<<n*(n-1)/2-m<<endl;
      |                                   ^~~~
      |                                   std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:48:14: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   48 |         else cout<<t*(n-t)-m<<endl;
      |              ^~~~
      |              std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:48:20: error: 't' was not declared in this scope; did you mean 'tr'?
   48 |         else cout<<t*(n-t)-m<<endl;
      |                    ^
      |                    tr
a.cc:48:31: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   48 |         else cout<<t*(n-t)-m<<endl;
      |                               ^~~~
      |                               std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~