Language: C++

#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int longl ong
vector<int> G[100010];

int color[100010];

// 頂点を1と-1で塗っていく
bool dfs(int v, int c) {
    color[v] = c;
    for (int i = 0; i < G[v].size(); i++) {
        // 隣接している頂点が同じ色ならfalse
        if (color[G[v][i]] == c) return false;
        // 隣接している頂点がまだ塗られていないなら-cで塗る
        if (color[G[v][i]] == 0 && !dfs(G[v][i], -c)) return false;
    }

    // すべての頂点を塗れたらtrue
    return true;

}
signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, M;
    cin >> N >> M;
    rep(i, M) {
        int s, t;
        cin >> s >> t;
        s--; t--;
        G[s].push_back(t);
        G[t].push_back(s);
    }
    if(dfs(0, 1)) {
        int k1 = 0, k2 = 0;
        rep(i, 100010) {
            if (color[i] == 1) k1++;
            else if (color[i] == -1) k2++;
        }
        cout << k1 * k2 - M << endl;
    } else {
        cout << N * (N - 1) / 2 - M << endl;
    }



    return 0;
}


Compiler output:
a.cc:12:13: error: 'longl' was not declared in this scope; did you mean 'long'?
   12 | #define int longl ong
      |             ^~~~~
a.cc:13:8: note: in expansion of macro 'int'
   13 | vector<int> G[100010];
      |        ^~~
a.cc:13:11: error: template argument 1 is invalid
   13 | vector<int> G[100010];
      |           ^
a.cc:13:11: error: template argument 2 is invalid
a.cc:12:13: error: 'longl' does not name a type; did you mean 'long'?
   12 | #define int longl ong
      |             ^~~~~
a.cc:15:1: note: in expansion of macro 'int'
   15 | int color[100010];
      | ^~~
a.cc:12:13: error: 'longl' was not declared in this scope; did you mean 'long'?
   12 | #define int longl ong
      |             ^~~~~
a.cc:18:10: note: in expansion of macro 'int'
   18 | bool dfs(int v, int c) {
      |          ^~~
a.cc:12:13: error: 'longl' was not declared in this scope; did you mean 'long'?
   12 | #define int longl ong
      |             ^~~~~
a.cc:18:17: note: in expansion of macro 'int'
   18 | bool dfs(int v, int c) {
      |                 ^~~
a.cc:18:22: error: expression list treated as compound expression in initializer [-fpermissive]
   18 | bool dfs(int v, int c) {
      |                      ^
a.cc: In function 'int main()':
a.cc:12:13: error: 'longl' was not declared in this scope; did you mean 'long'?
   12 | #define int longl ong
      |             ^~~~~
a.cc:35:5: note: in expansion of macro 'int'
   35 |     int N, M;
      |     ^~~
a.cc:36:12: error: 'N' was not declared in this scope
   36 |     cin >> N >> M;
      |            ^
a.cc:36:17: error: 'M' was not declared in this scope
   36 |     cin >> N >> M;
      |                 ^
a.cc:12:19: error: expected ';' before 'ong'
   12 | #define int longl ong
      |                   ^~~
a.cc:4:23: note: in expansion of macro 'int'
    4 | #define rep(i,n) for( int i = 0; i < n; i++ )
      |                       ^~~
a.cc:37:5: note: in expansion of macro 'rep'
   37 |     rep(i, M) {
      |     ^~~
a.cc:37:9: error: 'i' was not declared in this scope
   37 |     rep(i, M) {
      |         ^
a.cc:4:34: note: in definition of macro 'rep'
    4 | #define rep(i,n) for( int i = 0; i < n; i++ )
      |                                  ^
a.cc:12:19: error: expected ';' before 'ong'
   12 | #define int longl ong
      |                   ^~~
a.cc:38:9: note: in expansion of macro 'int'
   38 |         int s, t;
      |         ^~~
a.cc:39:16: error: 's' was not declared in this scope
   39 |         cin >> s >> t;
      |                ^
a.cc:39:21: error: 't' was not declared in this scope; did you mean 'tm'?
   39 |         cin >> s >> t;
      |                     ^
      |                     tm
a.cc:44:11: error: 'dfs' cannot be used as a function
   44 |     if(dfs(0, 1)) {
      |        ~~~^~~~~~
a.cc:12:19: error: expected ';' before 'ong'
   12 | #define int longl ong
      |                   ^~~
a.cc:45:9: note: in expansion of macro 'int'
   45 |         int k1 = 0, k2 = 0;
      |         ^~~
a.cc:12:19: error: expected ';' before 'ong'
   12 | #define int longl ong
      |                   ^~~
a.cc:4:23: note: in expansion of macro 'int'
    4 | #define rep(i,n) for( int i = 0; i < n; i++ )
      |                       ^~~
a.cc:46:9: note: in expansion of macro 'rep'
   46 |         rep(i, 100010) {
      |         ^~~
a.cc:46:13: error: 'i' was not declared in this scope
   46 |         rep(i, 100010) {
      |             ^
a.cc:4:34: note: in definition of macro 'rep'
    4 | #define rep(i,n) for( int i = 0; i < n; i++ )
      |                                  ^
a.cc:47:17: error: 'color' was not declared in this scope
   47 |             if (color[i] == 1) k1++;
      |                 ^~~~~
a.cc:47:32: error: 'k1' was not declared in this scope; did you mean 'y1'?
   47 |             if (color[i] == 1) k1++;
      |                                ^~
      |                                y1
a.cc:48:38: error: 'k2' was not declared in this scope
   48 |             else if (color[i] == -1) k2++;
      |                                      ^~
a.cc:50:17: error: 'k1' was not declared in this scope; did you mean 'y1'?
   50 |         cout << k1 * k2 - M << endl;
      |                 ^~
      |                 y1
a.cc:50:22: error: 'k2' was not declared in this scope
   50 |         cout << k1 * k2 - M << endl;
      |                      ^~