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

#include <bits/stdc++.h>
#define ll long long
#define INF 999999999
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 1400;

int a[MAX_N][MAX_N];

int main()
{
	int h,w;
	cin >> h >> w;
	int ans=0;
	rep(i,h){
		rep(i,w){
			scanf("%d",&a[i][j]);
			if(a[i][j]==0){
				dp[i][j] = 1;
				ans = max(ans,dp[i][j]);
			}
		}
	}
	for(int i=1;i<h;i++){
		for(int j=1;j<w;j++){
			if(a[i][j] == 0){
				dp[i][j] = min(dp[i-1][j-1],min(dp[i-1][j],dp[i][j-1]))+1;
				ans = max(ans,dp[i][j]);
			}else{
				dp[i][j] = 0;
			}
		}
	}
	cout << ans*ans << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:42: error: 'j' was not declared in this scope
   22 |                         scanf("%d",&a[i][j]);
      |                                          ^
a.cc:24:33: error: 'dp' was not declared in this scope; did you mean 'dup'?
   24 |                                 dp[i][j] = 1;
      |                                 ^~
      |                                 dup
a.cc:32:33: error: 'dp' was not declared in this scope; did you mean 'dup'?
   32 |                                 dp[i][j] = min(dp[i-1][j-1],min(dp[i-1][j],dp[i][j-1]))+1;
      |                                 ^~
      |                                 dup
a.cc:35:33: error: 'dp' was not declared in this scope; did you mean 'dup'?
   35 |                                 dp[i][j] = 0;
      |                                 ^~
      |                                 dup
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define INF 999999999
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;i++)
??
using namespace std;
??
typedef pair<int,int>P;
??
const int MAX_N = 1400;
??
int a[MAX_N][MAX_N];
int dp[MAX_N][MAX_N];
??
int main()
{
????????int h,w;
????????cin >> h >> w;
????????int ans=0;
????????rep(i,h){
????????????????rep(j,w){
????????????????????????scanf("%d",&a[i][j]);
????????????????????????if(a[i][j]==0){
????????????????????????????????dp[i][j] = 1;
????????????????????????????????ans = 1;
????????????????????????}
????????????????}
????????}
????????for(int i=1;i<h;i++){
????????????????for(int j=1;j<w;j++){
????????????????????????if(a[i][j] == 0){
????????????????????????????????dp[i][j] = min(dp[i-1][j-1],min(dp[i-1][j],dp[i][j-1]))+1;
????????????????????????????????ans = max(ans,dp[i][j]);
????????????????????????}else{
????????????????????????????????dp[i][j] = 0;
????????????????????????}
????????????????}
????????}
????????cout << ans*ans << "\n";
}

Compiler output:
a.cc:6:1: error: expected unqualified-id before '?' token
    6 | ??
      | ^
a.cc:8:1: error: expected unqualified-id before '?' token
    8 | ??
      | ^
a.cc:10:1: error: expected unqualified-id before '?' token
   10 | ??
      | ^
a.cc:12:1: error: expected unqualified-id before '?' token
   12 | ??
      | ^
a.cc:14:8: error: 'MAX_N' was not declared in this scope
   14 | int dp[MAX_N][MAX_N];
      |        ^~~~~
a.cc:14:15: error: 'MAX_N' was not declared in this scope
   14 | int dp[MAX_N][MAX_N];
      |               ^~~~~
a.cc:15:1: error: expected unqualified-id before '?' token
   15 | ??
      | ^
Language: C++

#include <iostream>

#define tile(i,j) tile[(j) * (H) +(i)]

int calc(int x, int y, int* tile, int H, int W){
    int k = std::min(H-x, W-y);
    //std::cout << k << std::endl;
    
    if(tile(x,y) == 1){
        return 0;
    }
    
    for(int s=0; s<k; ++s){
        for(int i=0; i<=s; ++i){
            for(int j=0; j<=s; ++j){
                if(tile(x + i, y + j) == 1){
                    return s-1;
                }
            }
        }
    }

    return k;
}


Compiler output:
/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<cstdio>
#include<algorithm>
using namespace std;
#define MAX 1400
int dp[MAX][MAX],G[MAX][MAX];
int getLargestSquare(int H,int W){
int maxWidth=0;
for(int i=0;i<H;i++){
for(int j=0;j<WW;j++){
dp[i][j]=(G[i][j]+1)%2;
maxWidth|=dp[i][j];
}
}
for(int i=1;i<H;i++){
for(int j=1;j<W;j++){
if(G[i][j]){
dp[i][j]=0;
}else{
dp[i][j]=min(dp[i-1][j-1],min(dp[i-1][j],dp[i][j-1]))+1;
maxWidth=max(maxWidth,dp[i][j]);
}
}
}
return maxWidth*maxWidth;
}
int main(void){
int H,W;
scanf("%d%d",&H,&W);
for(int i=0;i<H;i++){
for(int j=0;j<W;j++)scanf("%d",&G[i][j]);
}
printf("%d\n",getLargestSquare(H,W));
return 0;
}


Compiler output:
a.cc: In function 'int getLargestSquare(int, int)':
a.cc:9:15: error: 'WW' was not declared in this scope; did you mean 'W'?
    9 | for(int j=0;j<WW;j++){
      |               ^~
      |               W
Language: C++

#include<cstdio>
#include<algorithm>

using namespace std;

#define MAX 1400

int dp[MAX][MAX], G[MAX][MAX]


int getLargestSquare(int H, int W) {
  int maxWidth = 0;
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      dp[i][j] = (G[i][j] + 1) % 2;
      maxWidth |= dp[i][j];
    }
  }

  for (int i = 1; i < H; i++) {
    for (int j = 1; j < W; j++) {
      if (G[i][j]) {
        dp[i][j] = 0;
      } else {
        dp[i][j] = min(dp[i - 1][j - 1], min(dp[i - 1][j], dp[i][j - 1])) + 1;
        maxWidth = max(maxWidth, dp[i][j]);
      }
    }
  }

  return maxWidth * maxWidth;
}

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

  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      scanf("%d", &G[i][j]);
    }
  }

  printf("%d\n", getLargestSquare(H, W));

  return 0;
}


Compiler output:
a.cc:11:1: error: expected initializer before 'int'
   11 | int getLargestSquare(int H, int W) {
      | ^~~
a.cc: In function 'int main()':
a.cc:40:20: error: 'G' was not declared in this scope
   40 |       scanf("%d", &G[i][j]);
      |                    ^
a.cc:44:18: error: 'getLargestSquare' was not declared in this scope
   44 |   printf("%d\n", getLargestSquare(H, W));
      |                  ^~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
int dp[1401][1401]={},m,h,w,f;
#define r(i,n) for(int i=0;i<n;i++)
main(){
std::cin>>h>>w;m=0;
r(i,h)r(j,w){std::cin>>f;if(!f)dp[i+1][j+1]=min(dp[i][j],min(dp[i+1][j],dp[i][j+1]))+1,m=max(m,dp[i+1][j+1]);}
std::cout<<m*m<<endl;
}


Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:58: error: 'min' was not declared in this scope; did you mean 'std::min'?
    6 | r(i,h)r(j,w){std::cin>>f;if(!f)dp[i+1][j+1]=min(dp[i][j],min(dp[i+1][j],dp[i][j+1]))+1,m=max(m,dp[i+1][j+1]);}
      |                                                          ^~~
      |                                                          std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:6:45: error: 'min' was not declared in this scope; did you mean 'std::min'?
    6 | r(i,h)r(j,w){std::cin>>f;if(!f)dp[i+1][j+1]=min(dp[i][j],min(dp[i+1][j],dp[i][j+1]))+1,m=max(m,dp[i+1][j+1]);}
      |                                             ^~~
      |                                             std::min
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:6:90: error: 'max' was not declared in this scope; did you mean 'std::max'?
    6 | r(i,h)r(j,w){std::cin>>f;if(!f)dp[i+1][j+1]=min(dp[i][j],min(dp[i+1][j],dp[i][j+1]))+1,m=max(m,dp[i+1][j+1]);}
      |                                                                                          ^~~
      |                                                                                          std::max
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:7:17: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 | std::cout<<m*m<<endl;
      |                 ^~~~
      |                 std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int dp[1401][1401]={},m,h,w,f,i;
#define r(i,n) for(i=0;i<n;i++)
main(){
cin>>h>>w;m=0;
r(i,h)r(j,w){cin>>f;if(!f)dp[i+1][j+1]=min(dp[i][j],min(dp[i+1][j],dp[i][j+1]))+1,m=max(m,dp[i+1][j+1]);}
cout<<m*m<<endl;
}


Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'j' was not declared in this scope
    7 | r(i,h)r(j,w){cin>>f;if(!f)dp[i+1][j+1]=min(dp[i][j],min(dp[i+1][j],dp[i][j+1]))+1,m=max(m,dp[i+1][j+1]);}
      |         ^
a.cc:4:20: note: in definition of macro 'r'
    4 | #define r(i,n) for(i=0;i<n;i++)
      |                    ^
Language: C++

#include<iostream>
using namespace std;
int dp[1401][1401]={},m,h,w,f,i,j;
main(){
	cin>>h>>w;
	m=0;
	for(i=0;i<h;i++)for(j=0;j<w;j++){
		cin>>f;
		if(!f){
			dp[i+1][j+1]=min(dp[i][j],min(dp[i+1][j],dp[i][j+1]))+1;
			m=max(m,dp[i+1][j+1]);
	}
	cout<<m*m<<endl;
}


Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:14:2: error: expected '}' at end of input
   14 | }
      |  ^
a.cc:4:7: note: to match this '{'
    4 | main(){
      |       ^
Language: C++

#include<iostream>
using namespace std;
int dp[1401][1401]={},m,h,w,f,i,j;
main(){
	cin>>h>>w;
	m=0;
	for(i=0;i<h;i++)for(j=0;j<w;j++){
		cin>>f;
		if(!f){
			dp[i+1][j+1]=min(dp[i][j],min(dp[i+1][j],dp[i][j+1]))+1;
			m=max(m,dp[i+1][j+1]);}
	}
	puts(m*m);
	//cout<<m*m<<endl;
}


Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:13:15: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   13 |         puts(m*m);
      |              ~^~
      |               |
      |               int
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdio.h:714:30: note:   initializing argument 1 of 'int puts(const char*)'
  714 | extern int puts (const char *__s);
      |                  ~~~~~~~~~~~~^~~
Language: C++

#include<iostream>
using namespace std;
int m,D[1500][1500]={m=0},h,w,f,i;
main(){
	cin>>h>>w;
	for(i=0;i<h;i++)for(j=0;j<w;j++){
		cin>>f;
		m=max(m,(dp[i+1][j+1]=min(dp[i][j],min(dp[i+1][j],dp[i][j+1]))+1)*(!f));
	}
	cout<<m*m<<endl;
}


Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:29: error: 'j' was not declared in this scope
    6 |         for(i=0;i<h;i++)for(j=0;j<w;j++){
      |                             ^
a.cc:8:26: error: 'dp' was not declared in this scope
    8 |                 m=max(m,(dp[i+1][j+1]=min(dp[i][j],min(dp[i+1][j],dp[i][j+1]))+1)*(!f));
      |                          ^~
Language: C++

#include<iostream>
using namespace std;
int m,D[1500][1500]={m=0},h,w,f,i,j;
main(){
	cin>>h>>w;
	for(i=0;i<h;i++)for(j=0;j<w;j++){
		cin>>f;
		m=max(m,(dp[i+1][j+1]=min(dp[i][j],min(dp[i+1][j],dp[i][j+1]))+1)*(!f));
	}
	cout<<m*m<<endl;
}


Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:26: error: 'dp' was not declared in this scope
    8 |                 m=max(m,(dp[i+1][j+1]=min(dp[i][j],min(dp[i+1][j],dp[i][j+1]))+1)*(!f));
      |                          ^~
Language: C++

#include<algo.h>
int h,w,m=0,D[1401][1401]={},f,i=0;
main(){
    for(scanf("%d %d",&h,&w);i<h*w;i++){
    	scanf("%d",&f);
        m=max(m,D[i/w+1][i%w+1]=(min(D[i/w][i%w],min(D[i/w+1][i%w],D[i/w][i%w+1]))+1)*(!f));
    }
	printf("%d\n",m*m);
}


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

#include <stack>
using namespace std;

struct Rectangle {
  int height;
  int pos;
};
 

#include <stdio.h>
#define SIZ 1400
int m[SIZ+1][SIZ+1];
int st[SIZ];
char z[9999999];
int get(){
	static int input_count=0;
	int r=0;
	for(;'0'<=z[input_count]&&z[input_count]<='9';)r=r*10+z[input_count++]-'0';
	input_count++;
	return r;
}
int main(){
	fread(z,1,sizeof(z),stdin);
	int i,j,k,y=get(),x=get(),r,ptr;
	for(j=0;j<y;j++)for(r=i=0;i<x;m[j][i]=r,i++){
		int t=get();
		r=t==0?r+1:0;
	}
	r=0;
/*
	for(i=0;i<x;i++)for(ptr=j=0;j<=y;j++){
		//printf("%d %d %d %d\n",i,j,ptr,m[j][i]);
		if(!ptr || st[ptr-1]<m[j][i])st[ptr++]=m[j][i];
		else{
			for(;ptr && st[ptr-1]>m[j][i];){
				int _y=(j-(ptr-1)),_x=st[--ptr];
				//printf("%d %d\n",_x,_y);
				if(r<_x*_y)r=_x*_y;
			}
			st[ptr++]=m[j][i];
		}
	}
*/
	Rectangle rect;
	for(int i=0;i<x;i++){
		stack<Rectangle> stk;
		rect.height = 0;
		rect.pos = 0;
		stk.push(rect);
		int pop=0;
		for(int j=0;j<=y;j++){
			rect.height = m[j][i];
			rect.pos = j;
			if(stk.empty() || stk.top().height < rect.height){
				stk.push(rect);
			}else{
				//printf("[-] %d %d\n",i,j);
				for(;!stk.empty() && stk.top().height >= rect.height;){
					pop++;
					Rectangle pre = stk.top(); stk.pop();
					pre.pos=stk
					int area = pre.height * (j - pre.pos);
					r = max(r, area);
					//printf("%d %d\n",target,pre.pos);
					rect.pos = pre.pos;
				}
				stk.push(rect);
			}
			if(rect.height==0)pop=0;
		}
	}

	printf("%d\n",r);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:49: error: cannot convert 'std::stack<Rectangle>' to 'int' in assignment
   61 |                                         pre.pos=stk
      |                                                 ^~~
      |                                                 |
      |                                                 std::stack<Rectangle>
a.cc:63:52: error: 'area' was not declared in this scope
   63 |                                         r = max(r, area);
      |                                                    ^~~~
Language: C++

#include <bits/stdc++.h>
#define N 1401
using namespace std;
int mp[N][N];
int h,w;

struct dat{int h,i;};

int calc(int A[]){
  stack <dat> S;
  int res = 0;
  for(int i=0;i<=w;i++){
    int h = A[i];
    if(S.empty() || S.top().h < h) S.push((dat){h,i});
    else if(S.top().h > h){
      int ni = i;
      while(!S.empty() && S.top().h > h){
        dat t = S.top(); S.pop();
        ni = t.i;
        int area = (i - t.i) * t.h;
        res = max(res,area);
      }
      res = max(res,(i-ni)*h);
      S.push((dat){h,ni});
    }
  
  return res;
}

int main(){

  cin>>h>>w;
  
  for(int i=0;i<h;i++)
    for(int j=0;j<w;j++)cin>>mp[i][j],mp[i][j]=!mp[i][j];
  
  for(int j=0;j<w;j++)
    for(int i=1;i<h;i++)if(mp[i][j]) mp[i][j] = mp[i-1][j]+1;


  //cout<<endl;for(int i=0;i<h;i++){for(int j=0;j<w;j++)cout<<mp[i][j]<<" ";cout<<endl;}
  int ans = 0;
  for(int i=0;i<h;i++)ans = max(ans,calc(mp[i]));
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int calc(int*)':
a.cc:30:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   30 | int main(){
      |         ^~
a.cc:30:9: note: remove parentheses to default-initialize a variable
   30 | int main(){
      |         ^~
      |         --
a.cc:30:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:30:11: error: a function-definition is not allowed here before '{' token
   30 | int main(){
      |           ^
a.cc:46:2: error: expected '}' at end of input
   46 | }
      |  ^
a.cc:9:18: note: to match this '{'
    9 | int calc(int A[]){
      |                  ^
a.cc:46:2: warning: control reaches end of non-void function [-Wreturn-type]
   46 | }
      |  ^
Language: C++

#include<algorithm>
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<iomanip>
#include<complex>
#include<cstdio>
#include<vector>
#include<queue>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef stack<int> SI;
typedef queue<int> QI;
typedef list<int> LI;
typedef pair<int,int> PII;
typedef long long LL;

#define d(x)  cout<<#x<<" = "<<(x)<<endl;
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define EMP empty()
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define REACH(i,c) for(typeof((c).rbegin()) i=(c).rbegin(); i!=(c).rend(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c,n) sort(c,c+n)
#define VSORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define DFOR(i,b,a) for(int i=(b)-1;i>=(a);--i)
#define DREP(i,n) DFOR(i,n,0)
#define INF 1000000000
#define PI  acos(-1.0)
////////////////////////////////////////////////
struct Rect{int h;int p;};
int lgstrec(int size,int buffer[])
{
	stack<Rect> S;
	int maxv=0;
	buffer[size]=0;
	for(int i=0;i<=size;i++)
	{
		Rect rect;
		rect.h=buffer[i];
		rect.p=i;
		if(S.empty())
		{
			S.push(rect);
		}
		else
		{
			if(S.top().h<rect.h)
			{
				S.push(rect);
			}
			else if(S.top().h>rect.h)
			{
				int tgt=i;
				while(!S.empty()&&S.top().h>=rect.h)
				{
					Rect pre=S.top();S.pop();
					int area=pre.h*(i-pre.p);
					maxv=max(maxv,area);
					tgt=pre.p;
				}
				rect.p=tgt;
				S.push(rect);
			}
		}
	}
	return maxv;
}
int H,W;
int buffer[1400][1400];
int T[1400][1400];
int lgstrec()
{
	REP(j,W)
	{
		REP(i,H)
		{
			if(buffer[i][j])
			{
				T[i][j]=0;
			}
			else
			{
				T[i][j]=(i>0)?T[i-1][j]+1:1;
			}
		}
	}
	int maxv=0;
	REP(i,H)
	{
		maxv=max(maxv,lgstrec(Wa,T[i]));
	}
	return maxv;
}
int main()
{
	scanf("%d%d",&H,&W);
	REP(i,H)
	{
		REP(j,W)
		{
			scanf("%d",&buffer[i][j]);
		}
	}
	cout<<lgstrec()<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int lgstrec()':
a.cc:106:39: error: 'Wa' was not declared in this scope; did you mean 'W'?
  106 |                 maxv=max(maxv,lgstrec(Wa,T[i]));
      |                                       ^~
      |                                       W
Language: C++

#include<stdio.h>
#include<iostream>
#include<stack>
#include<algorithm>
#define MAX 1400

using namespace std;

struct Rectangle { int height; int pos; };

int getLargestRectsngle(int size, int buffer[]) {
	stack<Rectangle> S;
	int maxv = 0;
	buffer[size] = 0;

	for (int i = 0; i <= size; i++) {
		Rectangle rect;
		rect.height = buffer[i];
		rect.pos = i;
		if (S.empty()) {
			S.push(rect);
		}
		else {
			if (S.top().height < rect.height) {
				S.push(rect);
			}
			else if (S.top().height > rect.height) {
				int target = i;
				while (!S.empty() && S.top.height >= rect.height) {
					Rectangle pre = S.top();
					S.pop();
					int area = pre.height*(i - pre.pos);
					maxv = max(maxv, area);
					target = pre.pos;
				}
				rect.pos = target;
				S.push(rect);
			}
		}
	}
	return maxv;
}

int H, W;
int buffer[MAX][MAX];
int T[MAX][MAX];

int getLargestRectangle() {
	for (int j = 0; j < W; j++) {
		for (int i = 0; i < H; i++) {
			if (buffer[i][j]) {
				T[i][j] = 0;
			}
			else {
				T[i][j] = (i > 0) ? T[i - 1][j] + 1 : 1;
			}
		}
	}

	int maxv = 0;
	for (int i = 0; i < H; i++) {
		maxv = max(maxv, getLargestRectangle(W, T[i]));
	}

	return maxv;
}

int main() {
	scanf("%d %d", &H, &W);
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			scanf("%d", &buffer[i][j]);
		}
	}
	cout << getLargestRectangle() << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int getLargestRectsngle(int, int*)':
a.cc:29:56: error: invalid use of member function 'std::stack<Rectangle>::top' (did you forget the '()' ?)
   29 |                                 while (!S.empty() && S.top.height >= rect.height) {
      |                                                      ~~^~~
a.cc:29:60: error: expected ')' before 'height'
   29 |                                 while (!S.empty() && S.top.height >= rect.height) {
      |                                       ~                    ^~~~~~
      |                                                            )
a.cc:29:60: error: 'height' was not declared in this scope
   29 |                                 while (!S.empty() && S.top.height >= rect.height) {
      |                                                            ^~~~~~
a.cc: In function 'int getLargestRectangle()':
a.cc:62:53: error: too many arguments to function 'int getLargestRectangle()'
   62 |                 maxv = max(maxv, getLargestRectangle(W, T[i]));
      |                                  ~~~~~~~~~~~~~~~~~~~^~~~~~~~~
a.cc:48:5: note: declared here
   48 | int getLargestRectangle() {
      |     ^~~~~~~~~~~~~~~~~~~
Language: C++

#include<stdio.h>
#include<iostream>
#include<stack>
#include<algorithm>
#define MAX 1400

using namespace std;

struct Rectangle { int height, int pos; };

int getLargestRectangle(int size, int buffer[]) {
  stack<Rectangle> S;
  int maxv = 0;
  buffer[size] = 0;

  for ( int i = 0; i <= size; i++ ) {
    Rectangle rect;
    rect.height = buffer[i];
    rect.pos = i;
    if ( S.empty() ) {
      S.push(rect);
    } else {
      if ( S.top().height < rect.height ) {
        S.push(rect);
      } else if ( S.top().height > rect.height ) {
        int target = i;
        while ( !S.empty() && S.top().height >= rect.height ) {
          Rectangle pre = S.top(); S.pop();
          int area = pre.height * (i - pre.pos);
          maxv = max(maxv, area);
          target = pre.pos;
        }
        rect.pos = target;
        S.push(rect);
      }
    }
  }
  return maxv;
}

int H, W;
int buffer[MAX][MAX];
int T[MAX][MAX];

int getLargestRectangle() {
  for ( int j = 0; j < W; j++ )
    for ( int i = 0; i < H; i++ ) {
      if ( buffer[i][j] )
        T[i][j] = 0;
      else
        T[i][j] = (i > 0) ? T[i - 1][j] + 1 : 1;
    }

  int maxv = 0;
  for ( int i = 0; i < H; i++ )
    maxv = max(maxv, getLargestRectangle(W, T[i]));

  return maxv;
}

int main() {
  scanf("%d %d", &H, &W);
  for ( int i = 0; i < H; i++ )
    for ( int j = 0; j < W; j++ )
      scanf("%d", &buffer[i][j]);
  cout << getLargestRectangle() << endl;

  return 0;
}


Compiler output:
a.cc:9:32: error: expected unqualified-id before 'int'
    9 | struct Rectangle { int height, int pos; };
      |                                ^~~
a.cc: In function 'int getLargestRectangle(int, int*)':
a.cc:19:10: error: 'struct Rectangle' has no member named 'pos'
   19 |     rect.pos = i;
      |          ^~~
a.cc:29:44: error: 'struct Rectangle' has no member named 'pos'
   29 |           int area = pre.height * (i - pre.pos);
      |                                            ^~~
a.cc:31:24: error: 'struct Rectangle' has no member named 'pos'
   31 |           target = pre.pos;
      |                        ^~~
a.cc:33:14: error: 'struct Rectangle' has no member named 'pos'
   33 |         rect.pos = target;
      |              ^~~
Language: C++

#include <stdio.h>
#include <stack>
#include <utility>
using namespace std;
typedef pair<int,int> pi;
#define F first
#define S second
#define MP make_pair
const int N=5e2+10;
int main(){
    int n,m,a[N][N],now,ans,nx;
    pi temp;
    stack<pi> s;
    while(true){
        scanf("%d%d",&n,&m);
        if(n==0&&m==0)return 0;
        ans=0;
        for(int i=0;i<n;i++){
            scanf("%s",c);
            now=0;
            for(int j=0;j<m;j++){
                scanf("%d",&nx);
                if(nx==1)now++;
                else now=0;
                a[i][j]=now;
            }
        }
        for(int j=0;j<m;j++){
            while(!s.empty())s.pop();
            for(int i=0;i<n;i++){
                while(!s.empty()){
                    if(s.top().F>a[i][j]){
                        temp=s.top();
                        s.pop();
                        if(s.empty())ans=max(ans,temp.F*i);
                        else ans=max(ans,temp.F*(i-1-s.top().S));
                    }
                    else break;
                }
                s.push(MP(a[i][j],i));
            }
            while(!s.empty()){
                temp=s.top();
                s.pop();
                if(s.empty())ans=max(ans,temp.F*n);
                else ans=max(ans,temp.F*(n-s.top().S-1));
                
            }
        }
        printf("%d\n",ans);
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:24: error: 'c' was not declared in this scope
   19 |             scanf("%s",c);
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
#define eb emplace_back
#define fi first
#define se second
#define chmax(a,b) if(a<b)a=b
typedef vector<int> vi;
typedef pair<int, int> pii;
void largest_rectangle_in_a_histogram() {
    int N; cin >> N;
    vector<int> h(N); rep(i, 0, N) { cin >> h[i]; }
    using P = pair<int, int>;
    stack<P> st;
    st.emplace(-1, -1);
    int ans = 0;
    rep(i, 0, N) {
        if (st.top().first == h[i])
            continue;
        int pos = i;
        while (st.top().first >= h[i]) {
            chmax(ans, st.top().first*(i - st.top().second));
            pos = st.top().second;
            st.pop();
        }
        st.emplace(h[i], pos);
    }
    while (st.size()) {
        chmax(ans, st.top().first*(N - st.top().second));
        st.pop();
    }
    cout << ans << endl;
}
 
signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    largest_rectangle_in_a_histogram();
    return 0;
}

Compiler output:
a.cc: In function 'void largest_rectangle_in_a_histogram()':
a.cc:12:27: error: 'i' was not declared in this scope
   12 |     vector<int> h(N); rep(i, 0, N) { cin >> h[i]; }
      |                           ^
a.cc:12:23: error: 'rep' was not declared in this scope
   12 |     vector<int> h(N); rep(i, 0, N) { cin >> h[i]; }
      |                       ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
#define P(x) cout << (x) << "\n"
#define p(x) cout << (x)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define vv(type, c, m, n, i) vector<vector<type>> c(m, vector<type>(n, i))
#define rep(i,a,n) for(int i=(a), i##_len=(n); i<i##_len; ++i)
#define rrep(i,a,n) for(int i=(a), i##_len=(n); i>i##_len; --i)
#define len(x) ((int)(x).size())
#define mp make_pair
#define eb emplace_back
#define fi first
#define se second
#define chmax(a,b) if(a<b)a=b
#define chmin(a,b) if(a>b)a=b
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int, int> pii;
void square() {
	int n; cin >> n;
	vll h(n); rep(i, 0, n) cin >> h[i];
	deque<pair<int, int> st;
	st.eb(-1, -1);
	ll ans = 0, pos;
	rep(i, 0, n) {
		if (st.back().fi == h[i]) continue;
		pos = i;
		while (st.back().fi >= h[i]) {
			chmax(ans, st.back().fi * (i - st.back().se));
			pos = st.back().se;
			st.pop_back();
		}
		st.eb(h[i], pos);
	}

	while (!st.empty()) {
		chmax(ans, st.back().fi * (n - st.back().se));
		st.pop_back();
	}

	P(ans);
}
int main() {
	square();
	return 0;
}

Compiler output:
a.cc: In function 'void square()':
a.cc:29:30: error: template argument 1 is invalid
   29 |         deque<pair<int, int> st;
      |                              ^~
a.cc:29:30: error: template argument 2 is invalid
a.cc:30:9: error: 'st' was not declared in this scope; did you mean 'std'?
   30 |         st.eb(-1, -1);
      |         ^~
      |         std
Language: C++

#include<bits/stdc++.h>
using namespace std;
struct LR{
  int n;
  vector<long long>a;
  LR(int sz):n(sz),a(sz+1){}
  void Input(){
    for(int i=0;i<n;i++) cin>>a[i];
    a[n]=0;
  }
  int solve(){
    long long ans=0,ls=0;
    stack<pair<int,int> >st;
    for(int j=0;j<n+1;j++){
      if(st.empty())st.push(make_pair(a[j],j));
      else if(st.top().first==a[j])continue;
      else if(st.top().first<a[j])st.push(make_pair(a[j],j));
      else{
        while(!st.empty()&&st.top().first>a[j]){
          ans=max(ans,(j-st.top().second)*st.top().first);
          ls=st.top().second;
          st.pop();
        }
        st.push(make_pair(a[j],ls));
      }
    }
    return ans;
  }
};
int main(){
  int n;
  cin>>n;
  LR L(n);
  L.Input();
  cout<<L.solve()<<endl;
}


Compiler output:
a.cc: In member function 'int LR::solve()':
a.cc:20:18: error: no matching function for call to 'max(long long int&, int)'
   20 |           ans=max(ans,(j-st.top().second)*st.top().first);
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:   template argument deduction/substitution failed:
a.cc:20:18: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   20 |           ans=max(ans,(j-st.top().second)*st.top().first);
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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, 2 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:   candidate expects 1 argument, 2 provided
/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:   template argument deduction/substitution failed:
a.cc:20:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   20 |           ans=max(ans,(j-st.top().second)*st.top().first);
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<fstream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<stack>
#include<climits>
#include<cstring>
#include<queue>
#include<complex>
#include<random>
using namespace std;

typedef unsigned long long ull;

int main(){
    int N, V
    ull x;
    cin >> N >> V;
    ull a[N], b[N], c[N], d[N];
    for (int i=0;i<N;i++) {cin >> a[i];}
    for (int i=0;i<N;i++) {cin >> b[i];}
    for (int i=0;i<N;i++) {cin >> c[i];}
    for (int i=0;i<N;i++) {cin >> d[i];}

    vector<ull> abList;
    vector<ull> cdList;
    for (int i=0;i<N;i++){
        for (int j=0;j<N;j++){
            abList.push_back(a[i]+b[j]);
        }
    }
    for (int i=0;i<N;i++){
        for (int j=0;j<N;j++){
            cdList.push_back(c[i]+d[j]);
        }
    }
    sort(cdList.begin(), cdList.end());

    ull S = 0;
    pair<vector<ull>::iterator, vector<ull>::iterator> p;
    for (int i=0;i<N*N;i++){
        p = equal_range(cdList.begin(), cdList.end(), V-abList[i]);
        S += (p.second -p.first);
    }

    cout << S << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: expected initializer before 'ull'
   19 |     ull x;
      |     ^~~
a.cc:20:17: error: 'V' was not declared in this scope
   20 |     cin >> N >> V;
      |                 ^
Language: C++

#include <cstdio>
#include <vector>
#include <map>
using namespace std;

int main(){
	int N,R;
	long long V,R=0;
	scanf("%d%lld",&N,&V);
	vector<long long>a(N),b(N),c(N),d(N);
	for(int i=0;i<N;i++)scanf("%lld",&a[i]);
	for(int i=0;i<N;i++)scanf("%lld",&b[i]);
	for(int i=0;i<N;i++)scanf("%lld",&c[i]);
	for(int i=0;i<N;i++)scanf("%lld",&d[i]);
	map<long long,long long>m1,m2;
	for(int i=0;i<N;i++)for(int j=0;j<N;j++)m1[a[i]+b[j]]++;
	for(int i=0;i<N;i++)for(int j=0;j<N;j++)m2[c[i]+d[j]]++;
	for(auto &e:m1){
		auto it=m2.lower_bound(V-e.first);
		if(it!=m2.end()&&it->first==V-e.first)R+=e.second*it->second;
	}
	printf("%lld\n",R);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: conflicting declaration 'long long int R'
    8 |         long long V,R=0;
      |                     ^
a.cc:7:15: note: previous declaration as 'int R'
    7 |         int N,R;
      |               ^
Language: C++

#include<cstdio>
#include<map>
using namespace std;

int main()
{
	int i,j;
	long long N,V,a[1000],b[1000],c[1000],d[1000],ans=0;
	map<long long,long long> p;
	
	cin >> N >> V;
	for(i=0;i<=N-1;i++) cin >> a[i];
	for(i=0;i<=N-1;i++) cin >> b[i];
	for(i=0;i<=N-1;i++) cin >> c[i];
	for(i=0;i<=N-1;i++) cin >> d[i];
	
	for(i=0;i<=N-1;i++)
	{
		for(j=0;j<=N-1;j++)
		{
			p[a[i]+b[j]]++;
		}
	}
	for(i=0;i<=N-1;i++)
	{
		for(j=0;j<=N-1;j++)
		{
			ans+=p[V-c[i]-d[j]];
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'cin' was not declared in this scope
   11 |         cin >> N >> V;
      |         ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<map>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:31:9: error: 'cout' was not declared in this scope
   31 |         cout << ans << endl;
      |         ^~~~
a.cc:31:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:31:24: error: 'endl' was not declared in this scope
   31 |         cout << ans << endl;
      |                        ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include<map>
  +++ |+#include <ostream>
    3 | using namespace std;
Language: C++

#include <iostream>
using namespace std;

int main()
{
	int n;
	long long v;
	cin >> n >> v;

	long long a[n], b[n], c[n], d[n];
	long long ab[n * n];

	for (int j = 0; j < n; ++j)
		cin >> a[j];
	for (int j = 0; j < n; ++j)
		cin >> b[j];
	for (int j = 0; j < n; ++j)
		cin >> c[j];
	for (int j = 0; j < n; ++j)
		cin >> d[j];

	for (int i = 0; i < n; ++i)
	{
		for (int j = 0; j < n; ++j)
		{
			ab[i * n + j] = a[i] + b[j];
		}
	}

	sort(ab, ab + n * n);

	long long ans = 0;
	for (int i = 0; i < n; ++i)
	{
		for (int j = 0; j < n; ++j)
		{
			long long cd = v - (c[i] + d[j]);
			ans += upper_bound(ab, ab + n * n, cd) - lower_bound(ab, ab + n * n, cd);
		}
	}
	printf("%lld\n", ans);
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:30:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   30 |         sort(ab, ab + n * n);
      |         ^~~~
      |         short
a.cc:38:32: error: 'upper_bound' was not declared in this scope
   38 |                         ans += upper_bound(ab, ab + n * n, cd) - lower_bound(ab, ab + n * n, cd);
      |                                ^~~~~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
long long n, k, l, r, a[40], pos;
vector<long long>p[30], q[30];
int main() {
	cin >> n >> k >> l >> r; pos = n / 2;
	for (int i = 0; i < n; i++)cin >> a[i];
	for (int i = 0; i < (1 << pos); i++) {
		long long R = 0; for (int j = 0; j < pos; j++) { if ((i / (1 << j)) % 2 == 1) { R += a[j]; } }
		p[__popcnt(i)].push_back(R);
	}
	for (int i = 0; i < (1 << (n - pos)); i++) {
		long long R = 0; for (int j = 0; j < n - pos; j++) { if ((i / (1 << j)) % 2 == 1) { R += a[j + pos]; } }
		q[__popcnt(i)].push_back(R);
	}
	for (int i = 0; i < 30; i++)sort(p[i].begin(), p[i].end());
	for (int i = 0; i < 30; i++)sort(q[i].begin(), q[i].end());
	long long cnts = 0;
	for (int i = 0; i <= pos; i++) {
		int V = k - i; if (V < 0)continue;
		for (int j = 0; j < p[i].size(); j++) {
			int pos1 = lower_bound(q[V].begin(), q[V].end(), l - p[i][j]) - q[V].begin();
			int pos2 = lower_bound(q[V].begin(), q[V].end(), r + 1 - p[i][j]) - q[V].begin();
			cnts += pos2 - pos1;
		}
	}
	cout << cnts << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: '__popcnt' was not declared in this scope
   12 |                 p[__popcnt(i)].push_back(R);
      |                   ^~~~~~~~
a.cc:16:19: error: '__popcnt' was not declared in this scope
   16 |                 q[__popcnt(i)].push_back(R);
      |                   ^~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
long long n, k, l, r, a[40], pos;
vector<long long>p[30], q[30];
int main() {
	cin >> n >> k >> l >> r; pos = n / 2;
	for (int i = 0; i < n; i++)cin >> a[i];
	for (int i = 0; i < (1 << pos); i++) {
		long long R = 0; for (int j = 0; j < pos; j++) { if ((i / (1 << j)) % 2 == 1) { R += a[j]; } }
		p[__popcnt(i)].push_back(R);
	}
	for (int i = 0; i < (1 << (n - pos)); i++) {
		long long R = 0; for (int j = 0; j < n - pos; j++) { if ((i / (1 << j)) % 2 == 1) { R += a[j + pos]; } }
		q[builtin_popcnt(i)].push_back(R);
	}
	for (int i = 0; i < 30; i++)sort(p[i].begin(), p[i].end());
	for (int i = 0; i < 30; i++)sort(q[i].begin(), q[i].end());
	long long cnts = 0;
	for (int i = 0; i <= pos; i++) {
		int V = k - i; if (V < 0)continue;
		for (int j = 0; j < p[i].size(); j++) {
			int pos1 = lower_bound(q[V].begin(), q[V].end(), l - p[i][j]) - q[V].begin();
			int pos2 = lower_bound(q[V].begin(), q[V].end(), r + 1 - p[i][j]) - q[V].begin();
			cnts += pos2 - pos1;
		}
	}
	cout << cnts << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: '__popcnt' was not declared in this scope
   12 |                 p[__popcnt(i)].push_back(R);
      |                   ^~~~~~~~
a.cc:16:19: error: 'builtin_popcnt' was not declared in this scope
   16 |                 q[builtin_popcnt(i)].push_back(R);
      |                   ^~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
long long n, k, l, r, a[40], pos;
vector<long long>p[30], q[30];
int main() {
	cin >> n >> k >> l >> r; pos = n / 2;
	for (int i = 0; i < n; i++)cin >> a[i];
	for (int i = 0; i < (1 << pos); i++) {
		long long R = 0; for (int j = 0; j < pos; j++) { if ((i / (1 << j)) % 2 == 1) { R += a[j]; } }
		p[builtin_popcount(i)].push_back(R);
	}
	for (int i = 0; i < (1 << (n - pos)); i++) {
		long long R = 0; for (int j = 0; j < n - pos; j++) { if ((i / (1 << j)) % 2 == 1) { R += a[j + pos]; } }
		q[builtin_popcount(i)].push_back(R);
	}
	for (int i = 0; i < 30; i++)sort(p[i].begin(), p[i].end());
	for (int i = 0; i < 30; i++)sort(q[i].begin(), q[i].end());
	long long cnts = 0;
	for (int i = 0; i <= pos; i++) {
		int V = k - i; if (V < 0)continue;
		for (int j = 0; j < p[i].size(); j++) {
			int pos1 = lower_bound(q[V].begin(), q[V].end(), l - p[i][j]) - q[V].begin();
			int pos2 = lower_bound(q[V].begin(), q[V].end(), r + 1 - p[i][j]) - q[V].begin();
			cnts += pos2 - pos1;
		}
	}
	cout << cnts << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: 'builtin_popcount' was not declared in this scope
   12 |                 p[builtin_popcount(i)].push_back(R);
      |                   ^~~~~~~~~~~~~~~~
a.cc:16:19: error: 'builtin_popcount' was not declared in this scope
   16 |                 q[builtin_popcount(i)].push_back(R);
      |                   ^~~~~~~~~~~~~~~~
Language: C++

#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<math.h>
#include<numeric>
#include<cassert>
#include<random>
#include<deque>
#include<chrono>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pi;
const ll E=1e18+7;
#define F first
#define S second
#define MK make_pair
const ll MOD=1000000007;



int main(){
    ll n,k;
    cin>>n>>k;
    ll p=1;
    if(n>k){cout<<0<<endl return 0;}
    for(int i=0;i<n;i++){
        p*=k;
        k--;
        p%=MOD;
    }
    cout<<p<<endl;
    
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:26: error: expected ';' before 'return'
   37 |     if(n>k){cout<<0<<endl return 0;}
      |                          ^~~~~~~
      |                          ;
Language: C++

	long long res = ( part_num( n - k, k ) + part_num( n, k - 1 ) ) % MOD;
	C[n][k] = res;
	return res;
}

int main()
{
	int n, k;
	cin >> n >> k;

/*
	// Pascal's triangle for combination
	C[0][0] = 1;
	for( int i = 1; i < 1001; i++ ) {
		for( int j = 0; j <= i; j++ ) {
			if( j == 0 || j == i ) {
				C[i][j] = C[i - 1][0];
			}
			else {
				C[i][j] = ( C[i - 1][j - 1] + C[i - 1][j] ) % MOD;
			}
		}
	}
*/

	long long ans = 0;
	if( n >= k ) {
		ans = part_num( n - k, k );
	}

	cout << ans << endl;

	return 0;
}



Compiler output:
a.cc:1:37: error: 'n' was not declared in this scope
    1 |         long long res = ( part_num( n - k, k ) + part_num( n, k - 1 ) ) % MOD;
      |                                     ^
a.cc:1:41: error: 'k' was not declared in this scope
    1 |         long long res = ( part_num( n - k, k ) + part_num( n, k - 1 ) ) % MOD;
      |                                         ^
a.cc:1:44: error: 'k' was not declared in this scope
    1 |         long long res = ( part_num( n - k, k ) + part_num( n, k - 1 ) ) % MOD;
      |                                            ^
a.cc:1:27: error: 'part_num' was not declared in this scope
    1 |         long long res = ( part_num( n - k, k ) + part_num( n, k - 1 ) ) % MOD;
      |                           ^~~~~~~~
a.cc:1:60: error: 'n' was not declared in this scope
    1 |         long long res = ( part_num( n - k, k ) + part_num( n, k - 1 ) ) % MOD;
      |                                                            ^
a.cc:1:63: error: 'k' was not declared in this scope
    1 |         long long res = ( part_num( n - k, k ) + part_num( n, k - 1 ) ) % MOD;
      |                                                               ^
a.cc:1:50: error: 'part_num' was not declared in this scope
    1 |         long long res = ( part_num( n - k, k ) + part_num( n, k - 1 ) ) % MOD;
      |                                                  ^~~~~~~~
a.cc:1:75: error: 'MOD' was not declared in this scope
    1 |         long long res = ( part_num( n - k, k ) + part_num( n, k - 1 ) ) % MOD;
      |                                                                           ^~~
a.cc:2:9: error: 'C' does not name a type
    2 |         C[n][k] = res;
      |         ^
a.cc:3:9: error: expected unqualified-id before 'return'
    3 |         return res;
      |         ^~~~~~
a.cc:4:1: error: expected declaration before '}' token
    4 | }
      | ^
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope
    9 |         cin >> n >> k;
      |         ^~~
a.cc:28:23: error: 'part_num' was not declared in this scope
   28 |                 ans = part_num( n - k, k );
      |                       ^~~~~~~~
a.cc:31:9: error: 'cout' was not declared in this scope
   31 |         cout << ans << endl;
      |         ^~~~
a.cc:31:24: error: 'endl' was not declared in this scope
   31 |         cout << ans << endl;
      |                        ^~~~
Language: Java

import java.io.*;

class Main{

static final PrintWriter out=new PrintWriter(System.out);

public static class UnionFindTree{

private int[] par;
private int[] rank;

public UnionFindTree(int size){
par=new int[size];
rank=new int[size];
for(int i=0;i<n;i++){
par[i]=i;
rank[i]=0;
}
}

private static int find(int x){
if(par[x]==x) return x;
else return par[x]=find[x];
}

public static void unite(int x,int y){
x=find(x);
y=find(y);
if(x==y) return;
else if(rank[x]>rank[y]) par[y]=x;
else{
par[x]=y;
if(rank[x]==rank[y]) rank[y]++;
}
}

public static boolean same(int x,int y){
return find(x)==find(y);
}
}

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
int num=Integer.parseInt(br.readLine());
UnionFindTree tree=new UnionFindTree(num);
while((line=br.readLine())!=null&&!line.isEmpty()){
String[] values=line.split(" ");
int query=Integer.parseInt(values[0]);
int x=Integer.parseInt(values[1]);
int y=Integer.parseInt(values[2]);
if(query==0) tree.unite(x,y);
else out.println(tree.same(x,y)?"1":"0");
}
out.flush();
}
}

Compiler output:
Main.java:15: error: cannot find symbol
for(int i=0;i<n;i++){
              ^
  symbol:   variable n
  location: class UnionFindTree
Main.java:22: error: non-static variable par cannot be referenced from a static context
if(par[x]==x) return x;
   ^
Main.java:23: error: non-static variable par cannot be referenced from a static context
else return par[x]=find[x];
            ^
Main.java:23: error: cannot find symbol
else return par[x]=find[x];
                   ^
  symbol:   variable find
  location: class UnionFindTree
Main.java:30: error: non-static variable rank cannot be referenced from a static context
else if(rank[x]>rank[y]) par[y]=x;
        ^
Main.java:30: error: non-static variable rank cannot be referenced from a static context
else if(rank[x]>rank[y]) par[y]=x;
                ^
Main.java:30: error: non-static variable par cannot be referenced from a static context
else if(rank[x]>rank[y]) par[y]=x;
                         ^
Main.java:32: error: non-static variable par cannot be referenced from a static context
par[x]=y;
^
Main.java:33: error: non-static variable rank cannot be referenced from a static context
if(rank[x]==rank[y]) rank[y]++;
   ^
Main.java:33: error: non-static variable rank cannot be referenced from a static context
if(rank[x]==rank[y]) rank[y]++;
            ^
Main.java:33: error: non-static variable rank cannot be referenced from a static context
if(rank[x]==rank[y]) rank[y]++;
                     ^
11 errors