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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
 
int main(){
  int w,h,n,x,y,a;
  cin>>w>>h>>n;
  int xl=0,xr=w,yl=0,yr=h;
  for(int i=0;i<n;i++){
    cin>>x>>y>>a;
    if(a==1) xl=max(x,xl);
    else if(a==2) xr=min(x,xr);
    else if(a==3) yl=max(y,yl);
    else  yr=min(y,yr);
  }
  if(xl<xr&&yl<yr) cout<<(xr-xl)*(yr-yl)<<endl;
  else cout<<0<<endl;
  return 0;
}

Compiler output:
a.cc:1:1: error: stray '\177' in program
    1 | <U+007F>#include<bits/stdc++.h>
      | ^~~~~~~~
a.cc:1:2: error: stray '#' in program
    1 | #include<bits/stdc++.h>
      |  ^
a.cc:1:3: error: 'include' does not name a type
    1 | #include<bits/stdc++.h>
      |   ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin>>w>>h>>n;
      |   ^~~
a.cc:11:17: error: 'max' was not declared in this scope
   11 |     if(a==1) xl=max(x,xl);
      |                 ^~~
a.cc:12:22: error: 'min' was not declared in this scope; did you mean 'main'?
   12 |     else if(a==2) xr=min(x,xr);
      |                      ^~~
      |                      main
a.cc:13:22: error: 'max' was not declared in this scope
   13 |     else if(a==3) yl=max(y,yl);
      |                      ^~~
a.cc:14:14: error: 'min' was not declared in this scope; did you mean 'main'?
   14 |     else  yr=min(y,yr);
      |              ^~~
      |              main
a.cc:16:20: error: 'cout' was not declared in this scope
   16 |   if(xl<xr&&yl<yr) cout<<(xr-xl)*(yr-yl)<<endl;
      |                    ^~~~
a.cc:16:43: error: 'endl' was not declared in this scope
   16 |   if(xl<xr&&yl<yr) cout<<(xr-xl)*(yr-yl)<<endl;
      |                                           ^~~~
a.cc:17:8: error: 'cout' was not declared in this scope
   17 |   else cout<<0<<endl;
      |        ^~~~
a.cc:17:17: error: 'endl' was not declared in this scope
   17 |   else cout<<0<<endl;
      |                 ^~~~
Language: Java

import java.util.Scanner;

public class Fill {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int y[] = {0, 0};
		int x[] = {0, 0};

		x[1] = sc.nextInt();
		y[1] = sc.nextInt();
		int n = sc.nextInt();

		for(int i = 0;i < n;i++){
			int x2 = sc.nextInt();
			int y2 = sc.nextInt();
			int a = sc.nextInt();

			if(a == 1 && x[0] < x2)x[0] = x2;
			else if(a == 2 && x[1] > x2)x[1] = x2;
			else if(a == 3 && y[0] < y2)y[0] = y2;
			else if(a == 4 && y[1] > y2)y[1] = y2;
		}

		if((x[1]-x[0]) < 0 && (y[1]-y[0]) < 0 )System.out.println(0);
		else System.out.println((x[1]-x[0])*(y[1]-y[0]));

	}
}


Compiler output:
Main.java:3: error: class Fill is public, should be declared in a file named Fill.java
public class Fill {
       ^
1 error
Language: C

#include <iostream>

using namespace std;

typedef struct xyz{
    int x;
    int y;
    int a;
}c;
int main ()
{
    int W,H,N;
    int i,j,k;
    int sum = 0;
    int sum1 = 0;
    int s[100][100] = {0};
    struct xyz c[100] ={0};
    /*
    scanf("%d",&W);    
    scanf("%d",&H);    
    scanf("%d",&N);  
*/
    cin >> W >> H >> N;

    for(i=0;i<N;i++){
        /*
        scanf("%d",&c[i].x);    
        scanf("%d",&c[i].y);    
        scanf("%d",&c[i].a);  
        */
        cin >> c[i].x >> c[i].y >> c[i].a;
    }
    for(i=0;i<N;i++){
        if(c[i].a == 1){
            for(j=1;j<=c[i].x;j++){
                for(k=1;k<=H;k++){
                    s[j][k] = 1;
                }
            }
        }
       if(c[i].a == 2){
            for(j=c[i].x +1;j <= W;j++){
                for(k=1;k<=H;k++){
                    s[j][k] = 1;
                }
            }
        }
        if(c[i].a == 3){
            for(j=1;j<=W;j++){
                for(k=1;k<=c[i].y ;k++){
                    s[j][k] = 1;
                }
            }
        }
        if(c[i].a == 4){
            for(j=1;j<=W;j++){
                for(k=c[i].y +1 ; k <= H; k++){
                    s[j][k] = 1;
                }
            }
        }
    }
    
    for(i=1;i<=W;i++){
        for(j=1;j<=H;j++){
            if(s[i][j] == 0)
                sum1++;
        }
    }
    if(sum1 > 0){
        //printf("%d\n",sum1);
        cout << sum1 << endl;
    }else{
        //puts("0");
        cout << 0 << endl;
    }

    return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>

using namespace std;

typedef struct xyz{
    int x;
    int y;
    int a;
}c;
int main ()
{
    int W,H,N;
    int i,j,k;
    int sum = 0;
    int sum1 = 0;
    int s[100][100] = {0};
    struct xyz c[100] ={0};
    /*
    scanf("%d",&W);    
    scanf("%d",&H);    
    scanf("%d",&N);  
*/
    cin >> W >> H >> N;

    for(i=0;i<N;i++){
        /*
        scanf("%d",&c[i].x);    
        scanf("%d",&c[i].y);    
        scanf("%d",&c[i].a);  
        */
        cin >> c[i].x >> c[i].y >> c[i].a;
    }
    for(i=0;i<N;i++){
        if(c[i].a == 1){
            for(j=1;j<=c[i].x;j++){
                for(k=1;k<=H;k++){
                    s[j][k] = 1;
                }
            }
        }
       if(c[i].a == 2){
            for(j=c[i].x +1;j <= W;j++){
                for(k=1;k<=H;k++){
                    s[j][k] = 1;
                }
            }
        }
        if(c[i].a == 3){
            for(j=1;j<=W;j++){
                for(k=1;k<=c[i].y ;k++){
                    s[j][k] = 1;
                }
            }
        }
        if(c[i].a == 4){
            for(j=1;j<=W;j++){
                for(k=c[i].y +1 ; k <= H; k++){
                    s[j][k] = 1;
                }
            }
        }
    }
    
    for(i=1;i<=W;i++){
        for(j=1;j<=H;j++){
            if(s[i][j] == 0)
                sum1++;
        }
    }
    if(sum1 > 0){
        //printf("%d\n",sum1);
        cout << sum1 << endl;
    }else{
        //puts("0");
        cout << 0 << endl;
    }

    return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<fstream>
#include<string>
#include<cmath>
using namespace std;

int x[100],y[100],a[100]

int main(){
	
	int w, h, n
	int xn,xx,yn,yx,d
	cin>>w>>h>>n;
	
	for(int i=0;i<w;i++){
		cin >> x[i]>>y[i]>>a[i];
	}

	for(int i=0,i<w,i++){
		if(a[i]==1)
			xn = max(xn,x[i]);
		else if(a[i]==2)
			xx = min(xx,x[i]);
	}
	for(int i=0;i<h,i++){
		if(a[i]==3)
			yn = max(yn,y[i]);
		else if(a[i]==4)
			yx = min(yx,y[i]);	
	}
	
	cout << (xx-xn)*(yx-yn);
	
	return 0;
};

Compiler output:
a.cc:9:1: error: expected initializer before 'int'
    9 | int main(){
      | ^~~
Language: C++

#include <iostream>
#include<math.h>
using namespace std;
int w,h,n,a,b,c,x1=0,x2,y=0,y2;
int main() {
	cin>>w>>h>>n;
	x2=w;y2=h;
	for(int i=0;i<n;i++){
		cin>>a>>b>>c;
		if(c==1)x1=max(a,x1);else
		if(c==2)x2=min(a,x2);else
		if(c==3)y=max(b,y);else
		y2=min(b,y2);
	}
	if(x2>x1&&y2>y){
	cout<<x2-x1)*(y2-y)<<endl;
	}else cout<<0<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:20: error: expected ';' before ')' token
   16 |         cout<<x2-x1)*(y2-y)<<endl;
      |                    ^
      |                    ;
Language: C

#include <stdio.h>
int main(void){
    int W, H, N;
    scanf("%d %d %d",&W, &H, &N);
    int x[N], y[N], a[N];
    int i;
    for(i=0;i<N;i++){
        scanf("%d %d %d", &x[i], &y[i], &a[i]);
    }
    int w=0,h=0;
    for(i=0;i<N;i++){
        if(a[i]=1){
            if(x[i]>=w){
                w=x[i];
            }
        }else if(a[i]=2){
            if(x[i]<=W){
                W=x[i];
            }
        }else if(a[i]=3){
            if(y[i]>=h){
                h=y[i];
            }
        }else if(a[i]=4){
            if(y[i]<=H){
                H=y[i];
            }
        }
    }
    int ans=0;
    if(w<W && h<H){
            ans=(W-w)*(H-h);
        }
    }
    printf("%d\n", ans);

    return 0;
}


Compiler output:
main.c:35:12: error: expected declaration specifiers or '...' before string constant
   35 |     printf("%d\n", ans);
      |            ^~~~~~
main.c:35:20: error: unknown type name 'ans'
   35 |     printf("%d\n", ans);
      |                    ^~~
main.c:37:5: error: expected identifier or '(' before 'return'
   37 |     return 0;
      |     ^~~~~~
main.c:38:1: error: expected identifier or '(' before '}' token
   38 | }
      | ^
Language: C

#include <stdio.h>
#include <string.h>
int main(void){
    int W, H, N;
    scanf("%d%d%d",&W, &H, &N);
    char x[N], y[N], a[N];
    for(int i=0;i<N;i++){
        scanf("%s%s%s", &x[i], &y[i], &a[i]);
    }
    int w=0,h=0;
    for(i=0;i<N;i++){
        if(a[i]=1){
            if(x[i]>w){
                w=x[i];
            }
        }else if(a[i]=2){
            if(x[i]<W){
                W=x[i];
            }
        }else if(a[i]=3){
            if(y[i]>h){
                h=y[i];
            }
        }else if(a[i]=4){
            if(y[i]<H){
                H=y[i];
            }
        }
    }
    int ans=0;
    if(w<W){
        if(h<H){
            ans=(W-w)*(H-h);
        }
    }
    printf("%d", ans);

    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:9: error: 'i' undeclared (first use in this function)
   11 |     for(i=0;i<N;i++){
      |         ^
main.c:11:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define pi acos(-1.0)
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int main(){
	int w, h, n;
	cin >> w >> h >> n;
	int l = 0, r = w, b = 0, t = h;
	REP(i,n){
		int x, y, a;
		cin >> x >> y >> a;
		if (a == 1) l = max(l,x);
		else if (a == 2) r = min(r,x);
		else if (a == 3) b = max(b,y);
		else t = min(t,y);
	}

	ans = (r-l)*(t-b);

	if (l > r || b > t) ans = 0;

	cout << ans << endl;
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   40 |         ans = (r-l)*(t-b);
      |         ^~~
      |         abs
Language: C++



#include<iostream>
#include<algorithm>
#include<vector>

#include<typeinfo>
#include<type_traits>
#include<exception>


using sll = size_t;//signed long long;
struct zxc{
	sll x, y;
	size_t a;
	zxc(sll x_ = 0, sll y_ = 0, size_t a_ = 0) :x(x_), y(y_), a(a_) {}
};
int main() {

//	std::cout << "size_t:" << typeid(size_t).name() << "\n";
//	std::cout << "sll:" << typeid(sll).name() << "\n";
//	std::cout <<"decltype(size_t-size_t):"<< typeid(decltype(std::declval<size_t>() - std::declval<size_t>())).name() << "\n";

	sll W, H;
	size_t N;
	std::cin >> W >> H >> N;
	//std::vector<zxc> vc;
	//vc.resize(N);
	sll x1{0}, y1{ 0 }, x2{ W }, y2{ H };

	for (size_t i{ 0 }; i < N; i++) {
		zxc z;
		std::cin >> z.x >> z.y >> z.a;
		if (z.a == 1) {
			x1 = std::max(x1, z.x);
		}
		if (z.a == 2) {
			x2 = std::min(x2, z.x);
		}
		if (z.a == 3) {
			y1 = std::max(y1, z.y);
		}
		if (z.a == 4) {
			y2 = std::min(y2, z.y);
		}
	}

	
	sll result = 0;

	if (( (x2 - x1) > 0) && ( (y2 - y1) > 0)) {
		result = (x2 - x1)*(y2 - y1);
		if (result > 100 * 100) {
			throw(std::exception("DIE"));
		}
	}

	if (result <= 0) {
		std::cout << 0 << "\n";
	}
	else {
		std::cout <<result << "\n";
	}
	
	return 0;
}

/*
5 4 0
2 1 1
3 3 4



10 10 5
1 6 1
4 1 3
6 9 4
9 4 2
3 1 3
*/

Compiler output:
a.cc: In function 'int main()':
a.cc:54:51: error: no matching function for call to 'std::exception::exception(const char [4])'
   54 |                         throw(std::exception("DIE"));
      |                                                   ^
In file included from /usr/include/c++/14/exception:36,
                 from /usr/include/c++/14/ios:41,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:3:
/usr/include/c++/14/bits/exception.h:67:5: note: candidate: 'constexpr std::exception::exception(std::exception&&)'
   67 |     exception(exception&&) = default;
      |     ^~~~~~~~~
/usr/include/c++/14/bits/exception.h:67:15: note:   no known conversion for argument 1 from 'const char [4]' to 'std::exception&&'
   67 |     exception(exception&&) = default;
      |               ^~~~~~~~~~~
/usr/include/c++/14/bits/exception.h:65:5: note: candidate: 'constexpr std::exception::exception(const std::exception&)'
   65 |     exception(const exception&) = default;
      |     ^~~~~~~~~
/usr/include/c++/14/bits/exception.h:65:15: note:   no known conversion for argument 1 from 'const char [4]' to 'const std::exception&'
   65 |     exception(const exception&) = default;
      |               ^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/exception.h:62:5: note: candidate: 'std::exception::exception()'
   62 |     exception() _GLIBCXX_NOTHROW { }
      |     ^~~~~~~~~
/usr/include/c++/14/bits/exception.h:62:5: note:   candidate expects 0 arguments, 1 provided
Language: C++



#include<iostream>
#include<algorithm>
#include<vector>

#include<typeinfo>
#include<type_traits>

using sll = size_t;//signed long long;
struct zxc{
	sll x, y;
	size_t a;
	zxc(sll x_ = 0, sll y_ = 0, size_t a_ = 0) :x(x_), y(y_), a(a_) {}
};
int main() {

	std::cout << "size_t:" << typeid(size_t).name() << "\n";
	std::cout << "sll:" << typeid(sll).name() << "\n";
	std::cout <<"decltype(size_t-size_t):"<< typeid(decltype(std::declval<size_t>() - std::declval<size_t>())).name() << "\n";

	sll W, H;
	size_t N;
	std::cin >> W >> H >> N;
	//std::vector<zxc> vc;
	//vc.resize(N);
	sll x1{0}, y1{ 0 }, x2{ W }, y2{ H };

	for (size_t i{ 0 }; i < N; i++) {
		zxc z;
		std::cin >> z.x >> z.y >> z.a;
		if (z.a == 1) {
			x1 = std::max(x1, z.x);
		}
		if (z.a == 2) {
			x2 = std::min(x2, z.x);
		}
		if (z.a == 3) {
			y1 = std::max(y1, z.y);
		}
		if (z.a == 4) {
			y2 = std::min(y2, z.y);
		}
	}

	
	sll result = 0;

	if (( (x2 - x1) > 0) && ( (y2 - y1) > 0)) {
		result = (x2 - x1)*(y2 - y1);
		if (result > 100 * 100) {
			throw(std::exception("DIE"));
		}
	}

	if (result <= 0) {
		std::cout << 0 << "\n";
	}
	else {
		std::cout <<result << "\n";
	}
	
	return 0;
}

/*
5 4 0
2 1 1
3 3 4



10 10 5
1 6 1
4 1 3
6 9 4
9 4 2
3 1 3
*/

Compiler output:
a.cc: In function 'int main()':
a.cc:52:51: error: no matching function for call to 'std::exception::exception(const char [4])'
   52 |                         throw(std::exception("DIE"));
      |                                                   ^
In file included from /usr/include/c++/14/exception:36,
                 from /usr/include/c++/14/ios:41,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:3:
/usr/include/c++/14/bits/exception.h:67:5: note: candidate: 'constexpr std::exception::exception(std::exception&&)'
   67 |     exception(exception&&) = default;
      |     ^~~~~~~~~
/usr/include/c++/14/bits/exception.h:67:15: note:   no known conversion for argument 1 from 'const char [4]' to 'std::exception&&'
   67 |     exception(exception&&) = default;
      |               ^~~~~~~~~~~
/usr/include/c++/14/bits/exception.h:65:5: note: candidate: 'constexpr std::exception::exception(const std::exception&)'
   65 |     exception(const exception&) = default;
      |     ^~~~~~~~~
/usr/include/c++/14/bits/exception.h:65:15: note:   no known conversion for argument 1 from 'const char [4]' to 'const std::exception&'
   65 |     exception(const exception&) = default;
      |               ^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/exception.h:62:5: note: candidate: 'std::exception::exception()'
   62 |     exception() _GLIBCXX_NOTHROW { }
      |     ^~~~~~~~~
/usr/include/c++/14/bits/exception.h:62:5: note:   candidate expects 0 arguments, 1 provided
Language: C++

#include <stdio.h>

int main(){
int w, h, n;
int x[101], y[101], a[101];
int xmin, xmax, ymin, ymax;
scanf("%d %d %d", &w, &h, &n);
for(int i=1; i<n+1, i++){
	scanf("%d %d %d", &x[i], &y[i], &a[i]);
}
xmin =0;
ymin=0;
xmax=w;
ymax=h;

for(i=1; i<n+1; i++){
	switch(a[i]){
		case 1:
		xmin = x[i];
		break;
		case 2:
		xmax = x[i];
		break;
		case 3:
		ymin = y[i];
		break;
		case 4:
		ymax = y[i];
	}
}

printf("%d\n", (xmax-xmin)*(ymax-ymin));
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: expected ';' before ')' token
    8 | for(int i=1; i<n+1, i++){
      |                        ^
      |                        ;
a.cc:16:5: error: 'i' was not declared in this scope
   16 | for(i=1; i<n+1; i++){
      |     ^
Language: C++

#include <stdio.h>

int main(){
int w, h, n;
int x[101], y[101], a[101];
int xmin, xmax, ymin, ymax;
scanf("%d %d %d", &w, &h, &n);
for(int i=1; i<n+1, i++){
	scanf("%d %d %d", &x[i], &y[i], &a[i]);
}
xmin =0;
ymin=0;
xmax=w;
ymax=h;

for(i=1; i<n+1, i++){
	switch(a[i]){
		case 1:
		xmin = x[i];
		break;
		case 2:
		xmax = x[i];
		break;
		case 3:
		ymin = y[i];
		break;
		case 4:
		ymax = y[i];
	}
}

printf("%d\n", (xmax-xmin)*(ymax-ymin));
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: expected ';' before ')' token
    8 | for(int i=1; i<n+1, i++){
      |                        ^
      |                        ;
a.cc:16:5: error: 'i' was not declared in this scope
   16 | for(i=1; i<n+1, i++){
      |     ^
a.cc:16:20: error: expected ';' before ')' token
   16 | for(i=1; i<n+1, i++){
      |                    ^
      |                    ;
Language: C++

#include <stdio.h>

int main(){
int w, h, n;
int x[101], y[101], a[101];
int xmin, xmax, ymin, ymax;
scanf("%d %d %d", &w, &h, &n);
for(int i=1; i<n+1, i++){
	scanf("%d %d %d", &x[i], &y[i], &a[i]);
}
xmin =0;
ymin=0;
xmax=w;
ymax=h;

for(int i=1; i<n+1, i++){
	switch(a[i]){
		case 1:
		xmin = x[i];
		break;
		case 2:
		xmax = x[i];
		break;
		case 3:
		ymin = y[i];
		break;
		case 4:
		ymax = y[i];
	}
}

printf("%d\n", (xmax-xmin)*(ymax-ymin));
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: expected ';' before ')' token
    8 | for(int i=1; i<n+1, i++){
      |                        ^
      |                        ;
a.cc:16:24: error: expected ';' before ')' token
   16 | for(int i=1; i<n+1, i++){
      |                        ^
      |                        ;
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 N = sc.nextInt();
		int[] x = new int[N];
		int[] y = new int[N];
		int[] a = new int[N];

		int xmin = 0;
		int xmax = W;
		int ymin = 0;
		int ymax = H;
		for (int i = 0; i < N; ++i) {
			x[i] = sc.nextInt();
			y[i] = sc.nextInt();
			a[i] = sc.nextInt();
			if (a[i] == 1) {
				xmin = Math.max(xmin, x[i]);
			} else if (a[i] == 2) {
				xmax = Math.min(xmax, x[i]);
			} else if (a[i] == 3) {
				ymin = Math.max(ymin, y[i]);
			} else if (a[i] == 4) {
				ymax = Math.min(ymax, y[i]);
			}
		}
		if (xmax > xmin && ymax > ymin)
			System.out.println((xmax - xmin) * (ymax - ymin));
		else {
			System.out.println(0);
		}
	}
}


Compiler output:
Main.java:3: error: '{' expected
public class Main
                 ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
	public static void main(String[] args) {
	              ^
  (use --enable-preview to enable unnamed classes)
Main.java:37: error: class, interface, enum, or record expected
}
^
3 errors
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    int W, H, N;
    cin >> W >> H >> N;
    int point[N][3];
    for (int i = 0; i < N; i++){
        for (int j = 0; j < 3; j++) {
            cin >> point[i][j];
        }
    }

    int dl[2] = {0, 0};
    int ur[2] = {W, H};

    for (int i = 0; i < N; i++) {
        switch (point[i][2]) {
            case 1:
                dl[0] = max(dl[0],point[i][0]);
                break;
            case 2:
                ur[0] = min(ur[0],point[i][0]);
                break;
            case 3:
                dl[1] = max(mh[1], point[i][1]);
                break;
            case 4:
                ur[1] = min(ur[1], point[i][1]);
                break;
        }
    }

    if ((ur[0] - dl[0]) * (ur[1] - dl[1]) > 0) { 
        cout << (ur[0] - dl[0]) * (ur[1] - dl[1]) << endl;
    } else {
        cout << 0 << endl;
    }
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:29: error: 'mh' was not declared in this scope
   27 |                 dl[1] = max(mh[1], point[i][1]);
      |                             ^~
Language: C++

#include <iostream>
using namespace std;
int main()
{
    int W, H, N;
    cin >> W >> H >> N;
    int point[N][3];
    for (int i = 0; i < N; i++){
        for (int j = 0; j < 3; j++) {
            cin >> point[i][j];
        }
    }

    int dl[2] = {0, 0};
    int ur[2] = {W, H};

    for (int i = 0; i < N; i++) {
        switch (point[i][2]) {
            case 1:
                dl[0] = max(dl[0],point[i][0]);
                break;
            case 2:
                ur[0] = min(ur[0],point[i][0]);
                break;
            case 3:
                dl[1] = max(mh[1], point[i][1]);
                break;
            case 4:
                ur[1] = min(ur[1], point[i][1]);
                break;
        }
    }

    if ((ur[0] - dl[0]) * (ur[1] - dl[1]) > 0) { 
        cout << (ur[0] - dl[0]) * (ur[1] - dl[1]) << endl;
    } else {
        cout << 0 << endl;
    }
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:29: error: 'mh' was not declared in this scope
   26 |                 dl[1] = max(mh[1], point[i][1]);
      |                             ^~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int xy[101][101],W,H,N;

int main(){
  scanf("%d %d %d",&W,&H,&N);

  int x,y,a;

  for(int i=0;i<N;i++){
    scanf("%d %d %d",&x,&y,&a);
    switch (a) {
      case 1:for(int j=0;j<x;j++){
        for(int k=0;k<H;k++){
          xy[j][k]=1;
        }
      }
      break;
      case 2:for(int j=x;j<W;j++){
        for(int k=0;k<H;k++){
          xy[j][k]=1;
        }
      }
      break;
      case 3:for(int j=0;j<y;j++){
        for(int k=0;k<W;k++){
          xy[k][j]=1;
        }
      }
      break;
      case 4:for(int j=y;j<H;j++){
        for(int k=0;k<W;k++){
          xy[k][j]=1;
        }
      }
      break;
      default: break;
    }
  }

  for(int i=0;i<H;i++){
    int cnt=0;
    for(int j=0;j<W;j++){
      if(xy[j][i]==0) cnt++;
    }
    maxW=max(cnt,maxW);

  }

  for(int i=0;i<W;i++){
    int cnt=0;
    for(int j=0;j<H;j++){
      if(xy[i][j]==0) cnt++;
    }
    maxH=max(cnt,maxH);

  }

  int S=(maxH)*(maxW);

  //check_s
  //printf("%d %d\n",maxH,maxW);
  //check_e

  printf("%d",S);

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:5: error: 'maxW' was not declared in this scope
   48 |     maxW=max(cnt,maxW);
      |     ^~~~
a.cc:57:5: error: 'maxH' was not declared in this scope
   57 |     maxH=max(cnt,maxH);
      |     ^~~~
a.cc:61:10: error: 'maxH' was not declared in this scope
   61 |   int S=(maxH)*(maxW);
      |          ^~~~
a.cc:61:17: error: 'maxW' was not declared in this scope
   61 |   int S=(maxH)*(maxW);
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int xy[101][101],W,H,N;

int main(){
  scanf("%d %d %d",&W,&H,&N);

  int x,y,a;

  for(int i=0;i<N;i++){
    scanf("%d %d %d",&x,&y,&a);
    switch (a) {
      case 1:for(int j=0;j<x;j++){
        for(int k=0;k<H;k++){
          xy[j][k]=1;
        }
      }
      break;
      case 2:for(int j=x;j<W;j++){
        for(int k=0;k<H;k++){
          xy[j][k]=1;
        }
      }
      break;
      case 3:for(int j=0;j<y;j++){
        for(int k=0;k<W;k++){
          xy[k][j]=1;
        }
      }
      break;
      case 4:for(int j=y;j<H;j++){
        for(int k=0;k<W;k++){
          xy[k][j]=1;
        }
      }
      break;
      default: break;
    }
  }

  for(int i=0;i<H;i++){

    for(int j=0;j<W;j++){
      if(xy[j][i]==0) cnt++;
    }
    maxW=max(cnt,maxW);

  }

  for(int i=0;i<W;i++){

    for(int j=0;j<H;j++){
      if(xy[i][j]==0) cnt++;
    }
    maxH=max(cnt,maxH);

  }

  int S=(maxH)*(maxW);

  //check_s
  //printf("%d %d\n",maxH,maxW);
  //check_e

  printf("%d",S);

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:23: error: 'cnt' was not declared in this scope; did you mean 'int'?
   46 |       if(xy[j][i]==0) cnt++;
      |                       ^~~
      |                       int
a.cc:48:5: error: 'maxW' was not declared in this scope
   48 |     maxW=max(cnt,maxW);
      |     ^~~~
a.cc:48:14: error: 'cnt' was not declared in this scope; did you mean 'int'?
   48 |     maxW=max(cnt,maxW);
      |              ^~~
      |              int
a.cc:55:23: error: 'cnt' was not declared in this scope; did you mean 'int'?
   55 |       if(xy[i][j]==0) cnt++;
      |                       ^~~
      |                       int
a.cc:57:5: error: 'maxH' was not declared in this scope
   57 |     maxH=max(cnt,maxH);
      |     ^~~~
a.cc:57:14: error: 'cnt' was not declared in this scope; did you mean 'int'?
   57 |     maxH=max(cnt,maxH);
      |              ^~~
      |              int
a.cc:61:10: error: 'maxH' was not declared in this scope
   61 |   int S=(maxH)*(maxW);
      |          ^~~~
a.cc:61:17: error: 'maxW' was not declared in this scope
   61 |   int S=(maxH)*(maxW);
      |                 ^~~~
Language: C++

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

struct Corner{
    double x,y;
};

const int MAX_N=100;
double x[MAX_N+1],y[MAX_N+1],a[MAX_N+1];

int main(){
    double w,h;
    int n;
    double wide,height;

    cin>>w>>h>>n;

    Corner co[2][2];
    co[0][0].x=0; co[0][0].y=0;
    co[0][1].x=0; co[0][1].y=h;
    co[1][1].x=w; co[1][1].y=h;
    co[1][0].x=w; co[1][0].y=0;

    for(int i=0; i<n; i++){
        cin>>x[i]>>y[i]>>a[i];
        if(a[i]==1){
            co[0][0].x=x[i];
            co[0][1].x=x[i];
        }
        if(a[i]==2){
            co[1][1].x=x[i];
            co[1][0].x=x[i];
        }
        if(a[i]==3){
            co[0][0].y=y[i];
            co[1][0].y=y[i];
        }
        if(a[i]==4){
            co[1][1].y=y[i];
            co[0][1].y=y[i];
        }

    }

    wide=co[1][0].x-co[0][0].x;
    height=co[0][1].y-co[0][0].y;
    if(wide=<0||height=<0){
        cout<<0<<endl;
    }else{
        cout<<wide*height<<endl;
    }

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:47:13: error: expected primary-expression before '<' token
   47 |     if(wide=<0||height=<0){
      |             ^
a.cc:47:24: error: expected primary-expression before '<' token
   47 |     if(wide=<0||height=<0){
      |                        ^
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class B {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int W = Integer.parseInt(scan.next());
        int H = Integer.parseInt(scan.next());
        int N = Integer.parseInt(scan.next());

        int[] xs = new int[N];
        int[] ys = new int[N];
        int[] as = new int[N];


        for(int n=0;n<N;n++){
            xs[n] = Integer.parseInt(scan.next());
            ys[n] = Integer.parseInt(scan.next());
            as[n] = Integer.parseInt(scan.next());
        }

        scan.close();

        int[] impoint = new int[4];

        impoint[0] = 0;
        impoint[1] = W;
        impoint[2] = 0;
        impoint[3] = H;

        for(int i=0;i<N;i++){
            switch (as[i]){
                case 1: //left
                    if(xs[i] > impoint[0]){
                        impoint[0] = xs[i];
                    }
                    break;
                case 2://right
                    if(xs[i] < impoint[1]){
                        impoint[1] = xs[i];
                    }
                    break;
                case 3://down
                    if(ys[i] > impoint[2]){
                        impoint[2] = ys[i];
                    }
                    break;
                case 4://up
                    if(ys[i] < impoint[3]){
                        impoint[3] = ys[i];
                    }
                    break;
            }
        }
        System.out.println(Math.max((impoint[1] - impoint[0]) * (impoint[3] - impoint[2]),0));

    }
}


Compiler output:
Main.java:4: error: class B is public, should be declared in a file named B.java
public class B {
       ^
1 error
Language: C++

#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <functional>
#include <algorithm>
#include <complex>
#include <map>
#include <cmath>
#include <string>
#include <cstdio>
#include <stdio.h>
#include <cstdlib>
#include <istream>

using namespace std;

//--------------------------------------------------------------//

int w, h, n, x[100], y[100], a[100],b,c,d,q,e;
int s3,s4;

stack<int> s1;
stack<int> s2;
int main() {
	cin >> w >> h >> n;
	for (int i = 0; i < n; i++) {
		cin >> x[i] >> y[i] >> a[i];
	}
	for (int j = 0; j < n; j++) {
		b = a[j];
		q = x[j];
		e = y[j];
		if (b == 1 && q < w) {
			c = w - q;
			s1.push(c);
		}
		else if (b == 2 && q < w) {
			c = q;
			s1.push(c);
		}
		else if (b == 3 && e < h) {
			d = h - e;
			s2.push(d);
		}
		else if (b == 4 && e < h) {
			d = e;
			s2.push(d);
		}
		else {
			cout << 0 << endl;
			return 0;
		}
	}
	if (s1.size > 1) {
		for (int i = 0; i < s1.size; i++) {
			s3 = s1.top(); s1.pop();
			s4 = s1.top(); s1.pop();
			s1.push(min(s3, s4));
		}
	}
		if(s2.size > 1) {
			for (int j = 0; j < s2.size; j++) {
				s3 = s2.top(); s2.pop();
				s4 = s2.top(); s2.pop();
				s2.push(min(s3, s4));
			}
			}
		s3 = s1.top();
		s4 = s2.top();
		cout << s3*s4 << endl;

	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:16: error: invalid use of member function 'std::stack<_Tp, _Sequence>::size_type std::stack<_Tp, _Sequence>::size() const [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; size_type = long unsigned int]' (did you forget the '()' ?)
   56 |         if (s1.size > 1) {
      |             ~~~^~~~
      |                    ()
a.cc:57:40: error: invalid use of member function 'std::stack<_Tp, _Sequence>::size_type std::stack<_Tp, _Sequence>::size() const [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; size_type = long unsigned int]' (did you forget the '()' ?)
   57 |                 for (int i = 0; i < s1.size; i++) {
      |                                     ~~~^~~~
      |                                            ()
a.cc:63:23: error: invalid use of member function 'std::stack<_Tp, _Sequence>::size_type std::stack<_Tp, _Sequence>::size() const [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; size_type = long unsigned int]' (did you forget the '()' ?)
   63 |                 if(s2.size > 1) {
      |                    ~~~^~~~
      |                           ()
a.cc:64:48: error: invalid use of member function 'std::stack<_Tp, _Sequence>::size_type std::stack<_Tp, _Sequence>::size() const [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >; size_type = long unsigned int]' (did you forget the '()' ?)
   64 |                         for (int j = 0; j < s2.size; j++) {
      |                                             ~~~^~~~
      |                                                    ()
Language: C++

#include <iostream>
#include <vector>
using namespace std;

int main(int argc, char const* argv[]){
    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 xi=0,xj=w,yi=0,yj=h;
    for (int i = 0; i < n; i++) {
        if(a[i] == 1){
            xi = x[i];
        }else if (a[i] == 2) {
            xj = x[i];
        }else if (a[i] == 3){
            yi = y[i];
        }else if (a[i] == 4){
            yj = y[i];
        }
    }
    if(xj<xi || yj<yi || w < xj-xi || h < yj-ji)cout<<"0"<<endl;
    else cout << (xj-xi) * (yj-yi) << endl;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:24:46: error: 'ji' was not declared in this scope; did you mean 'yi'?
   24 |     if(xj<xi || yj<yi || w < xj-xi || h < yj-ji)cout<<"0"<<endl;
      |                                              ^~
      |                                              yi
Language: C

#include <iostream>
#include <cmath>
#include <cstdio>
#include <vector>
#include <string>

using namespace std;

int main() {
    long long width, height, N;
    //int width_a = 0, height_a = 0;

    long long uplimit;
    long long lowlimit = 0;
    long long rightlimit;
    long long leftlimit = 0;
    long long S;

    long long x[101], y[101], a[101];

    cin >> width >> height >> N;

    uplimit = height;
    rightlimit = width;

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

    for (int i = 0; i < N; i++)
    {
        if (a[i]==1 && leftlimit < x[i])
        {
            leftlimit = x[i];
        }
        else if (a[i] == 2 && rightlimit > x[i])
        {
            rightlimit = x[i];
        }
        else if (a[i] == 3 && lowlimit < y[i])
        {
            lowlimit = y[i];
        }
        else if (a[i] == 4 && uplimit > y[i])
        {
            uplimit = y[i];
        }
    }

    if ((uplimit - lowlimit)*(rightlimit - leftlimit) <= 0 ||uplimit<0||lowlimit>height||rightlimit<0||leftlimit>width )
    {
        S = 0;
    }
    else
    {
        S = (uplimit - lowlimit)*(rightlimit - leftlimit);
    }

    cout << S << endl;

    return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>


int main(){

	int W,H,N;

	scanf("%d %d %d",&W,&H,&N);

	int x[N],y[N],a[N],i;

	for(i=0;i<N;i++){
		scanf("%d %d %d",&x[i],&y[i],&a[i]);
	}

	int xl=0,xr=W,yu=H,yl=0;

	for(i=0;i<N;i++){
		if(a[i]==1)
			if(xl<x[i])
				xl=x[i];
		if(a[i]==2)
			if(xr>x[i])
				xr=x[i];
		if(a[i]==3)
			if(yl<y[i])
				yl=y[i];
		if(a[i]==4)
			if(yu>y[i])
				yu=y[i];
	}

	int sum=(xr-xl)*(yu-yl);
	if((xr-xl)>0&(yr-yl)>0)
		printf("%d\n",sum);
	else
		printf("0\n");



	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:34:23: error: 'yr' undeclared (first use in this function); did you mean 'yl'?
   34 |         if((xr-xl)>0&(yr-yl)>0)
      |                       ^~
      |                       yl
main.c:34:23: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

import java.util.Scanner;

public class MissionB {

	public static void main(String[] args) {
		
		//変数//
		int W;		//右上頂点x座標
		int H;		//右上頂点y座標
		int N;		//長方形内の点の個数
		int minwx;	//白い部分のx座標始まり
		int maxwx;	//白い部分のx座標終わり
		int minwy;	//白い部分のy座標始まり
		int maxwy;	//白い部分のy座標終わり
		int warea;	//白い部分の面積
		
		int[] x;	//点のｘ座標
		int[] y;	//点のy座標
		int[] a;	//指定範囲ルールナンバー
		
		Scanner scan = new Scanner(System.in);
		
		//入力//
		W = scan.nextInt();
		H = scan.nextInt();
		N = scan.nextInt();
		
		x = new int[N];
		y = new int[N];
		a = new int[N];
		
		for(int i = 0; i < N; i++){
			x[i] = scan.nextInt();
			y[i] = scan.nextInt();
			a[i] = scan.nextInt();
		}
		
		scan.close();
		
		//処理//
		//初期処理
		minwx = 0;
		maxwx = W;
		minwy = 0;
		maxwy = H;
		
		//ルールナンバーごとに処理
		for(int j = 0; j < N; j++){
			if( a[j] == 1 && minwx < x[j] ){
				minwx = x[j];
			}else if( a[j] == 2 && maxwx > x[j] ){
				maxwx = x[j];
			}else if( a[j] == 3 && minwy < y[j] ){
				minwy = y[j];
			}else if( a[j] == 4 && maxwy > y[j] ){
				maxwy = y[j];
			}
		}
		
		//白い部分が残っているかどうか判定
		if( minwx >= maxwx || minwy >= maxwy ){
			warea = 0;
		}else{
			warea = (maxwx - minwx) * (maxwy - minwy);
		}
		
		//結果//
		System.out.println(warea);

	}

}


Compiler output:
Main.java:3: error: class MissionB is public, should be declared in a file named MissionB.java
public class MissionB {
       ^
1 error
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 n = sc.nextInt();
		// 文字列の入力
		int x[] = new int[n];
		int y[] = new int[n];
		int a[] = new int[n];
		int maxx = w;
		int maxy = h;
		int minx = 0;
		int miny = 0;
		for(int i=0; i++; i<n){
			x[i] = sc.nextInt();
			y[i] = sc.nextInt();
			a[i] = sc.nextInt();
			switch (a[i]){
				case 1:
					if(minx > x[i]){
						minx = x[i];
					}
					break;
				case 2:
				if(maxx < x[i]){
					maxx = x[i];
				}
				break;
				case 3:
				if(miny > y[i]){
					miny = y[i];
				}
				break;
				case 4:
				if(maxy < y[i]){
					maxy = y[i];
				}
				break;
		}
	}
	int answer = (maxx - minx) * (maxy - miny);
		System.out.println(answer);
}
}

Compiler output:
Main.java:18: error: not a statement
		for(int i=0; i++; i<n){
		                   ^
1 error
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 n = sc.nextInt();
		// 文字列の入力
		int x[] = new int[n];
		int y[] = new int[n];
		int a[] = new int[n];
		int maxx = w;
		int maxy = h;
		int minx = 0;
		int miny = 0;
		for(int i=0; i++ i<n){
			x[i] = sc.nextInt();
			y[i] = sc.nextInt();
			a[i] = sc.nextInt();
			switch (a[i]){
				case 1:
					if(minx > x[i]){
						minx = x[i];
					}
					break;
				case 2:
				if(maxx < x[i]){
					maxx = x[i];
				}
				break;
				case 3:
				if(miny > y[i]){
					miny = y[i];
				}
				break;
				case 4:
				if(maxy < y[i]){
					maxy = y[i];
				}
				break;
		}
	}
	int answer = (maxx - minx) * (maxy - miny);
		System.out.println(answer);
}
}

Compiler output:
Main.java:18: error: ';' expected
		for(int i=0; i++ i<n){
		                ^
Main.java:18: error: not a statement
		for(int i=0; i++ i<n){
		                  ^
2 errors
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	int W, H, N;
	cin >> W >> H >> N;
	vector<vector<int>> b(H, vector<int>(W, 0));

	for (int i = 0; i < N; ++i) {
		int x, y, a;
		cin >> x >> y >> a;
		int x1 = 0;
		int y1 = 0;
		int x2 = W;
		int y2 = H;
		if (a == 1) {
			x2 = x;
		}
		else if (a == 2) {
			x1 = x;
		}
		else if (a == 3) {
			y2 = y;
		}
		else if (a == 4) {
			y1 = y;
		}
		else {
			throw std::exception("oops!");
		}
		for (int i = y1; i < y2; ++i) {
			for (int j = x1; j < x2; ++j) {
				b[i][j] = 1;
			}
		}
	}
	int ans = 0;
	for (auto &row : b) {
		ans += count(row.begin(), row.end(), 0);
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:53: error: no matching function for call to 'std::exception::exception(const char [6])'
   33 |                         throw std::exception("oops!");
      |                                                     ^
In file included from /usr/include/c++/14/exception:36,
                 from /usr/include/c++/14/ios:41,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/exception.h:67:5: note: candidate: 'constexpr std::exception::exception(std::exception&&)'
   67 |     exception(exception&&) = default;
      |     ^~~~~~~~~
/usr/include/c++/14/bits/exception.h:67:15: note:   no known conversion for argument 1 from 'const char [6]' to 'std::exception&&'
   67 |     exception(exception&&) = default;
      |               ^~~~~~~~~~~
/usr/include/c++/14/bits/exception.h:65:5: note: candidate: 'constexpr std::exception::exception(const std::exception&)'
   65 |     exception(const exception&) = default;
      |     ^~~~~~~~~
/usr/include/c++/14/bits/exception.h:65:15: note:   no known conversion for argument 1 from 'const char [6]' to 'const std::exception&'
   65 |     exception(const exception&) = default;
      |               ^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/exception.h:62:5: note: candidate: 'std::exception::exception()'
   62 |     exception() _GLIBCXX_NOTHROW { }
      |     ^~~~~~~~~
/usr/include/c++/14/bits/exception.h:62:5: note:   candidate expects 0 arguments, 1 provided
Language: C++

#incldue<bits/stdc++.h>
using namespace std;
int main()
{
string s;
  cin >> s;
int ans=0;
  for(int i=0;i<s.size()-1;++i)
  {
  if(s.at(i)!=s.at(i+1)) ans++;
  }
  cout << ans;
return 0;}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incldue; did you mean #include?
    1 | #incldue<bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:1: error: 'string' was not declared in this scope
    5 | string s;
      | ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | #incldue<bits/stdc++.h>
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> s;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #incldue<bits/stdc++.h>
a.cc:6:10: error: 's' was not declared in this scope
    6 |   cin >> s;
      |          ^
a.cc:12:3: error: 'cout' was not declared in this scope
   12 |   cout << ans;
      |   ^~~~
a.cc:12:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: Java

mport java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            String S = in.next();

            StringBuilder WB = new StringBuilder();
            WB.append(S.charAt(0));
            for (int i = 1; i < S.length(); i++) {
                if (S.charAt(i) == S.charAt(i - 1)) {
                    continue;
                } else {
                    WB.append(S.charAt(i));
                }
            }

            System.out.println(WB.length() - 1);
        }
    }
}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
Language: C++

using namespace std;
typedef long long ll;
#define rep(k,i,n) for(ll i=k;i<n;++i)
int main(void){
    string s;
    cin>>s;
    ll n=s.length();
    ll ans=0;
    rep(1,i,n)if(s[i]!=s[i-1])++ans;
    cout<<ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'string' was not declared in this scope
    5 |     string s;
      |     ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin>>s;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:6:10: error: 's' was not declared in this scope
    6 |     cin>>s;
      |          ^
a.cc:10:5: error: 'cout' was not declared in this scope
   10 |     cout<<ans;
      |     ^~~~
a.cc:10:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
 
int main() {
  //input
  string s; cin >> s;
  int n;
  n = s.size();
  int counter = 0;
  
  //compute
  for(int i = 0;i < n; i++) {
         if(s.at[i] == s.at[i+1]){
           counter += 1;
         }
  }

  //output
  cout << counter << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   16 |          if(s.at[i] == s.at[i+1]){
      |                 ^
a.cc:16:28: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   16 |          if(s.at[i] == s.at[i+1]){
      |                            ^
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
 
int main() {
  //input
  string s; cin >> s;
  int n;
  n = s.size();
  int counter = 0;
  
  //compute
  for(int i = 0;i < n; i++) {
         if(s.at[i] <= s.at[i+1]){
           counter += 1;
         }
  }

  //output
  cout << counter << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   16 |          if(s.at[i] <= s.at[i+1]){
      |                 ^
a.cc:16:28: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   16 |          if(s.at[i] <= s.at[i+1]){
      |                            ^
Language: C++

#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    srting s;
    cin>>s;
    int ans=0;
    for(int i=1;i<s.size();i++)
    {
        if(s[i]!-s[i-1])
        {
            ans++;
        }
    }
    cout<<ans;
  	return 0;
}







Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'srting' was not declared in this scope
    8 |     srting s;
      |     ^~~~~~
a.cc:9:10: error: 's' was not declared in this scope
    9 |     cin>>s;
      |          ^
a.cc:13:16: error: expected ')' before '!' token
   13 |         if(s[i]!-s[i-1])
      |           ~    ^
      |                )
Language: C++

#include <iosream>
#include <string>
using namespace std;

int main()
{
  string s;
  cin >> s;
  int n = s.size();
  int cnt = 0;
  for(int i = 1; i < s; ++i)
  {
    if(s[i-1] != s[i]) cnt++;
  }
  cout << cnt << endl;
  return 0;
}
    

Compiler output:
a.cc:1:10: fatal error: iosream: No such file or directory
    1 | #include <iosream>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
using namespace std;

int main() {
	string color="";
	cin>>color;
	int x=0;
	for(int i=1;i<=color.length();i++){
		if(color[i]==color[i-1]){
			x=x+0
		}
		else{
			x=x+1;
		}
	}
	cout<<x;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:30: error: expected ';' before '}' token
   10 |                         x=x+0
      |                              ^
      |                              ;
   11 |                 }
      |                 ~
Language: C++

#include <iostream>
using namespace std;

int main() {
	string color="";
	cin>>color;
	int x=0;
	for(int i=1;i<=color.length();i++){
		if(color[i]==color[i-1]){
			x=x+0
		}
		else{
			x=x+1
		}
	}
	cout<<x;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:30: error: expected ';' before '}' token
   10 |                         x=x+0
      |                              ^
      |                              ;
   11 |                 }
      |                 ~             
a.cc:13:30: error: expected ';' before '}' token
   13 |                         x=x+1
      |                              ^
      |                              ;
   14 |                 }
      |                 ~
Language: Java

S = input()
pre = "X"
B, W = 0, 0
for s in S:
    if s != pre:
        if s == "B":
            B += 1
        else:
            W += 1
        pre = s

if B == 0 or W == 0:
    print(0)
elif B == W:
    print(B * 2 - 1)
else:
    x, y = min(B, W), max(B, W)
    print(x * 2)

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
S = input()
^
1 error
Language: C++

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

int main() {
  string S;
  cin >> S;
  
  int ans = 0;
  
  int N = S.size();
  for (int i = 0; i < N-1; i++) {
    if (S[i] != S[i+1]) ans++;
  }
  
  cout << ans << endl;
}

Compiler output:
a.cc:1:10: fatal error: bits/stdd++.h: No such file or directory
    1 | #include <bits/stdd++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.