Language: C++

#include <bits/stdc++.h>
using namespace std;
int h,w;
map<int,int> mp;
graph now={0,0,0},next_r,next_l;
vector<vector<int>> math;
int cnt=0;

struct graph{
    int y;
    int x;
    int num;
};

void check_r();
void check_l();

int main(){
    cin >> h >> w;
    bool math[h][w];
    next_r.x=now.x+1;next_r.y=now.y;next_r.num=now.num;
    next_l.x=now.x;next_l.y=now.y+1;next_l.num=now.num+1;
    while(true){

    }

}

void check_r(){
    if(0 <= next_r.y && next_r.y <= h-1 && 0 <= next_r.x && next_r.x <= w-1){
        math[now.y].push_back(now.x+1);
        next_r.x=now.x+1;
        next_r.y=now.y;
        next_r.num=now.num;
        if(math[now.y][now.x]!=math[next_r.y][next_r.x])mp[now.num]++;
    }
}
void check_l(){
     if(0 <= next_l.y && next_l.y <= h-1 && 0 <= next_l.x && next_l.x <= w-1){
        math.push_back(now.x+1);
        next_r.x=now.x+1;
        next_r.y=now.y;
        next_r.num=now.num;
        if(math[now.y][now.x]!=math[next_r.y][next_r.x])mp[now.num]++;
    }
}

Compiler output:
a.cc:5:1: error: 'graph' does not name a type
    5 | graph now={0,0,0},next_r,next_l;
      | ^~~~~
a.cc:5:18: error: expected unqualified-id before ',' token
    5 | graph now={0,0,0},next_r,next_l;
      |                  ^
a.cc:5:25: error: expected constructor, destructor, or type conversion before ',' token
    5 | graph now={0,0,0},next_r,next_l;
      |                         ^
a.cc:5:32: error: expected constructor, destructor, or type conversion before ';' token
    5 | graph now={0,0,0},next_r,next_l;
      |                                ^
a.cc: In function 'int main()':
a.cc:21:5: error: 'next_r' was not declared in this scope; did you mean 'nextup'?
   21 |     next_r.x=now.x+1;next_r.y=now.y;next_r.num=now.num;
      |     ^~~~~~
      |     nextup
a.cc:21:14: error: 'now' was not declared in this scope; did you mean 'pow'?
   21 |     next_r.x=now.x+1;next_r.y=now.y;next_r.num=now.num;
      |              ^~~
      |              pow
a.cc:22:5: error: 'next_l' was not declared in this scope; did you mean 'nextupl'?
   22 |     next_l.x=now.x;next_l.y=now.y+1;next_l.num=now.num+1;
      |     ^~~~~~
      |     nextupl
a.cc: In function 'void check_r()':
a.cc:30:13: error: 'next_r' was not declared in this scope; did you mean 'nextup'?
   30 |     if(0 <= next_r.y && next_r.y <= h-1 && 0 <= next_r.x && next_r.x <= w-1){
      |             ^~~~~~
      |             nextup
a.cc:31:14: error: 'now' was not declared in this scope; did you mean 'pow'?
   31 |         math[now.y].push_back(now.x+1);
      |              ^~~
      |              pow
a.cc: In function 'void check_l()':
a.cc:39:14: error: 'next_l' was not declared in this scope; did you mean 'nextupl'?
   39 |      if(0 <= next_l.y && next_l.y <= h-1 && 0 <= next_l.x && next_l.x <= w-1){
      |              ^~~~~~
      |              nextupl
a.cc:40:24: error: 'now' was not declared in this scope; did you mean 'pow'?
   40 |         math.push_back(now.x+1);
      |                        ^~~
      |                        pow
a.cc:41:9: error: 'next_r' was not declared in this scope; did you mean 'nextup'?
   41 |         next_r.x=now.x+1;
      |         ^~~~~~
      |         nextup