Language: C++

#include <cstdio>
#define ll long long 
#define next nn
#include <algorithm>
using namespace std;
inline void read(ll &k)
{
	ll f=1,c=getchar();k=0;
	while (c<'0'||c>'9')c=='-'&&(f=-1),c=getchar();
	while (c>='0'&&c<='9')k=k*10+c-'0',c=getchar();
	k*=f;
}
const int maxn=100000*2+100;
bool is=1;
int col[maxn];
ll n,m,u,tot=0,vv,a[maxn],b[maxn],last[maxn],to[maxn],next[maxn];
void dfs(int now)
{
//	cout <<now<<endl;
	for (ll i=last[now];i;i=next[i])
	{
		if (!col[to[i]])col[to[i]]=3-col[now],dfs(to[i]);
		else if (col[to[i]]==col[now])is=0;
	}
}
int main()
{
	read(n);read(m);
	for (register int i=1;i<=m;i++)
	{
		read(u);read(vv);
		next[++tot]=last[u];
		last[u]=tot;
		to[tot]=vv;
		next[++tot]=last[vv];
		last[vv]=tot;
		to[tot]=u;
	}
	col[1]=1;
	dfs(1);
	ll b=0;
//	for (int i=1;i<=n;i++)cout << col[i]<<" ";cout <<endl;
	for (register int i=1;i<=n;i++)
	if (col[i]==2)b++;
//	cout << (int)is<<endl;
	if (is)printf("%lld\n",b*(n-b)-m);else printf("%lld\n",n*(n-1)/2-m);
}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:3:14: error: reference to 'nn' is ambiguous
    3 | #define next nn
      |              ^~
a.cc:20:33: note: in expansion of macro 'next'
   20 |         for (ll i=last[now];i;i=next[i])
      |                                 ^~~~
a.cc:3:14: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::nn(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
    3 | #define next nn
      |              ^~
a.cc:3:14: note:                 'long long int nn [200100]'
    3 | #define next nn
      |              ^~
a.cc:16:55: note: in expansion of macro 'next'
   16 | ll n,m,u,tot=0,vv,a[maxn],b[maxn],last[maxn],to[maxn],next[maxn];
      |                                                       ^~~~
a.cc: In function 'int main()':
a.cc:29:27: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   29 |         for (register int i=1;i<=m;i++)
      |                           ^
a.cc:3:14: error: reference to 'nn' is ambiguous
    3 | #define next nn
      |              ^~
a.cc:32:17: note: in expansion of macro 'next'
   32 |                 next[++tot]=last[u];
      |                 ^~~~
a.cc:3:14: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::nn(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
    3 | #define next nn
      |              ^~
a.cc:3:14: note:                 'long long int nn [200100]'
    3 | #define next nn
      |              ^~
a.cc:16:55: note: in expansion of macro 'next'
   16 | ll n,m,u,tot=0,vv,a[maxn],b[maxn],last[maxn],to[maxn],next[maxn];
      |                                                       ^~~~
a.cc:3:14: error: reference to 'nn' is ambiguous
    3 | #define next nn
      |              ^~
a.cc:35:17: note: in expansion of macro 'next'
   35 |                 next[++tot]=last[vv];
      |                 ^~~~
a.cc:3:14: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::nn(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
    3 | #define next nn
      |              ^~
a.cc:3:14: note:                 'long long int nn [200100]'
    3 | #define next nn
      |              ^~
a.cc:16:55: note: in expansion of macro 'next'
   16 | ll n,m,u,tot=0,vv,a[maxn],b[maxn],last[maxn],to[maxn],next[maxn];
      |                                                       ^~~~
a.cc:43:27: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   43 |         for (register int i=1;i<=n;i++)
      |                           ^