criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
void ABC40(void);
void ABC41(void);
void ABC42(void);
void ABC43(void);
void ABC44(void);
void ABC45(void);
void ABC46(void);
void ABC47(void);
void ABC48(void);
void ABC49(void);

int main(void){
    ABC47();
}

void ABC47(){
    int minx=0,maxx,miny=0,maxy,n,x,y,i,a;
    cin>>maxx>>maxy>>n;
    for(i=0;i<n;i++){
        cin>>x>>y>>a;
        if(a==1&&x>minx)minx=x;
        if(a==2&&x<maxx)maxx=x;
        if(a==3&&y>miny)miny=y;
        if(a==4&&y<maxy)maxy=y;
    }
    if((maxx-minx)>=0&&(maxy-miny)>=0)s=(maxx-minx)*(maxy-miny);
    if(s>=0)cout<<s<<endl;
    else cout<<0<<endl;
}

Compiler output:
a.cc: In function 'void ABC47()':
a.cc:29:39: error: 's' was not declared in this scope
   29 |     if((maxx-minx)>=0&&(maxy-miny)>=0)s=(maxx-minx)*(maxy-miny);
      |                                       ^
a.cc:30:8: error: 's' was not declared in this scope
   30 |     if(s>=0)cout<<s<<endl;
      |        ^
Language: C++

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
void ABC40(void);
void ABC41(void);
void ABC42(void);
void ABC43(void);
void ABC44(void);
void ABC45(void);
void ABC46(void);
void ABC47(void);
void ABC48(void);
void ABC49(void);

int main(void){
    ABC47();
}

void ABC47(){
    int minx=0,maxx,miny=0,maxy,n,x,y,i,a;
    cin>>maxx>>maxy>>n;
    for(i=0;i<n;i++){
        cin>>x>>y>>a;
        if(a==1&&x>minx)minx=x;
        if(a==2&&x<maxx)maxx=x;
        if(a==3&&y>miny)miny=y;
        if(a==4&&y<maxy)maxy=y;
    }
    if((maxx-minx)&&(maxy-miny))s=(maxx-minx)*(maxy-miny);
    if(s>=0)cout<<s<<endl;
    else cout<<0<<endl;
}

Compiler output:
a.cc: In function 'void ABC47()':
a.cc:29:33: error: 's' was not declared in this scope
   29 |     if((maxx-minx)&&(maxy-miny))s=(maxx-minx)*(maxy-miny);
      |                                 ^
a.cc:30:8: error: 's' was not declared in this scope
   30 |     if(s>=0)cout<<s<<endl;
      |        ^
Language: C++

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
void ABC40(void);
void ABC41(void);
void ABC42(void);
void ABC43(void);
void ABC44(void);
void ABC45(void);
void ABC46(void);
void ABC47(void);
void ABC48(void);
void ABC49(void);

int main(void){
    ABC47();
}

void ABC47(){
    int minx=0,maxx,miny=0,maxy,n,x,y,i,a,h,w;
    cin>>maxx>>maxy>>n;
    w=maxx;
    h=maxy;
    for(i=0;i<n;i++){
        cin>>x>>y>>a;
        if(x>=max||y>=min)continue;
        if(a==1&&x>minx)minx=x;
        if(a==2&&x<maxx)maxx=x;
        if(a==3&&y>miny)miny=y;
        if(a==4&&y<maxy)maxy=y;
    }
    int s=(maxx-minx)*(maxy-miny);
    if(s>=0)cout<<s<<endl;
    else cout<<0<<endl;
}

Compiler output:
a.cc: In function 'void ABC47()':
a.cc:26:13: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>='
   26 |         if(x>=max||y>=min)continue;
      |            ~^~~~~
a.cc:26:21: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator>='
   26 |         if(x>=max||y>=min)continue;
      |                    ~^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;


int main(){

  int xmax, ymax, n;
  cin >> xmax >> ymax >> n;

  vector<int> x(n);
  vector<int> y(n);
  vector<int> a(n);
  int xmin = 0;
  int ymin = 0;

  for (int i = 0; i < n; i++) {
    cin >> x.at(i) >> y.at(i) >> a.at(i);
    if (a.at(i) == 1) {
      xmin = max(xmin,x.at(i));

    } else if (a.at(i) == 2) {
      xmax = min(xmax,x.at(i));

    } else if (a.at(i) == 3) {
      ymin = max(ymin,y.at(i));

    } else if (a.at(i) == 4) {
      ymin = max(ymin,y.at(i));

    }
  }

  int s;
  s = max(0,(xmax-xmin))*max(0,(yymax-ymin));
  cout << s << endl;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:33: error: 'yymax' was not declared in this scope; did you mean 'ymax'?
   34 |   s = max(0,(xmax-xmin))*max(0,(yymax-ymin));
      |                                 ^~~~~
      |                                 ymax
Language: C++

#include <bits/stdc++.h>
using namespace std;


int main(){

  int xmax, ymax, n;
  cin >> xmax >> ymax >> n;

  vector<int> x(n);
  vector<int> y(n);
  vector<int> a(n);
  int xmin = 0;
  int ymin = 0;

  for (int i = 0; i < n; i++) {
    cin >> x.at(i) >> y.at(i) >> a.at(i);
    if (a.at(i) == 1) {
      xmin = max(xmin,x.at(i));

    } else if (a.at(i) == 2) {
      xmax = min(xmax,x.at(i));

    } else if (a.at(i) == 3) {
      ymin = max(ymin,y.at(i));

    } else if (a.at(i) == 4) {
      ymin = max(ymin,y.at(i));

    }
  }

  int s;
  s = max(0,(xmax-xmin))*max(0,(max-ymin));
  cout << s << endl;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:36: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
   34 |   s = max(0,(xmax-xmin))*max(0,(max-ymin));
      |                                 ~~~^~~~~
Language: C++

#include <iostream> #include <algorithm> using namespace std; const int maxn = 100 + 10;  int main() {     int w, h, n;     cin >> w >> h >> n;     int wl = 0, wr = w, hd = 0, hu = h;     while (n--)     {         int x, y, a;         cin >> x >> y >> a;         switch (a)         {         case 1:             wl = x;             break;         case 2:             wr = x;             break;         case 3:             hd = y;             break;         case 4:             hu = y;             break;         default:             break;         }     }     int ans;     if (wr <= wl || hu <= hd)         ans = 0;     else         ans = (wr - wl) * (hu - hd);     cout << ans << endl;     return 0; }

Compiler output:
a.cc:1:21: warning: extra tokens at end of #include directive
    1 | #include <iostream> #include <algorithm> using namespace std; const int maxn = 100 + 10;  int main() {     int w, h, n;     cin >> w >> h >> n;     int wl = 0, wr = w, hd = 0, hu = h;     while (n--)     {         int x, y, a;         cin >> x >> y >> a;         switch (a)         {         case 1:             wl = x;             break;         case 2:             wr = x;             break;         case 3:             hd = y;             break;         case 4:             hu = y;             break;         default:             break;         }     }     int ans;     if (wr <= wl || hu <= hd)         ans = 0;     else         ans = (wr - wl) * (hu - hd);     cout << ans << endl;     return 0; }
      |                     ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
using namespace std;
int max(int a,int b)
{
	if(a>b)
		return a;
	else
		return b;
}
int min(int a,int b)
{
	if(a<b)
		return a;
	else
		return b;
}
int main()
{
	int w,h,n,s,i,x[105],y[105],a[105];
	cin>>w>>h>>n;
	int x1=0,x2=w,y1=0,y2=h;
	for(i=0;i<n;i++)
	{
		cin>>x[i]>>y[i]>>a[i];
		if(a==1)
			x1=max(x1,x[i]);
		if(a==2)
			x2=min(x2,x[i]);
		if(a==3)
			y1=max(y1,y[i]);
		if(a==4)
			y2=min(y2,y[i]);
	}
	s=(x2-x1)*(y2-y1);
	if(x2-x1<=0||y2-y1<=0)
		s=0;
	cout<<s<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   25 |                 if(a==1)
      |                    ~^~~
a.cc:27:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   27 |                 if(a==2)
      |                    ~^~~
a.cc:29:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   29 |                 if(a==3)
      |                    ~^~~
a.cc:31:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   31 |                 if(a==4)
      |                    ~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{

  int w,h,n;
  cin>>w>>h>>n;
  int X1=0,X2=w,Y1=0,Y2=h;
  for(int i=0;i<n;i++)
  {
    int x,y,a;
    cin>>x>>y>>a;
    if(a==1)
    {
      X1=max(X1,x);
    }
    else if(a==2)
    {
      X2=min(X2,x);
    }
    else if(a==3)
    {
      Y1=max(Y1,y);
    }
    else if(a==4)
    {
      Y2=min(Y2,y);
    }
  }
  
  long long ans=max(X2-X1)*(Y2-Y1);
  if(X2<=X1 ||Y2<=Y1)ans=0;
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:20: error: no matching function for call to 'max(int)'
   31 |   long long ans=max(X2-X1)*(Y2-Y1);
      |                 ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   template argument deduction/substitution failed:
a.cc:31:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   31 |   long long ans=max(X2-X1)*(Y2-Y1);
      |                 ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int W,H,N;
  cin>>W>>H>>N;
  int maxX=0;
  int minX=W;
  int maxY=0;
  int minY=H;
  for(int i=0;i<N;i++){
  int x,y,a;
    cin>>x>>y>>a;
    if(a==1){
    if(maxX<x)
      maxX=x;
    }
      if(a==2){
      if(x<minX)
        minX=x;
      }
        if(a==3){
        if(maxY<y)
          maxY=y;
        }
          if(a==4){
          if(y<minY)
            minY=y;
          }
  
  }if(minX<=MaxX || minY<=maxY)
    cout<<0<<endl;
  else{
  int ans=(minX-maxX)*(minY-maxY);
    cout<<ans<<endl;
  }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:13: error: 'MaxX' was not declared in this scope; did you mean 'maxX'?
   30 |   }if(minX<=MaxX || minY<=maxY)
      |             ^~~~
      |             maxX
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int  w, h, n, bxr=0, bxl=0, byu=0, byl=0, ans = 0;
  cin >> w >> h >> n ;
  vector<int> vecx(n), vecy(n), op(n);
  for(int i=0; i<n; i++){
    cin >> vecx(n) >> vecy(n) >> op(n);
  }
  bxl = w;
  byu = h;
  ans = w*h;
  for(int i=0;i<n;i++){
    if(op[i] == 1 && bxr<vecx[i]){
      bxr = vecx[i];
    }
    if(op[i] == 2 && vecx[i]<bxl){
      bxl = vecx[i];
    }
    if(op[i] == 3 && byl<vecy[i]){
      byl = vecy[i];
    }
    if(op[i] == 4 && vecy[i]<byu){
      byu = vecy[i];
    }
  }
  ans = (byu - byl)*(bxl - bxr);

  cout << ans <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: no match for call to '(std::vector<int>) (int&)'
    9 |     cin >> vecx(n) >> vecy(n) >> op(n);
      |            ~~~~^~~
a.cc:9:27: error: no match for call to '(std::vector<int>) (int&)'
    9 |     cin >> vecx(n) >> vecy(n) >> op(n);
      |                       ~~~~^~~
a.cc:9:36: error: no match for call to '(std::vector<int>) (int&)'
    9 |     cin >> vecx(n) >> vecy(n) >> op(n);
      |                                  ~~^~~
Language: C

#include<stdio.h>

int main(){

	int W,H,N = 0;
	scanf("%d %d %d",&W,&H,&N);
	int genten[2] = {0,0};
	int kado[2] = {W,H};
	int S = 0;

	int WW[N],HH[N],NN[N];
	for(int i=0; i<N; i++){
		scanf("%d %d %d",&WW[i],&HH[i],&NN[i]);
	}

	for(int j=0; j<N; j++){
		if(NN[j]==1){
			if(genten[0] < WW[j]){
				genten [0] = WW[j];
			}
		}else if(NN[j]==2){
			if(kado[0] > WW[j]){
				kado[0]	= WW[j];
			}
		}else if(NN[j]==3){
			if(genten[1] < HH[j]){
				genten [1] = HH[j];
			}
		}else{
			if(kado[1] > HH[j]){
				kado[1]	= HH[j];
			}
		}
	}

	if((kado[0]-genten[0] > 0) &&  (kado[1]-genten[1] > 0 ) ){
		S = (kado[0]-genten[0])*(kado[1]-genten[1]);
	}else{
		S = 0;
	}

	printf("%d",S)

	return 0;

}


Compiler output:
main.c: In function 'main':
main.c:42:23: error: expected ';' before 'return'
   42 |         printf("%d",S)
      |                       ^
      |                       ;
   43 | 
   44 |         return 0;
      |         ~~~~~~
Language: C

#include<stdio.h>

int main(){

	int W,H,N = 0;
	scanf("%d %d %d",&W,&H,&N);
	int genten[2] = {0,0};
	int kado[2] = {W,H};
	int S = 0;

	int WW[N],HH[N],NN[N];
	for(int i=0; i<N; i++){
		scanf("%d %d %d",&WW[i],&HH[i],&NN[i]);
	}

	for(int j=0; j<N; j++){
		if(NN[j]==1){
			if(genten[0] < WW[j]){
				genten [0] = WW[j];
			}
		}else if(NN[j]==2){
			if(kado[0] > WW[j]){
				kado[0]	= WW[j];
			}
		}else if(NN[j]==3){
			if(genten[1] < HH[j]){
				genten [1] = HH[j];
			}
		}else{
			if(kado[1] > HH[j]){
				kado[1]	= HH[j];
			}
		}
	}

	if((kado[0]-genten[0] > 0) && (kado[1]-genten[1]) ){
		S = (kado[0]-genten[0])*(kado[1]-genten[1]);
	}else{
		S = 0;
	}

	printf("%d",S)

	return 0;

}


Compiler output:
main.c: In function 'main':
main.c:42:23: error: expected ';' before 'return'
   42 |         printf("%d",S)
      |                       ^
      |                       ;
   43 | 
   44 |         return 0;
      |         ~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

# define rep(i, n) for(int(i)=0;(i)<(n);(i)++)
# define reps(i, n) for(int(i)=1;(i)<=(n);(i)++)
# define rrep(i, n) for(int i=((int)(n)); i>0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>=0; --i)
# define ALL(v) v.begin(), v.end()
template<class T>inline bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>inline bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
template<typename T> void dump(T e){std::cout << e << std::endl;}
template<typename T> void dump(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void dump(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ dump(v); } }
typedef long long ll;


int main() {
  int W,H,N; cin >> W >> H >> N;
  int X,Y=0;
  rep(i, n) {
    int x,y,a;
    cin >> x >> y >> a;
    if (a==1) {
      X=max(X,x);
    } else if(a ==2) {
      W=min(W,x);
    } else if(a==3) {
      Y=max(Y,y);
    } else {
      H=min(H,y);
    }
  }
  dump(max(w-X,0)*max(h-Y,0));
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:10: error: 'n' was not declared in this scope
   20 |   rep(i, n) {
      |          ^
a.cc:4:38: note: in definition of macro 'rep'
    4 | # define rep(i, n) for(int(i)=0;(i)<(n);(i)++)
      |                                      ^
a.cc:33:12: error: 'w' was not declared in this scope
   33 |   dump(max(w-X,0)*max(h-Y,0));
      |            ^
a.cc:33:23: error: 'h' was not declared in this scope
   33 |   dump(max(w-X,0)*max(h-Y,0));
      |                       ^
Language: C++

	int W, H, N;
	cin >> W >> H >> N;
	int x1 = 0, x2 = W, y1 = 0, y2 = H;
	int x, y, a;
	rep(i, N) {
		cin >> x >> y >> a;
		if (a == 1)
			x1 = max(x1, x);
		if (a == 2)
			x2 = min(x2, x);
		if (a == 3)
			y1 = max(y1, y);
		if (a == 4)
			y2 = min(y2, y);
	}
	int q = 0;
	cout << max(q,(x2 - x1) * (y2 - y1));

Compiler output:
a.cc:2:9: error: 'cin' does not name a type
    2 |         cin >> W >> H >> N;
      |         ^~~
a.cc:3:29: warning: built-in function 'y1' declared as non-function [-Wbuiltin-declaration-mismatch]
    3 |         int x1 = 0, x2 = W, y1 = 0, y2 = H;
      |                             ^~
a.cc:5:12: error: expected constructor, destructor, or type conversion before '(' token
    5 |         rep(i, N) {
      |            ^
a.cc:17:9: error: 'cout' does not name a type
   17 |         cout << max(q,(x2 - x1) * (y2 - y1));
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int w,h,n;
  cin >> w >> h >> n;
  vector<int> x(n), y(n), a(n);
  for (int i = 0; i < n; i++){
    cin >> x[i] >> y[i] >> a[i];
  }
  vector<vector<int>> table(h, vector<int>(w, 0));
  
  for(int i = 0; i < n; i++){
    if(a[i] == 1){
      for (int x = 0; x<x[i]-1; x++){
        for(int y = 0; y < h; y++){
          table[x][y] = 1;
        }
      }
    }
    if(a[i] == 2){
      for (int x = x[i] + 1; x<w; x++){
        for(int y = 0; y < h; y++){
          table[x][y] = 1;
        }
      }
    }
    if(a[i] == 3){
      for (int x = 0; x<w; x++){
        for(int y = 0; y < y[i] -1; y++){
          table[x][y] = 1;
        }
      }
    }
    if(a[i] == 4){
      for (int x = 0; x<h; x++){
        for(int y = y[i] + 1; y < w; y++){
          table[x][y] = 1;
        }
      }
    }
  }

  int count = 0;
  for (int i = 0; i < h; i++){
    for(int j = 0; j < w; j++){
      if(table[i][j] == 0) count++;
    }
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:26: error: invalid types 'int[int]' for array subscript
   14 |       for (int x = 0; x<x[i]-1; x++){
      |                          ^
a.cc:21:21: error: invalid types 'int[int]' for array subscript
   21 |       for (int x = x[i] + 1; x<w; x++){
      |                     ^
a.cc:29:29: error: invalid types 'int[int]' for array subscript
   29 |         for(int y = 0; y < y[i] -1; y++){
      |                             ^
a.cc:36:22: error: invalid types 'int[int]' for array subscript
   36 |         for(int y = y[i] + 1; y < w; y++){
      |                      ^
Language: C++

c#include <bits/stdc++.h>
using namespace std;

int main(){
  int W, H, N;
  cin >> W >> H >> N;
  int iro[W+1][H+1];
  for(int i=0; i<W+1; i++)
    for(int j=0; j<H+1; j++)
      iro[i][j]=0;
  
  for(int i=0; i<N; i++){
    int x, y, n;
    cin >> x >> y >> n;
    if(n==1){
      if(x==0)
        continue;
      for(int i=0; i<x; i++)
        for(int j=0; j<H+1; j++)
          iro[i][j]=1;
    }
    else if(n==2){
      if(x==W)
        continue;
      for(int i=x+1; i<W+1; i++)
        for(int j=0; j<H+1; j++)
          iro[i][j]=1;
    }
    else if(n==3){
      if(y==0)
        continue;
      for(int i=0; i<W+1; i++)
        for(int j=0; j<y; j++)
          iro[i][j]=1;
    }
    else{
      if(y==H)
        continue;
      for(int i=0; i<W+1; i++)
        for(int j=y+1; j<H+1; j++)
          iro[i][j]=1;
    } 
  }
  int kioku_x, kioku_y;
  int count_x=0, count_y=0;
  bool shiro=false;
  for(int i=0; i<W+1; i++){
    for(int j=0; j<H+1; j++){
      if(iro[i][j]==0){
        kioku_x=i, kioku_y=j;
        shiro=true;
        break;
      }
    }
    if(shiro==true)
      break;
  }
  
  for(int i=kioku_x; i<W+1; i++){
    if(iro[i][kioku_y]==0)
           count_x++;
  }
  for(int j=kioku_y; j<H+1; j++){
    if(iro[kioku_x][j]==0)
           count_y++;
  }
  if(shiro==false)
    cout << 0 << endl;
  else
    cout << (count_x-1)*(count_y-1) << endl;
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | c#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'c' does not name a type
    1 | c#include <bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> W >> H >> N;
      |   ^~~
a.cc:68:5: error: 'cout' was not declared in this scope
   68 |     cout << 0 << endl;
      |     ^~~~
a.cc:68:18: error: 'endl' was not declared in this scope
   68 |     cout << 0 << endl;
      |                  ^~~~
a.cc:70:5: error: 'cout' was not declared in this scope
   70 |     cout << (count_x-1)*(count_y-1) << endl;
      |     ^~~~
a.cc:70:40: error: 'endl' was not declared in this scope
   70 |     cout << (count_x-1)*(count_y-1) << endl;
      |                                        ^~~~
Language: C++

#include "bits/stdc++.h"
using namespace std;

int main() {

	int W, H, N;
	cin >> W >> H >> N;

	vector<int> x(N), y(N), a(N);

	for (int i = 0;i < N;i++) {
		cin >> x.at(i) >> y.at(i) >> a.at(i);
	}

	vector<int> C = { W,H };
	vector<int> D = { 0,0 };

	for (int i = 0;i < N;i++) {
		if (a.at(i) == 1) {
			if (D.at(0) < x.at(i)) {
				D.at(0) = x.at(i);
			}
		}
		else if (a.at(i) == 2) {
			if (C.at(0) > x.at(i)) {
				C.at(0) = x.at(i);
			}
		}
		else if (a.at(i) == 3) {
			if (D.at(1) < y.at(i)) {
				D.at(1) = y.at(i);
			}
		}
		else if (a.at(i) == 4) {
			if (C.at(1) > y.at(i)) {
				C.at(1) = y.at(i);
			}
		}
	
		
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:10: error: expected '}' at end of input
   41 |         }
      |          ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
  int W,H,N;
  cin >> W >> H >> N;
  vector<vector<int>> Z(N,vector<int>(3));
  for(int i=0;i<N;i=i+1){
    for(int j=0;j<3;j=j+1){
      cin >> Z.at(i).at(j);
    }
  }
  int S = 0;
  for(int i=0;i<N;i=i+1){
    if(Z.at(i).at(2) == 1){
      S = S + (Z.at(i).at(0))*H;
    }
    else if(Z.at(i).at(2) == 2){
      S = S + (W-Z.at(i).at(0))*H;
    }
    else if(Z.at(i).at(2) == 3){
      S = S + W*(Z.at(i).at(1));
    }
    else if(Z.at(i).at(2) == 4){
      S = S + W*(H-Z.at(i).at(1));
    }
  }
  if(S >= W*H)cout << "0" << endl;
  else i(S < W*H)cout << S << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:8: error: 'i' was not declared in this scope
   29 |   else i(S < W*H)cout << S << endl;
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int w,h,n,l=0,d=0;
  cin>>w>>h>>n;
  for(int i=0; i<n; i++){
    int x,y,a;
    cin>>x>>y>>a;
    if(a==1) l=max(x,l);
    if(a==2) w=min(x,w);
    if(a==3) d=max(y,d);
    if(a==4) h=min(y,h);
  }
  if(w-l<=0 || h-d<=0) cout<<0;
  else cout<<(w-l)*(y-d);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:21: error: 'y' was not declared in this scope
   16 |   else cout<<(w-l)*(y-d);
      |                     ^
Language: C

#include<stdio.h>
#include<stdlib.h>
int main()
{
  int W,H,N;
  int x[100],y[100],a[100];
  int XU,XL=0,YU,YL=0,X,Y;
  
  scanf("%d %d %d",&W,&H,&N);
  XU=W;
  YU=H;
  for(int i=0;i<N;i++)
    scanf("%d %d %d",&x[i],&y[i],&a[i]);
  
  for(int i=0;i<N;i++)
    if(x[i]<XL&&x[i]>XU&&y[i]<YL&&y[i]>YU)
      continue;
    switch(a[i]){
      case 1:
        XL=x[i];
        break;
      case 2:
        XU=x[i];
        break;
      case 3:  
        YL=y[i];
        break;
      case 4:
        YU=y[i];
        break;
      default:
        continue;
    }
  X=XU-XL;
  Y=YU-YL;
  if(X<0) X=0;
  if(Y<0) Y=0;
  printf("%d",X*Y);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:14: error: 'i' undeclared (first use in this function)
   18 |     switch(a[i]){
      |              ^
main.c:18:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:32:9: error: continue statement not within a loop
   32 |         continue;
      |         ^~~~~~~~
Language: C++

#include <iostream>
using namespace std;
int mainn(){
  int W,H,N;
  int a;
  int Wmin=0,Wmax,Hmin=0,Hmax;
  cin >> W >> H >> N;
  Wmax = W;
  Hmax = H;
  for(int i = 0;i<N;i++){
    cin >> W >> H >> a;
    switch(a){
      case 1:
        Wmin = min(Wmin,W);
        break;
      case 2:
        Wmax = max(Wmax,W);
        break;
      case 3:
        Hmin = min(Hmin,H);
        break;
      case 4:
        Hmax = max(Hmax,H);
        break;
      default:
        break;
    }
  }
  cout << (Wmax-Wmin)*(Hmax-Hmin);
}

Compiler output:
a.cc: In function 'int mainn()':
a.cc:30:1: warning: no return statement in function returning non-void [-Wreturn-type]
   30 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int W, H, N;
  cin >> W >> H >> N;
  vector<int> vec(N * 3);
  for (int i = 0; i < N * 3; i++) {
      cin >> vec.at(i);
  }
  using vi = vector<int>;
  using vvi = vector<vi>;
  vvi vec(W, vi(H));
  for (int i = 0; i < N * 3 - 2; i += 3) {
    int x, y, a;
    x = vec.at(i);
    y = vec.at(i+1);
    a = vec.at(i+2);
    if(a == 1){
    	for(int j = 0; j < x; j++){
          for(int k = 0; k < H; k++)
        	vec.at(j).at(k) = 1;
        }
    }
    else if(a == 2){
    	for(int j = x; j < W; j++){
          for(int k = 0; k < H; k++){
        	vec.at(j).at(k) = 1;
          }
        }
    }
    else if(a == 3){
    	for(int j = 0; j < W; j++){
          for(int k = 0; k < y; k++){
        	vec.at(j).at(k) = 1;
          }
        }
    }
    else if(a == 4){
    	for(int j = 0; j < W; j++){
          for(int k = y; k < H; k++){
        	vec.at(j).at(k) = 1;
          }
        }
    }
  }
  int area = 0;
  for(int j = 0; j < W; j++){
     for(int k = 0; k < H; k++){
        area += vec.at(j).at(k);
     }
   }
  cout << (W-1)*(H-1) - area << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: conflicting declaration 'vvi vec'
   13 |   vvi vec(W, vi(H));
      |       ^~~
a.cc:7:15: note: previous declaration as 'std::vector<int> vec'
    7 |   vector<int> vec(N * 3);
      |               ^~~
a.cc:22:27: error: request for member 'at' in 'vec.std::vector<int>::at(((std::vector<int>::size_type)j))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   22 |                 vec.at(j).at(k) = 1;
      |                           ^~
a.cc:28:27: error: request for member 'at' in 'vec.std::vector<int>::at(((std::vector<int>::size_type)j))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   28 |                 vec.at(j).at(k) = 1;
      |                           ^~
a.cc:35:27: error: request for member 'at' in 'vec.std::vector<int>::at(((std::vector<int>::size_type)j))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   35 |                 vec.at(j).at(k) = 1;
      |                           ^~
a.cc:42:27: error: request for member 'at' in 'vec.std::vector<int>::at(((std::vector<int>::size_type)j))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   42 |                 vec.at(j).at(k) = 1;
      |                           ^~
a.cc:50:27: error: request for member 'at' in 'vec.std::vector<int>::at(((std::vector<int>::size_type)j))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   50 |         area += vec.at(j).at(k);
      |                           ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll w, h, n, a, s, x, y;
  in3(w, h, n);
  vector<vector<ll>> c(w, vector<ll> (h));
  rep(i, w){
    rep(j, h)
      c[i][j] = 0;
  }
  rep(i, n){
    in3(a, x, y);
    if(a == 1){
      rep(i, x){
        rep(j, h)
          c[i][j] = 1;
      }
    }
    if(a == 2){
      rep2(i, x, w){
        rep(i, h)
          c[i][j] = 1;
      }
    }
    if(a == 3){
      rep(i, w){
        rep(j, y)
          c[i][j] = 1;
      }
    }
    if(a == 4){
      rep(i, w){
        rep2(j, y, h)
          c[i][j] = 1;
      }
    }
  }
  s = 0;
  rep(i, w){
    rep(j, h){
      if(c[i][j] == 0)
        s++;
    }
  }
  out(s);
  memi;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:16: error: 'j' was not declared in this scope
   36 |           c[i][j] = 1;
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll w, h, n, a, s, x, y;
  in3(w, h, n);
  vector<vector<ll>> c(w, vector<ll> (h));
  rep(i, w){
    rep(j, h)
      c[i][j] = 0;
  }
  rep(i, n){
    in3(a, x, y);
    if(a == 1){
      rep(i, x){
        rep(j, h)
          c[i][j] = 1;
      }
    }
    if(a == 2){
      rep2(i, x, w){
        rep(i, h)
          c[i][j] = 1;
      }
    }
    if(a == 3){
      rep(i, w){
        rep(j, y)
          c[i][j] = 1;
      }
    }
    if(a == 4){
      rep(i, w){
        rep(j, y, h)
          c[i][j] = 1;
      }
    }
  }
  s = 0;
  rep(i, w){
    rep(j, h){
      if(c[i][j] == 0)
        s++;
    }
  }
  out(s);
  memi;
}

Compiler output:
a.cc:47:20: error: macro "rep" passed 3 arguments, but takes just 2
   47 |         rep(j, y, h)
      |                    ^
a.cc:4:9: note: macro "rep" defined here
    4 | #define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:36:16: error: 'j' was not declared in this scope
   36 |           c[i][j] = 1;
      |                ^
a.cc:47:9: error: 'rep' was not declared in this scope
   47 |         rep(j, y, h)
      |         ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int W, H, N;
  cin >> W >> H >> N;
  vector<int> x(N), y(N), a(N);
  for (int i= 0; i < N; i++) {
    cin >> x(i) >> y(i) >> a(i);
  }
  
  int x_min = 0, x_max = W;
  int y_min = 0, y_max = H;
  
  for (int i = 0; i < N; i++) {
    if (a.at(i) == 1) {
      if (x.at(i) > x_min) x_min = x.at(i);
    }
    if (a.at(i) == 2) {
      if (x.at(i) < x_max) x_max = x.at(i);
    }
    if (a.at(i) == 3) {
      if (y.at(i) > y_min) y_min = y.at(i);
    }
    if (a.at(i) == 1) {
      if (y.at(i) > y_max) y_max = y.at(i);
    }
  }
  cout << (x_max - x_min) * (y_max - y_min) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: no match for call to '(std::vector<int>) (int&)'
    9 |     cin >> x(i) >> y(i) >> a(i);
      |            ~^~~
a.cc:9:21: error: no match for call to '(std::vector<int>) (int&)'
    9 |     cin >> x(i) >> y(i) >> a(i);
      |                    ~^~~
a.cc:9:29: error: no match for call to '(std::vector<int>) (int&)'
    9 |     cin >> x(i) >> y(i) >> a(i);
      |                            ~^~~
Language: C++

W, H, N = map(int, input().split())
min_H = 0
min_W = 0
max_H = H
max_W = W

for _ in range(N):
    x, y, a = map(int, input().split())

    if a == 1:
        min_W = x
    elif a == 2:
        max_W = x
    elif a == 3:
        min_H = y
    else:
        max_H = y

print((max_H - min_H) * (max_W - min_W))


Compiler output:
a.cc:1:1: error: 'W' does not name a type
    1 | W, H, N = map(int, input().split())
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int W,H,N,a,x,y;
  cin>>W>>H>>N;
  pair<int,int>max=make_pair(W,H),min=make_pair(0,0);
  for(int i=0;i<N;i++){
    cin>>x>>y>>a;
    if(a==1)min.first=max(x,min.first);
    if(a==2)max.first=min(x,max.first);
    if(a==3)min.second=(y,min.second);
    if(a==4)max.second=(y,max.second);
  }
  if(max.first>min.first&&max.second>min.second)cout<<(max.first-min.first)*(max.second-min.second)<<endl;
  else cout<<"0"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: no match for call to '(std::pair<int, int>) (int&, int&)'
    9 |     if(a==1)min.first=max(x,min.first);
      |                       ~~~^~~~~~~~~~~~~
a.cc:10:26: error: no match for call to '(std::pair<int, int>) (int&, int&)'
   10 |     if(a==2)max.first=min(x,max.first);
      |                       ~~~^~~~~~~~~~~~~
Language: C++

                #include <bits/stdc++.h>
                using namespace std;
                typedef long long ll;
                #define INPUT()              freopen("input.txt", "r", stdin)
                #define OUTPUT()             freopen("output.txt", "w", stdout)
                #define F                    first
                #define S                    second
            //Templatefunctions
                template<typename T>T gcd(T x, T y) { if (y == 0)return x; else return gcd(y, x%y);}
                template <class T> T euclideanDistance(T x1 , T x2 , T y1 , T y2){return sqrt(( x1 - x2 ) * ( x1 - x2 ) + ( y1 - y2 ) * ( y1 - y2 ));}
                template <class T> T digitSum(T n){T sum = 0;while(n > 0)sum += n % 10,n /= 10;return sum;}
            //datatypes
                typedef long long int ll;
                typedef unsigned long long int ull;
                typedef long double ld;
            //constants
                const double INF = 1e+9;
                const double INFLL = 1e+18;
                const double EPS = 1e-9;
                const double PI = acos(-1);
                const int knightDir[8][2] = {{-2,-1},{-2,1},{-1,2},{1,2},{2,-1},{2,1},{-1,-2},{1,-2}};
                       //const int dx[]={0,0,0,1,1,1,-1,-1,-1};
                       //const int dy[]={-1,0,1,-1,0,1,-1,0,1};
                const int dx[] = {0 , 1 , 0 , -1};
                const int dy[] = {1 , 0 , -1 , 0};
            //helpers
                //#define MOD         1000000007LL
                #define MAX         1000005
                const ll MOD = 998244353;
                int arr[MAX];
            //Global Variables



                int main()
                {
                        int w , h , n;
                        scanf("%d%d%d",&w,&h,&n);
                        int x0 = 0,xn = w , y0 = 0, yn = h;
                        for(int i = 0 ; i < n ;i++)
                        {
                            int x , y , a;
                            scanf("%d%d%d",&x, &y ,&a);

                            if(a == 1)
                            {
                                if(x0 < x)x0 = x;
                            }else if(a == 2)
                            {
                                if(xn < x)xn = x;
                            }else if(a == 3)
                            {
                                if(y0 < y)y0 = y;
                            }else
                            {
                                if(yn < y)yn = y;
                            }
                        }
                        a = (xn - x0);
                        b = (yn - y0);

                        printf("%d\n",a*b);
                }


Compiler output:
a.cc: In function 'int main()':
a.cc:59:25: error: 'a' was not declared in this scope
   59 |                         a = (xn - x0);
      |                         ^
a.cc:60:25: error: 'b' was not declared in this scope
   60 |                         b = (yn - y0);
      |                         ^
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int w = sc.nextInt();
    int h = sc.nextInt();
    int lx = 0;
    int rx = w;
    int by = 0;
    int uy = h;
    for(int i = 0; i < n; i++) {
      int x = sc.nextInt();
      int y = sc.nextInt();
      int a = sc.nextInt();
      if(a == 1) lx = x;
      if(a == 2) rx = x;
      if(a == 3) by = y;
      if(a == 4) uy = y;  
    }
    System.out.println(Math.max(0, rx - lx) * Math.max(0, uy - by));
  }
}

Compiler output:
Main.java:12: error: cannot find symbol
    for(int i = 0; i < n; i++) {
                       ^
  symbol:   variable n
  location: class Main
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second
 
const int mx=1000010;
const ll mod=1e9+7;

int main(){  
  int w,h,n;
  cin >> w >> h >> n;
  int x1=0, x2=w, y1=0, y2=h;
  rep(i,n){
    int x,y,a; cin>>x>>y>>a;
    if(a==1){ x1=max(x1,x); continue; }
    if(a==2){ x2=min(x2,x); continue; }
    if(a==3){ y1=max(y1,y); continue; }
    if(a==4){ y2=min(y2,y); continue; }
  }
  if
  int ans = (x2-x1)*(y2-y1);
  if(x2-x1<=0 ||y2-y1<=0){ans=0;}
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:3: error: expected '(' before 'int'
   28 |   int ans = (x2-x1)*(y2-y1);
      |   ^~~
      |   (
a.cc:29:27: error: 'ans' was not declared in this scope; did you mean 'abs'?
   29 |   if(x2-x1<=0 ||y2-y1<=0){ans=0;}
      |                           ^~~
      |                           abs
a.cc:30:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   30 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
typedef long long ll;

int main() {
  int w,h,n;
  cin>>w>>h>>n;
  int x,y,a;
  pair<int,int> mi(0, 0), ma(w, h);
  REP(i,n) {
    cin>>x>>y>>a;
    if (a==1) mi.first = max(x, mi.first);
    else if(a==2) ma.first = min(x, ma.first);
    else if(a==3) mi.second = max(y, mi.second);
    else ma.second = min(y, ma.second);
  }

  int ans = max(0,(ma.first - mi.first)) * max(0, ma.second - mi.second));
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:73: error: expected ',' or ';' before ')' token
   19 |   int ans = max(0,(ma.first - mi.first)) * max(0, ma.second - mi.second));
      |                                                                         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
#define REP(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, n) for (ll i = a; i < n; i++)

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    double w,h;
    int n;
    double ow=0,oh=0;
    cin >>w>> h>> n;
    REP(i,n){
        double x,y;
        int a;
        cin >> x >> y >> a;
        if(a==1 && ow<x) ow= x;
        if(a==2 && x<w) w= x;
        if(a==3 && oh<y) oh= y;
        if(a==4 && y<h) h= y;
        // cout << (w-ow)*(h-oh) << endl;
    }
    cout << ((w>ow&&h>oy)?(w-ow)*(h-oh):0) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:23: error: 'oy' was not declared in this scope; did you mean 'oh'?
   26 |     cout << ((w>ow&&h>oy)?(w-ow)*(h-oh):0) << endl;
      |                       ^~
      |                       oh
Language: C++

include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end) for(int i=start;i<=end;i++)
const int INF = 1001001001;
using namespace std;
typedef long long ll;

int main()
{
  int W, H, N;
  int cell[110][110];
  int x[110], y[110], a[110];
  int res=0;
  cin >> W>>H>>N;

  rep(i,N) {
    cin >> x[i] >> y[i] >> a[i];
    x[i];
    y[i];
  }

  rep(i,W){
    rep(j,H){
      cell[i][j]=0;
    }
  }
  rep(i,N){
    if(a[i]==1)
      FOR(j,0,x[i]-1){
        FOR(k,0,H){
          cell[j][k]=1;
        }
      }
    if(a[i]==2)
      FOR(j,x[i],W-1){
        FOR(k,0,H){
          cell[j][k]=1;
        }
      }
    if(a[i]==3)
      FOR(j,0,y[i]-1){
        FOR(k,0,W-1){
          cell[k][j]=1;
        }
      }
    if(a[i]==4)
      FOR(j,y[i],H-1){
        FOR(k,0,W-1){
          cell[k][j]=1;
	}
      }
  }

  rep(i,H){
    rep(j,W){
      //cout << cell[j][i];                                                              
      res+=cell[j][i];
    }
    //cout << endl;                                                                      
  }
  res = H*W-res;
  cout << res << endl;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:14:3: error: 'cin' was not declared in this scope
   14 |   cin >> W>>H>>N;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | include <bits/stdc++.h>
a.cc:62:3: error: 'cout' was not declared in this scope
   62 |   cout << res << endl;
      |   ^~~~
a.cc:62:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:62:18: error: 'endl' was not declared in this scope
   62 |   cout << res << endl;
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | include <bits/stdc++.h>
Language: C++

#include <iostream>
#include <cstring>
#define MOD 1000000007
using namespace std;

int n, h, w, max1=0, max3=0, min2, min4, islem;
pair<int, int> arr[101];

int main(void){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>w>>h>>n;
	min2=w;
	min4=h;
	for(int i=0;i<n;i++)cin>>arr[i].first>>arr[i].second;
	for (int i = 0; i < n; ++i){
		cin>>islem;
		switch(islem){
			case 1:
			max1=max(max1, arr[i].first);
			break;
			case 2:
			min2=min(min2, arr[i].first);
			break;
			case 3:
			max3=max(max3, arr[i].second);
			break;
			case 4:
			min4=min(min4, arr[i].second);
		}
	}
	cout<<(min2-max1)*(min3-max4);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:28: error: 'min3' was not declared in this scope; did you mean 'min4'?
   33 |         cout<<(min2-max1)*(min3-max4);
      |                            ^~~~
      |                            min4
a.cc:33:33: error: 'max4' was not declared in this scope; did you mean 'max3'?
   33 |         cout<<(min2-max1)*(min3-max4);
      |                                 ^~~~
      |                                 max3
Language: C++

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

const int MOD = 1000000007;

const int INF_32 = 1LL << 30;
const int64_t INF_64 = 1LL << 60;

int main()
{
    int W, H, N;
    cin >> W >> H >> N;
    set<int> left;
    set<int> right;
    set<int> lower;
    set<int> upper;

    for (int i = 0; i < N; i++) {
        int x, y, a;
        cin >> x >> y >> a;
        if (a == 1) {
            left.insert(x);
        } else if (a == 2) {
            right.insert(x);
        } else if (a == 3) {
            lower.insert(y);
        } else {
            upper.insert(y);
        }
    }

    int x_min = 0;
    int x_max = W;
    int y_min = 0;
    int y_max = H;
    if (!left.empty()) {
        x_min = *rbegin(left);
    }
    if (!right.empty()) {
        x_max = *begin(right);
    }
    if (!lower.empty()) {
        y_min = *rbegin(lower);
    }
    if (!upper.empty()) {
        y_max = *begin(upper);
    }

    int ans = 0;
  	if(x_max-x-min>=0 && y_max-y_min>0){
       ans = (x_max - x_min) * (y_max - y_min);
    }

    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:18: error: 'x' was not declared in this scope
   52 |         if(x_max-x-min>=0 && y_max-y_min>0){
      |                  ^
Language: C++

#include<iostream>

using namespace std;

int main(){
  int n,w,h,s;
  cin>>n;
  cin>>w;
  cin>>h;
  int x[n],y[n],a[n];
  for(int i=0;i<n;i++){
    cin>>x[i];
    cin>>y[i];
    cin>>a[i];
  }
  int b[4]={0,w,0,h}
  for(int i=0;i<n;i++){
    switch(a[i]){
      case 1:
        if(b[0]<x[i]){
          b[0]=x[i];
        }
        break;
      case 2:
        if(b[1]>x[i]){
          b[0]=x[i];
        }
        break;
      case 3:
        if(b[2]<y[i]){
          b[2]=y[i];
        }
        break;
      case 4:
        if(b[3]>y[i]){
          b[3]=y[i];
        }
        break;
    }
  }
  s=(b[1]-b[0])*(b[3]-b[2]);
  if(s<0){
    s=0;
    }
  cout<<s<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: expected ',' or ';' before 'for'
   17 |   for(int i=0;i<n;i++){
      |   ^~~
a.cc:17:15: error: 'i' was not declared in this scope
   17 |   for(int i=0;i<n;i++){
      |               ^
Language: C++

#include<iostream>

using namespase std;

int main(){
  int n,w,h,s;
  cin>>n;
  cin>>w;
  cin>>h;
  int x[n],y[n],a[n];
  for(int i=0;i<n;i++){
    cin>>x[i];
    cin>>y[i];
    cin>>a[i];
  }
  int b[4]={0,w,0,h}
  for(int i=0;i<n;i++){
    switch(a[i]){
      case 1:
        if(b[0]<x[i]){
          b[0]=x[i];
        }
        break;
      case 2:
        if(b[1]>x[i]){
          b[0]=x[i];
        }
        break;
      case 3:
        if(b[2]<y[i]){
          b[2]=y[i];
        }
        break;
      case 4:
        if(b[3]>y[i]){
          b[3]=y[i];
        }
        break;
    }
  }
  s=(b[1]-b[0])*(b[3]-b[2]);
  if(s<0){
    s=0;
    }
  cout<<s<<endl;
  return 0;
}

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namespase'
    3 | using namespase std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin>>n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:17:3: error: expected ',' or ';' before 'for'
   17 |   for(int i=0;i<n;i++){
      |   ^~~
a.cc:17:15: error: 'i' was not declared in this scope
   17 |   for(int i=0;i<n;i++){
      |               ^
a.cc:45:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   45 |   cout<<s<<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:45:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   45 |   cout<<s<<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)
      |     ^~~~