Language: C

#include <stdio.h>
#include <stdlib.h>
#define NMAX 100000
struct node {
  int id;
  struct node *next;
};
struct node *list[NMAX];
void Insert(int a, int b);
int Dfs(int v, int c, int *color);
int main(void)
{
  int i, n, m, a, b, color[NMAX] = {0};
  long long int wb[2] = {0};
  scanf("%d %d", &n, &m);
  for (i = 0; i < n; i++) list[i] = NULL;
  for (i = 0; i < m; i++) {
    scanf("%d %d", &a, &b);
    Insert(a - 1, b - 1);
  }
  for (i = 0; i < n; i++) {
    if (!Dfs(i, 1, color)) {
      printf("%lld\n", (long long int)(n - 1) * n / 2 - m);
      return 0;
    }
  }
  for (i = 0; i < n; i++) {
     wb[(color[i]+1)/2]++;
     free(list[i]);
  }
  printf("%lld\n", wb[0] * wb[1] - m);
}

void Insert(int a, int b)
{
  struct node *p = (struct node*)malloc(sizeof(struct node));
  p->id = b;
  p->next = list[a];
  list[a] = p;
  p = (struct node*)malloc(sizeof(struct node));
  p->id = a;
  p->next = list[b];
  list[b] = p;
}

int Dfs(int v, int c, int *color)
{
  struct node *n;
  color[v] = c;
  for (n = list[v]; n != NULL; n = n->next) {
    if (color[n->id] == c) return 0;
    else if (color[n->id] == 0 && !Dfs(n->id, -c, color)) return 0;
  }
  return 1;
}
ua093427@DESKTOP-00E4HER:~/GRL$ vi 3steps.c
ua093427@DESKTOP-00E4HER:~/GRL$ cat 3steps.c
#include <stdio.h>
#include <stdlib.h>
#define NMAX 100000
struct node {
  int id;
  struct node *next;
};
struct node *list[NMAX];
void Insert(int a, int b);
int Dfs(int v, int c, int *color);
int main(void)
{
  int i, n, m, a, b, color[NMAX] = {0};
  long long int wb[2] = {0};
  scanf("%d %d", &n, &m);
  for (i = 0; i < n; i++) list[i] = NULL;
  for (i = 0; i < m; i++) {
    scanf("%d %d", &a, &b);
    Insert(a - 1, b - 1);
  }
  if (!Dfs(0, 1, color))
    printf("%lld\n", (long long int)(n - 1) * n / 2 - m);
    return 0;
  }
  for (i = 0; i < n; i++) {
     wb[(color[i]+1)/2]++;
     free(list[i]);
  }
  printf("%lld\n", wb[0] * wb[1] - m);
}

void Insert(int a, int b)
{
  struct node *p = (struct node*)malloc(sizeof(struct node));
  p->id = b;
  p->next = list[a];
  list[a] = p;
  p = (struct node*)malloc(sizeof(struct node));
  p->id = a;
  p->next = list[b];
  list[b] = p;
}

int Dfs(int v, int c, int *color)
{
  struct node *n;
  color[v] = c;
  for (n = list[v]; n != NULL; n = n->next) {
    if (color[n->id] == c) return 0;
    else if (color[n->id] == 0 && !Dfs(n->id, -c, color)) return 0;
  }
  return 1;
}

Compiler output:
main.c:56:9: error: stray '@' in program
   56 | ua093427@DESKTOP-00E4HER:~/GRL$ vi 3steps.c
      |         ^
main.c:56:1: error: unknown type name 'ua093427'
   56 | ua093427@DESKTOP-00E4HER:~/GRL$ vi 3steps.c
      | ^~~~~~~~
main.c:56:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '-' token
   56 | ua093427@DESKTOP-00E4HER:~/GRL$ vi 3steps.c
      |                 ^
main.c:56:18: error: invalid suffix "HER" on floating constant
   56 | ua093427@DESKTOP-00E4HER:~/GRL$ vi 3steps.c
      |                  ^~~~~~~
main.c:56:36: error: invalid suffix "steps.c" on integer constant
   56 | ua093427@DESKTOP-00E4HER:~/GRL$ vi 3steps.c
      |                                    ^~~~~~~~
main.c:57:9: error: stray '@' in program
   57 | ua093427@DESKTOP-00E4HER:~/GRL$ cat 3steps.c
      |         ^
main.c:57:18: error: invalid suffix "HER" on floating constant
   57 | ua093427@DESKTOP-00E4HER:~/GRL$ cat 3steps.c
      |                  ^~~~~~~
main.c:57:37: error: invalid suffix "steps.c" on integer constant
   57 | ua093427@DESKTOP-00E4HER:~/GRL$ cat 3steps.c
      |                                     ^~~~~~~~
main.c:68:5: error: redefinition of 'main'
   68 | int main(void)
      |     ^~~~
main.c:11:5: note: previous definition of 'main' with type 'int(void)'
   11 | int main(void)
      |     ^~~~
main.c:82:3: error: expected identifier or '(' before 'for'
   82 |   for (i = 0; i < n; i++) {
      |   ^~~
main.c:82:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   82 |   for (i = 0; i < n; i++) {
      |                 ^
main.c:82:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   82 |   for (i = 0; i < n; i++) {
      |                       ^~
main.c:86:10: error: expected declaration specifiers or '...' before string constant
   86 |   printf("%lld\n", wb[0] * wb[1] - m);
      |          ^~~~~~~~
main.c:86:20: error: unknown type name 'wb'
   86 |   printf("%lld\n", wb[0] * wb[1] - m);
      |                    ^~
main.c:87:1: error: expected identifier or '(' before '}' token
   87 | }
      | ^
main.c:89:6: error: redefinition of 'Insert'
   89 | void Insert(int a, int b)
      |      ^~~~~~
main.c:34:6: note: previous definition of 'Insert' with type 'void(int,  int)'
   34 | void Insert(int a, int b)
      |      ^~~~~~
main.c:101:5: error: redefinition of 'Dfs'
  101 | int Dfs(int v, int c, int *color)
      |     ^~~
main.c:46:5: note: previous definition of 'Dfs' with type 'int(int,  int,  int *)'
   46 | int Dfs(int v, int c, int *color)
      |     ^~~