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

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

const int highest=100;

int gerden[11][11];

int main(){
    int d, w;
    while(cin >> d >> w){
        if(d==0 && w==0) break;
        for(int i=0; i<d; i++){
            for(int j=0; j<w; j++){
                cin >> gerden[i][j];
            }
        }

        int ans=0;
        for(int i=3; i<=d; i++){
            for(int j=3; j<=w; j++){    \\ 縦i横jの池候補
                for(int k=0; k<=d-i; k++){
                    for(int l=0; l<=w-j; l++){   \\ 池候補を縦横に動かす

                        int min_out=100, max_in=-1, capacity=0;
                        for(int m=k; m<i+k; m++){
                            for(int n=l; n<j+l; n++){   \\ 池かどうかを調べる(ついでに容量)
                                if(m==k || n==l || m==k+i-1 || n==l+j-1){
                                    if(gerden[m][n]<min_out){
                                        min_out = gerden[m][n];
                                    }
                                }else{
                                    capacity += highest - gerden[m][n];
                                    if(gerden[m][n]>max_in){
                                        max_in = gerden[m][n];
                                    }
                                }
                            }
                        }
                        if(max_in < min_out){
                            if(capacity-((100-min_out)*(i-2)*(j-2)) > ans ){
                                ans = capacity - ((100-min_out)*(i-2)*(j-2));
                            }
                        }

                    }
                }
            }
        }
        cout<<ans<<endl;
    }

    return 0;
}



Compiler output:
a.cc:20:41: error: stray '\' in program
   20 |             for(int j=3; j<=w; j++){    \\ 縦i横jの池候補
      |                                         ^
a.cc:20:42: error: stray '\' in program
   20 |             for(int j=3; j<=w; j++){    \\ 縦i横jの池候補
      |                                          ^
a.cc:22:50: error: stray '\' in program
   22 |                     for(int l=0; l<=w-j; l++){   \\ 池候補を縦横に動かす
      |                                                  ^
a.cc:22:51: error: stray '\' in program
   22 |                     for(int l=0; l<=w-j; l++){   \\ 池候補を縦横に動かす
      |                                                   ^
a.cc:26:57: error: stray '\' in program
   26 |                             for(int n=l; n<j+l; n++){   \\ 池かどうかを調べる(ついでに容量)
      |                                                         ^
a.cc:26:58: error: stray '\' in program
   26 |                             for(int n=l; n<j+l; n++){   \\ 池かどうかを調べる(ついでに容量)
      |                                                          ^
a.cc: In function 'int main()':
a.cc:20:44: error: '\U00007e26i\U00006a2aj\U0000306e\U00006c60\U00005019\U000088dc' was not declared in this scope
   20 |             for(int j=3; j<=w; j++){    \\ 縦i横jの池候補
      |                                            ^~~~~~~~~~~~~~
a.cc:21:30: error: 'k' was not declared in this scope
   21 |                 for(int k=0; k<=d-i; k++){
      |                              ^
Language: C++

#include <iostream>
using namespace std;

int d, w;
int cap = 0;
int e[10][10];

int hight_of_ike(int sx, int sy, int col, int row) {
    int suii = e[sy][sx];
    for (int y = sy; y <= sy + col; ++y) {
        for (int x = sx; x <= sx + row; ++x) {
            suii = max(suii, e[y][x]);
        }
    }
    return suii;
}

int hight_of_sto(int sx, int sy, int col, int row) {
    int hight = e[sy][sx];
    for (int y = sy; y <= sy + col; ++y) {
        for (int x = sx; x <= sx + row; ++x) {
            if (y > sy && y < sy + col && x > sx && x < sx + row) continue;
            hight = min(hight, e[y][x]);
        }
    }
    return hight;
}

int get_cap(int sto, int sx, int sy, int col, int row) {
    int tmp = 0;
    for (int y = sy; y <= sy + col; ++y) {
        for (int x = sx; x <= sx + row; ++x) {
            tmp += sto - e[y][x];
        }
    }
    return tmp;
}

int main() {
    while(cin >> d >> w, d||w) {
        cap = 0;
        for (int y = 0; y < d; ++y) {
            for (int x = 0; x < w; ++x) {
                cin >> e[y][x];
            }
        }
        for (int sy = 1; sy < d - 1; ++sy) {
            for (int sx = 1; sx < w - 1; ++sx) {
                for (int col = 0; sy + col < d - 1; ++col) {
                    for (int row = 0; sx + row < w - 1; ++row) {
                        int ike = hight_of_ike(sx, sy, col, row);
                        if (sto - ike > 0) {
                            cap = max(cap, get_cap(sto, sx, sy, col, row));
                        }
                    }
                }
            }
        }
        cout << cap << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:29: error: 'sto' was not declared in this scope; did you mean 'std'?
   52 |                         if (sto - ike > 0) {
      |                             ^~~
      |                             std
Language: C++

#include<iostream>
int main()
{
	int d,w;
	int e[100][100]={0};
	int min=10;
	int in=0;
	int x=0;
	int ans;
	
	while(d>0 && w>0){
		std::cin>>d>>w;
		if(d==0 && w==0) break;
		for(int i=0;i<d;i++){
			for(int j=0;j<w;j++){
				std::cin>>e[i][j];
			}
		}
		for(int i=0;i<d-2;i++){
			for(int j=i+2;j<d;j++){
				for(int k=0;k<w-2;k++){
					for(int l=k+2;l<w;l++){
						for(int m=i;m<=j;m++){
							for(int n=k;n<=1;n++){
								if(m==i || m==j || n==k || n==1){
									if(e[m][n]<min) min=e[m][n];
								}
							}
						}
						int max=0;
						for(int m=i+1;m<j;m++){
							for(int n=k+1;n<l;n++){
								if(e[m][n]>max) max=e[m][n];
								in+=e[m][n];
								x++;
							}
						}
						int tmp;
						if(min>max && (tmp(min*x-in))>ans){
							ans=tmp;
						}
					}
				}
			}
		}
		std::cout<<ans<<'\n';
	}
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:39:67: error: 'tmp' cannot be used as a function
   39 |                                                 if(min>max && (tmp(min*x-in))>ans){
      |                                                                ~~~^~~~~~~~~~
Language: C++

#include<iostream>

int e[100][100]={0};
int min=10;

int Pond(int a,int b,int c,int d){
  int x=0;
  for(int i=a+1;i<c+a-1;i++){
    for(int j=b+1;j<d+b-1;j++){
      int f=e[j][i];
      x+=(min-f);
    }
  }
  return f;
}

int area(int a,int b,int c,int d){
  int max=0;
  min=10;
  for(int i=b;i<d+b;i+;){
    int x1=e[i][a];
    int x2=e[i][a+c-1];
    if(x1>x2) x1=x2;
    if(min>x1) min=x1;
  }
  for(int i=a;i<a+c;i++){
    int x1=e[b][i];
    int x2=e[b+d-1][i];
    if(x1>x2) x1=x2;
    if(min>x1) min=x1;
  }
  for(int i=a+1;i<c+a-1;i++){
    for(int j=b+1;j<b+d-1;j++){
      int y=e[j][i];
      if(max<y) max=y;
    }
  }
	if(min>max) retrun 1;
	else return 0;
}

int main()
{
  int d,w;
  int in=0;
  int x=0;
  int ans;
  int tmp;

  while(d>0 && w>0){
    int max=0;
    std::cin>>d>>w;
    if(d==0 && w==0) break;
    for(int i=0;i<d;i++){
      for(int j=0;j<w;j++){
	std::cin>>e[i][j];
      }
    }
    for(int i=d;i>2;i--){
      for(int k=w;k>w;k--){
	for(int j=0;j<i-d+1;j++){
	  for(int l=0;l<k-w+1;l++){
	    if(Pond(l,j,k,i)==1){
	      tmp=area(l,j,k,i);
	      if(tmp>max){
		max=tmp;
	      }
	    }
	  }
	}
      }
      std::cout<<max<<'\n';
    }
    return 0;
  }



Compiler output:
a.cc: In function 'int Pond(int, int, int, int)':
a.cc:14:10: error: 'f' was not declared in this scope
   14 |   return f;
      |          ^
a.cc: In function 'int area(int, int, int, int)':
a.cc:20:23: error: expected primary-expression before ';' token
   20 |   for(int i=b;i<d+b;i+;){
      |                       ^
a.cc:20:23: error: expected ')' before ';' token
   20 |   for(int i=b;i<d+b;i+;){
      |      ~                ^
      |                       )
a.cc:20:24: error: expected primary-expression before ')' token
   20 |   for(int i=b;i<d+b;i+;){
      |                        ^
a.cc:38:21: error: 'retrun' was not declared in this scope
   38 |         if(min>max) retrun 1;
      |                     ^~~~~~
a.cc: In function 'int main()':
a.cc:75:4: error: expected '}' at end of input
   75 |   }
      |    ^
a.cc:43:1: note: to match this '{'
   43 | {
      | ^
a.cc: In function 'int area(int, int, int, int)':
a.cc:40:1: warning: control reaches end of non-void function [-Wreturn-type]
   40 | }
      | ^
Language: Java

import java.util.*;
public class D {
	static int[] mrk=new int[5000000];
	static int[][] stk=new int[4000000][2];
	static int[] a=new int[1000];
	static int l[]=new int[2];
	static int fl=0;
	static int bdf(int x,int l,int n){
		int y=0;
		for(int i=0;i<l;i++)
			for (int j=1;j<=n;j++)
				if (mrk[stk[i][fl%2]^a[j]]==0){
					if((stk[i][fl%2]^a[j])==x) return(fl+1);
					mrk[stk[i][fl%2]^a[j]]=1;
					stk[y][(fl+1)%2]=stk[i][fl%2]^a[j];
					y++;
				}
		fl++;
		return(bdf(x,y,n));
	}
	static int check(int x,int[][] c,int n,int m){
		int y=1;
		int res=0;
		int[] a=new int [100];
		for (int j=1;j<=m;j++)a[j]=0;
		for (int i=1;i<=n;i++){
			if ((x&y)==y){
				res++;
				for (int j=1;j<=m;j++){
					a[j]=(a[j]+c[i][j])%2;
				}
			}
			y=y*2;
		}
		for (int j=1;j<=m;j++)if (a[j]!=0) return(-1);
		return(res);
	}
	static int toint(int[] x,int m){
		int y=1;
		int res=0;
		for (int i=1;i<=m;i++){
			if (x[i]==1) res=res+y;
			y=y*2;
		}
		return(res);
	}
	
	public static void main(String args[]){
		Scanner cs=new Scanner(System.in);
		while(true){
			int n=cs.nextInt();
			int m=cs.nextInt();
			int ans=0;
			if (n==0)break;
			int c[][]=new int[n+1][m+1];
			String s;
			cs.nextLine();
			for (int i=1;i<=n;i++){
				s=cs.nextLine();
				for(int j=1;j<=m;j++){
					c[i][j]=s.charAt(j-1)-48;
				}
			}
			if (n<23){
				int x=1;
				for (int i=0;i<n;i++){
					x=x*2;
				}
				for (int i=0;i<x;i++){
					int y=check(i,c,n,m);
					if (ans<y)ans=y;
				}
			}else{
				int x=0;
				for (int i=1;i<=n;i++){
					a[i]=toint(c[i],m);
					x=x^toint(c[i],m);
				}
				for (int i=0;i<4000000;i++)
					mrk[i]=0;
				boolean y[]=new boolean[1000];
				stk[0][0]=0;
				if (x==0)ans=n;else
				ans=n-bdf(x,1,n);
			}
		System.out.println(ans);
		}
	}
}


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

#include<iostream>

int source[500][500] = {};

void copy_array(int a[],int b[],int m){
    for(int i=0;i<m;i++){
        b[i] = a[i];
    }
}

bool check(int n,int m,int sum[]){
    for(int j=0;j<m;j++){
        if(sum[j] %2 == 1) return false;
    }
    //std::cout << "      ";
    /*for(int j=0;j<m;j++){
        std::cout << sum[j] << ' ';
    }
    std::cout << '\n';
     */
    return true;
}

bool sum_calc(int f_num,int f_pos,int m,int n,int pri_sum[]){
    //std::cout << "再起\n";
    int sum[500] = {};
    //std::cout << "f_num=" << f_num << '\n';
    for(int i=f_pos;i<n-f_num+1;i++){
        //std::cout << "f_num=" << f_num << "  f_pos=" << i << '\n';
        copy_array(pri_sum,sum,m);
        
        for(int j=0;j<m;j++){
            sum[j] -= source[i][j];
        }
        
        f_num--;
        if(f_num==0){
            //std::cout << "      f_num=0\n";
            if(check(n,m,sum)){
                return true;
            }else{
                //std::cout << "失敗した\n";
                f_num++;
            }
        }else{
            if(sum_calc(f_num,i+1,m,n,sum)){
                return true;
            }else{
                f_num++;
            }
        }
    }
    //std::cout << "終了\n";
    return false;
}

void to_int(char s[],int i){
    int j=0;
    while(s[j] != '\0'){
        if(s[j] == '0'){
            source[i][j++] = 0;
        }else{
            source[i][j++] = 1;
        }
    }
}

int search(int n,int m,int sum[]){
    for(int f_num=1;f_num<n;f_num++){
        //std::cout << "f_num=" << f_num << '\n';
        if(sum_calc(f_num,0,m,n,sum)) return f_num;
    }
    return n;
}

int main(){
    int n,m;
    while(1){
        std::cin >> n >> m;
        if(n==0&&m==0) return 0;
        //std::cout << "n:" << n <<" m:" << m << '\n';
        char s[500];
        for(int i=0;i<n;i++){
            std::cin >> s ;
            to_int(s,i);
        }
        
        /*for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                std::cout << source[i][j] << ' ';
            }
            std::cout << '\n';
        }
        */
        int sum[500] = {};
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                sum[j] += source[i][j];
            }
        }
        
        if(check(n,m,sum)){
            std::cout << /*"ans=" <<*/ n << '\n';
        }else{
            int ans=n-search(n,m,sum);
            std::cout << /*"ans=" <<*/ ans << '\n';
        }
        //std::cout << '\n';
    }
    /*for(int j=0;j<m;j++){
     std::cout << sum[j] << ' ' ;
     }
     std::cout << '\n';
     */
    
    return 0;
}


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

#include <stdio.h>
#include <string.h>
#include <limits.h>

int b[501][501];
int B[501];
int sum[501];
int dp[30][1<<22];


int main(void){
	int n, m, ans, count;
	bool flag;

	while(1){
		scanf("%d %d", &n, &m);
		if(n == 0 && m== 0) break;

		if(n<22){
			for(int i=0; i<n; i++){
				for(int j=0; j<m; j++){
					scanf(" %c", &b[i][j]);
					b[i][j] -= '0';
				}
			}

			ans = 0;
			for(int i=0; i<(1<<n); i++){
				count = 0;
				memset(sum, 0, sizeof(sum));
				for(int j=0; j<n; j++){
					if((i>>j)%2 == 0){
						count++;
						for(int k=0; k<m; k++) sum[k] += b[j][k];
					}
				}

				flag = true;
				for(int k=0; k<m; k++){
					if(sum[k]%2 == 1){
						flag = false;
						break;
					}
				}
				if(flag == true && ans < count) ans = count;
			}
			printf("%d\n", ans);

		} else{
			for(int i=0; i<n; i++){
				B[i] = 0;
				for(int j=0; j<m; j++){
					scanf(" %c", &b[i][j]);
					b[i][j] = b[i][j] - '0';
					B[i] += (b[i][j] << j);
				}
			}

			for(int i=0; i<30; i++){
				for(int j=0; j<(1<<m); j++){
					dp[i][j] = INT_MIN;
				}
			}

			dp[0][0] = 0;
			for(int i=0; i<n; i++){
				for(int j=0; j<(1<<m); j++){
					if(dp[i][j] < 0) continue;
					if(dp[i+1][j] < dp[i][j]) dp[i+1][j] = dp[i][j];
					if(dp[i+1][j^B[i]] < dp[i][j] + 1) dp[i+1][j^B[i]] = dp[i][j] + 1;
				}
			}
			ans = dp[n][0];
			printf("%d\n", ans);
		}

	}//endwhile
	return 0;
}




Compiler output:
main.c: In function 'main':
main.c:13:9: error: unknown type name 'bool'
   13 |         bool flag;
      |         ^~~~
main.c:4:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    3 | #include <limits.h>
  +++ |+#include <stdbool.h>
    4 | 
main.c:38:40: error: 'true' undeclared (first use in this function)
   38 |                                 flag = true;
      |                                        ^~~~
main.c:38:40: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:38:40: note: each undeclared identifier is reported only once for each function it appears in
main.c:41:56: error: 'false' undeclared (first use in this function)
   41 |                                                 flag = false;
      |                                                        ^~~~~
main.c:41:56: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

#include <stdio.h>
#include <string.h>

int b[501][501];
int B[501];
int sum[501];
int dp[30][1<<22];


int main(void){
	int n, m, ans, count;
	bool flag;

	while(1){
		scanf("%d %d", &n, &m);
		if(n == 0 && m== 0) break;

		if(n<22){
			for(int i=0; i<n; i++){
				for(int j=0; j<m; j++){
					scanf(" %c", &b[i][j]);
					b[i][j] -= '0';
				}
			}

			ans = 0;
			for(int i=0; i<(1<<n); i++){
				count = 0;
				memset(sum, 0, sizeof(sum));
				for(int j=0; j<n; j++){
					if((i>>j)%2 == 0){
						count++;
						for(int k=0; k<m; k++) sum[k] += b[j][k];
					}
				}

				flag = true;
				for(int k=0; k<m; k++){
					if(sum[k]%2 == 1){
						flag = false;
						break;
					}
				}
				if(flag == true && ans < count) ans = count;
			}
			printf("%d\n", ans);

		} else{
			for(int i=0; i<n; i++){
				B[i] = 0;
				for(int j=0; j<m; j++){
					scanf(" %c", &b[i][j]);
					b[i][j] = b[i][j] - '0';
					B[i] += (b[i][j] << j);
				}
			}

			for(int i=0; i<30; i++){
				for(int j=0; j<(1<<m); j++){
					dp[i][j] = -999999999;
				}
			}

			dp[0][0] = 0;
			for(int i=0; i<n; i++){
				for(int j=0; j<(1<<m); j++){
					if(dp[i][j] < 0) continue;
					if(dp[i+1][j] < dp[i][j]) dp[i+1][j] = dp[i][j];
					if(dp[i+1][j^B[i]] < dp[i][j] + 1) dp[i+1][j^B[i]] = dp[i][j] + 1;
				}
			}
			ans = dp[n][0];
			printf("%d\n", ans);
		}

	}//endwhile
	return 0;
}




Compiler output:
main.c: In function 'main':
main.c:12:9: error: unknown type name 'bool'
   12 |         bool flag;
      |         ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    2 | #include <string.h>
  +++ |+#include <stdbool.h>
    3 | 
main.c:37:40: error: 'true' undeclared (first use in this function)
   37 |                                 flag = true;
      |                                        ^~~~
main.c:37:40: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:37:40: note: each undeclared identifier is reported only once for each function it appears in
main.c:40:56: error: 'false' undeclared (first use in this function)
   40 |                                                 flag = false;
      |                                                        ^~~~~
main.c:40:56: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int dp[2][1 << 22];

int main(void){
	while(1){
		int n, m; cin >> n >> m;
		if(!n && !m) break;

		int b[505][505]={0};
		for(int i=1; i<=n; i++){
			for(int j=0; j<m; j++){
				char c; cin >> c;
				b[i][j] = c - '0';
			}
		}

		int ans = 0;
		if(n <= 22){
			int S = 1 << n;
			for(int i=0; i<S; i++){
				int cnt = 0;
				int ingredient[501]={0};//材料
				for(int j=1; j<=n; j++){
					if((i & (1<<(j-1))) == 0) continue;
					cnt++;
					for(int k=0; k<m; k++) ingredient[k] ^= b[j][k];
				}
				bool flag = true;
				for(int j=0; j<m; j++){
					if(ingredient[j] == 1){
						flag = false;
						break;
					}
				}
				if(flag) ans = max(ans, cnt);
			}
		}else{
			int B[501]={0};
			for(int i=1; i<=n; i++){
				for(int j=0; j<m; j++){
					B[i] |= (b[i][j] << j);
				}
			}

			int S = 1 << m;
			for(int i=0; i<S; i++) dp[0][i] = dp[1][i] = INT_MIN;
			dp[0][0] = 0;
			for(int i=0; i<n; i++){
				for(int j=0; j<S; j++){
					dp[(i+1)%2][j^B[i+1]] = max(dp[(i+1)%2][j^B[i+1]], dp[i%2][j] + 1);
					dp[(i+1)%2][j] = max(dp[(i+1)%2][j], dp[i%2][j]);
				}
			}
			ans = dp[n%2][0];
		}
		cout << ans << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:70: error: 'INT_MIN' was not declared in this scope
   50 |                         for(int i=0; i<S; i++) dp[0][i] = dp[1][i] = INT_MIN;
      |                                                                      ^~~~~~~
a.cc:3:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <algorithm>
  +++ |+#include <climits>
    3 |
Language: C++

#include <iostream>
#include <algorithm>
#include <limits>

using namespace std;

int dp[2][1 << 22];

int main(void){
	while(1){
		int n, m; cin >> n >> m;
		if(!n && !m) break;

		int b[505][505]={0};
		for(int i=1; i<=n; i++){
			for(int j=0; j<m; j++){
				char c; cin >> c;
				b[i][j] = c - '0';
			}
		}

		int ans = 0;
		if(n <= 22){
			int S = 1 << n;
			for(int i=0; i<S; i++){
				int cnt = 0;
				int ingredient[501]={0};//材料
				for(int j=1; j<=n; j++){
					if((i & (1<<(j-1))) == 0) continue;
					cnt++;
					for(int k=0; k<m; k++) ingredient[k] ^= b[j][k];
				}
				bool flag = true;
				for(int j=0; j<m; j++){
					if(ingredient[j] == 1){
						flag = false;
						break;
					}
				}
				if(flag) ans = max(ans, cnt);
			}
		}else{
			int B[501]={0};
			for(int i=1; i<=n; i++){
				for(int j=0; j<m; j++){
					B[i] |= (b[i][j] << j);
				}
			}

			int S = 1 << m;
			for(int i=0; i<S; i++) dp[0][i] = dp[1][i] = INT_MIN;
			dp[0][0] = 0;
			for(int i=0; i<n; i++){
				for(int j=0; j<S; j++){
					dp[(i+1)%2][j^B[i+1]] = max(dp[(i+1)%2][j^B[i+1]], dp[i%2][j] + 1);
					dp[(i+1)%2][j] = max(dp[(i+1)%2][j], dp[i%2][j]);
				}
			}
			ans = dp[n%2][0];
		}
		cout << ans << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:70: error: 'INT_MIN' was not declared in this scope
   51 |                         for(int i=0; i<S; i++) dp[0][i] = dp[1][i] = INT_MIN;
      |                                                                      ^~~~~~~
a.cc:4:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <limits>
  +++ |+#include <climits>
    4 |
Language: C++

#include <iostream>
#include <algorithm>
#include <climits>

using namespace std;

int dp[2][1 << 22];

int main(v1){
		int n, m; cin >> n >> m;
		if(!n && !m) break;

		int b[505][505]={0};
		for(int i=1; i<=n; i++){
			for(int j=0; j<m; j++){
				char c; cin >> c;
				b[i][j] = c - '0';
			}
		}

		int ans = 0;
		if(n <= 22){
			int S = 1 << n;
			for(int i=0; i<S; i++){
				int cnt = 0;
				int ingredient[501]={0};//材料
				for(int j=1; j<=n; j++){
					if((i & (1<<(j-1))) == 0) continue;
					cnt++;
					for(int k=0; k<m; k++) ingredient[k] ^= b[j][k];
				}
				bool flag = true;
				for(int j=0; j<m; j++){
					if(ingredient[j] == 1){
						flag = false;
						break;
					}
				}
				if(flag) ans = max(ans, cnt);
			}
		}else{
			int B[501]={0};
			for(int i=1; i<=n; i++){
				for(int j=0; j<m; j++){
					B[i] |= (b[i][j] << j);
				}
			}

			int S = 1 << m;
			fill(dp[0], dp[1], INT_MIN);
			//for(int i=0; i<S; i++) dp[0][i] = dp[1][i] = INT_MIN;
			dp[0][0] = 0;
			for(int i=0; i<n; i++){
				for(int j=0; j<S; j++){
					dp[(i+1)%2][j^B[i+1]] = max(dp[(i+1)%2][j^B[i+1]], dp[i%2][j] + 1);
					dp[(i+1)%2][j] = max(dp[(i+1)%2][j], dp[i%2][j]);
				}
			}
			ans = dp[n%2][0];
		}
		cout << ans << endl;
	}
	return 0;
}


Compiler output:
a.cc:9:5: error: cannot declare '::main' to be a global variable
    9 | int main(v1){
      |     ^~~~
a.cc:9:10: error: 'v1' was not declared in this scope; did you mean '__pstl::execution::v1'?
    9 | int main(v1){
      |          ^~
      |          __pstl::execution::v1
In file included from /usr/include/c++/14/pstl/glue_algorithm_defs.h:15,
                 from /usr/include/c++/14/algorithm:86,
                 from a.cc:2:
/usr/include/c++/14/pstl/execution_defs.h:19:18: note: '__pstl::execution::v1' declared here
   19 | inline namespace v1
      |                  ^~
a.cc:63:9: error: expected unqualified-id before 'return'
   63 |         return 0;
      |         ^~~~~~
a.cc:64:1: error: expected declaration before '}' token
   64 | }
      | ^
Language: C++

#pragma GCC optimize("O3")
#pragma GCC target("avx")
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

typedef unsigned long long parallel_type;
const int bit_width=8*sizeof(parallel_type);

int main(){
	int H,W;
	for(;~scanf("%d%d",&H,&W)&&H&&W;){
		vector<string>m(H);
		for(int h=0;h<H;h++)cin>>m[h];
		if(H<=21){
			vector<vector<parallel_type> >l(H);
			int parallel_width=(W+bit_width-1)/bit_width;
			for(int h=0;h<H;h++){
				l[h].resize(parallel_width);
				for(int w=0;w<W;w++)l[h][w/bit_width]|=parallel_type(m[h][w]=='1')<<(w%bit_width);
			}
			int R=0;
			for(int i=0;i<1<<H;i++){
				vector<parallel_type> v(parallel_width);
				int r=0;
				for(int j=0;j<H;j++)if(i>>j&1){
					r++;
					for(int k=0;k<parallel_width;k++)v[k]^=l[j][k];
				}
				if(none_of(v.begin(),v.end(),[](parallel_type e){return e;}))R=max(R,r);
			}
			cout<<R<<endl;
		}else{
			vector<int>b(H);
			for(int h=0;h<H;h++){
				for(int w=0;w<W;w++)b[h]=(b[h]<<1)|(m[h][w]=='1');
			}
			vector<short>s(1<<W),t(1<<W);
			for(int w=1;w<1<<W;w++)s[w]=-1;
			for(int h=0;h<H;h++){
				for(int w=0;w<1<<W;w++){
					t[w]=max(s[w],short(s[w^b[h]]>=0 ? 1+s[w^b[h]] : -1));
				}
				swap(s,t);
			}
			cout<<s[0]<<endl;
		}
	}
}

Compiler output:
In file included from /usr/include/c++/14/string:43,
                 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:3:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::__cxx11::basic_string<char>::_Alloc_hider::~_Alloc_hider()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = char]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/string:54:
/usr/include/c++/14/bits/basic_string.h:186:14: note: called from here
  186 |       struct _Alloc_hider : allocator_type // TODO check __is_final
      |              ^~~~~~~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int n,m;
string s[1000];
int dp[2][1<<25];
//t=100?????????0????????¨,
//t=101?????????0??¨2????????¨
int N=-1;
		vector<bool>tmp(0);
int dfs(int h,string t){//h????????±???,t????????¨????????¬??????
	if(h==n){
		int cnt=0;

		for(int i=0;i<n;i++)[i]=0;
		
		for(int i=0;i<t.size();i++){
			if(t[i]-'0'==1)cnt++;//?????¨????????°
		}

		for(int i=0;i<t.size();i++){
			bool f=t[i]-'0';
			if(f){//?????¨????????¬????????????
				for(int j=0;j<s[i].size();j++){
					tmp[j]=tmp[j]^(s[i][j]-'0');
				}
			}
		}

		for(int i=0;i<tmp.size();i++)if(tmp[i])return 0;
		return cnt;
	}

	return max(dfs(h+1,t+"1"),dfs(h+1,t+"0"));
}

int twoToTen(string x){
	int sum=0;
	for(int i=x.size()-1;i>=0;i--){
		if(x[i]-'0'==1)sum+=1<<(x.size()-i-1);
	}
	return sum;
}


int dpp(){
	for(int i=0;i<(1<<m);i++)
	dp[0][i]=dp[1][i]=N;

		dp[0][0]=0;

	for(int i=0;i<n;i++){
		for(int j=0;j<1<<m;j++){
		if((i+1)%2==1){
			if(dp[0][j]!=N){
				//cout<<i<<" "<<j<<"A"<<endl;
				int now=twoToTen(s[i]);//????????¬????????????10????????§?????????????????????
				dp[1][j^now]=max(dp[1][j^now],dp[0][j]+1);
				dp[1][j]=max(dp[1][j],dp[0][j]);
			}

		}
		else{
				if(dp[1][j]!=N){
				//cout<<i<<" "<<j<<"A"<<endl;
				int now=twoToTen(s[i]);//????????¬????????????10????????§?????????????????????
				dp[0][j^now]=max(dp[0][j^now],dp[1][j]+1);
				dp[0][j]=max(dp[0][j],dp[1][j]);
		}
		}
	}
	}

	return dp[n%2][0];
}


int main(){
	while(cin>>n>>m,n||m){
	tmp.resize(n);
	//for(int i=0;i<n;i++)tmp[i]=0;
	for(int i=0;i<n;i++)cin>>s[i];
	if(n<=m)cout<<dfs(0,"")<<endl;
	else cout<<dpp()<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In lambda function:
a.cc:17:40: error: expected '{' before '=' token
   17 |                 for(int i=0;i<n;i++)[i]=0;
      |                                        ^
a.cc: In function 'int dfs(int, std::string)':
a.cc:17:41: error: no match for 'operator=' (operand types are 'dfs(int, std::string)::<lambda()>' and 'int')
   17 |                 for(int i=0;i<n;i++)[i]=0;
      |                                         ^
a.cc:17:39: note: candidate: 'dfs(int, std::string)::<lambda()>& dfs(int, std::string)::<lambda()>::operator=(const dfs(int, std::string)::<lambda()>&)' (deleted)
   17 |                 for(int i=0;i<n;i++)[i]=0;
      |                                       ^
a.cc:17:39: note:   no known conversion for argument 1 from 'int' to 'const dfs(int, std::string)::<lambda()>&'
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int n,m;
string s[1000];
int dp[2][1<<23];
//t=100?????????0????????¨,
//t=101?????????0??¨2????????¨
int N=-1;
bool tmp[1000];

int dfs(int h,string t){//h????????±???,t????????¨????????¬??????
	if(h==n){
		//cout<<h<<endl;
		int cnt=0;
		for(int i=0;i<m;i++)tmp[i]=0;
		
		for(int i=0;i<n;i++){
			if(t[i]-'0'==1)cnt++;//?????¨????????°
		}

		for(int i=0;i<n;i++){
			bool f=t[i]-'0';
			if(f){//?????¨????????¬????????????
				for(int j=0;j<s[i].size();j++){
					tmp[j]=tmp[j]^(s[i][j]-'0');
				}
			}
		}

		for(int i=0;i<m;i++)if(tmp[i])return 0;
		return cnt;
	}

	return max(dfs(h+1,t+"1"),dfs(h+1,t+"0"));
}

int twoToTen(string x){
	int sum=0;
	int x.size()=xs;
	for(int i=xs;i>=0;i--){
		if(x[i]-'0'==1)sum+=1<<(xs-i-1);
	}
	return sum;
}


int dpp(){
	for(int i=0;i<(1<<m);i++)
	dp[0][i]=dp[1][i]=N;

		dp[0][0]=0;

	for(int i=0;i<n;i++){
		for(int j=0;j<1<<m;j++){
		if((i+1)%2==1){
			if(dp[0][j]!=N){
				//cout<<i<<" "<<j<<"A"<<endl;
				int now=twoToTen(s[i]);//????????¬????????????10????????§?????????????????????
				dp[1][j^now]=max(dp[1][j^now],dp[0][j]+1);
				dp[1][j]=max(dp[1][j],dp[0][j]);
			}

		}
		else{
				if(dp[1][j]!=N){
				//cout<<i<<" "<<j<<"A"<<endl;
				int now=twoToTen(s[i]);//????????¬????????????10????????§?????????????????????
				dp[0][j^now]=max(dp[0][j^now],dp[1][j]+1);
				dp[0][j]=max(dp[0][j],dp[1][j]);
		}
		}
	}
	}

	return dp[n%2][0];
}


int main(){
	while(cin>>n>>m,n||m){

	for(int i=0;i<n;i++)cin>>s[i];

	if(n<=m)cout<<dfs(0,"")<<endl;
	else cout<<dpp()<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int twoToTen(std::string)':
a.cc:42:14: error: expected initializer before '.' token
   42 |         int x.size()=xs;
      |              ^
a.cc:43:19: error: 'xs' was not declared in this scope; did you mean 'x'?
   43 |         for(int i=xs;i>=0;i--){
      |                   ^~
      |                   x
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int n,m;
string s[1000];
int dp[2][1<<23];
//t=100?????????0????????¨,
//t=101?????????0??¨2????????¨
int N=-1;
bool tmp[1000];

int dfs(int h,string t){//h????????±???,t????????¨????????¬??????
	if(h==n){

		int cnt=0;
		//for(int i=0;i<m;i++)tmp[i]=0;
		memset(tmp,0,sizeof tmp);

		for(int i=0;i<n;i++){
			bool f=t[i]-'0';
			if(f){//?????¨????????¬????????????
				for(int j=0;j<s[i].size();j++){
					tmp[j]=tmp[j]^(s[i][j]-'0');
				}
				cnt++;
			}
		}

		for(int i=0;i<m;i++)if(tmp[i])return 0;
		return cnt;
	}

	return max(dfs(h+1,t+"1"),dfs(h+1,t+"0"));
}

int twoToTen(string x){
	int sum=0;
	int xs=x.size();
	for(int i=xs;i>=0;i--){
		if(x[i]-'0'==1)sum+=1<<(xs-i-1);
	}
	return sum;
}


int dpp(){
	for(int i=0;i<(1<<m);i++)
	dp[0][i]=dp[1][i]=N;

		dp[0][0]=0;

	for(int i=0;i<n;i++){
		for(int j=0;j<1<<m;j++){
		if((i+1)%2==1){
			if(dp[0][j]!=N){
				//cout<<i<<" "<<j<<"A"<<endl;
				int now=twoToTen(s[i]);//????????¬????????????10????????§?????????????????????
				dp[1][j^now]=max(dp[1][j^now],dp[0][j]+1);
				dp[1][j]=max(dp[1][j],dp[0][j]);
			}

		}
		else{
				if(dp[1][j]!=N){
				//cout<<i<<" "<<j<<"A"<<endl;
				int now=twoToTen(s[i]);//????????¬????????????10????????§?????????????????????
				dp[0][j^now]=max(dp[0][j^now],dp[1][j]+1);
				dp[0][j]=max(dp[0][j],dp[1][j]);
		}
		}
	}
	}

	return dp[n%2][0];
}


int main(){
	while(cin>>n>>m,n||m){

	for(int i=0;i<n;i++)cin>>s[i];

	if(n<=m)cout<<dfs(0,"")<<endl;
	else cout<<dpp()<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int dfs(int, std::string)':
a.cc:19:17: error: 'memset' was not declared in this scope
   19 |                 memset(tmp,0,sizeof tmp);
      |                 ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<vector>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cstdio>
using namespace std;
int n,m;
string s[1000];
int dp[2][1<<23];
//t=100?????????0????????¨,
//t=101?????????0??¨2????????¨
int N=-1;
bool tmp[1000];

int dfs(int h,string t){//h????????±???,t????????¨????????¬??????
	if(h==n){

		int cnt=0;
		//for(int i=0;i<m;i++)tmp[i]=0;
		memset(tmp,0,sizeof tmp);

		for(int i=0;i<n;i++){
			bool f=t[i]-'0';
			if(f){//?????¨????????¬????????????
				for(int j=0;j<s[i].size();j++){
					tmp[j]=tmp[j]^(s[i][j]-'0');
				}
				cnt++;
			}
		}

		for(int i=0;i<m;i++)if(tmp[i])return 0;
		return cnt;
	}

	return max(dfs(h+1,t+"1"),dfs(h+1,t+"0"));
}

int twoToTen(string x){
	int sum=0;
	int xs=x.size();
	for(int i=xs;i>=0;i--){
		if(x[i]-'0'==1)sum+=1<<(xs-i-1);
	}
	return sum;
}


int dpp(){
	for(int i=0;i<(1<<m);i++)
	dp[0][i]=dp[1][i]=N;

		dp[0][0]=0;

	for(int i=0;i<n;i++){
		for(int j=0;j<1<<m;j++){
		if((i+1)%2==1){
			if(dp[0][j]!=N){
				//cout<<i<<" "<<j<<"A"<<endl;
				int now=twoToTen(s[i]);//????????¬????????????10????????§?????????????????????
				dp[1][j^now]=max(dp[1][j^now],dp[0][j]+1);
				dp[1][j]=max(dp[1][j],dp[0][j]);
			}

		}
		else{
				if(dp[1][j]!=N){
				//cout<<i<<" "<<j<<"A"<<endl;
				int now=twoToTen(s[i]);//????????¬????????????10????????§?????????????????????
				dp[0][j^now]=max(dp[0][j^now],dp[1][j]+1);
				dp[0][j]=max(dp[0][j],dp[1][j]);
		}
		}
	}
	}

	return dp[n%2][0];
}


int main(){
	while(cin>>n>>m,n||m){

	for(int i=0;i<n;i++)cin>>s[i];

	if(n<=m)cout<<dfs(0,"")<<endl;
	else cout<<dpp()<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int dfs(int, std::string)':
a.cc:20:17: error: 'memset' was not declared in this scope
   20 |                 memset(tmp,0,sizeof tmp);
      |                 ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include<cstdio>
  +++ |+#include <cstring>
    6 | using namespace std;
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<stdio.h>
using namespace std;
int n,m;
string s[1000];
int dp[2][1<<23];
//t=100?????????0????????¨,
//t=101?????????0??¨2????????¨
int N=-1;
bool tmp[1000];
bool s2[501][501];

int dfs(int h,string t){//h????????±???,t????????¨????????¬??????
	if(h==n){

		int cnt=0;
		//for(int i=0;i<m;i++)tmp[i]=0;
		memset(tmp,0,sizeof tmp);

		for(int i=0;i<n;i++){
			bool f=t[i]-'0';
			if(f){//?????¨????????¬????????????
				for(int j=0;j<m;j++){
					tmp[j]=tmp[j]^(s2[i][j]);
				}
				cnt++;
			}
		}

		for(int i=0;i<m;i++)if(tmp[i])return 0;
		return cnt;
	}

	return max(dfs(h+1,t+"1"),dfs(h+1,t+"0"));
}

int twoToTen(string x){
	int sum=0;
	int xs=x.size();
	for(int i=xs;i>=0;i--){
		if(x[i]-'0'==1)sum+=1<<(xs-i-1);
	}
	return sum;
}


int dpp(){
	for(int i=0;i<(1<<m);i++)
	dp[0][i]=dp[1][i]=N;

		dp[0][0]=0;

	for(int i=0;i<n;i++){
		for(int j=0;j<1<<m;j++){
		if((i+1)%2==1){
			if(dp[0][j]!=N){
				//cout<<i<<" "<<j<<"A"<<endl;
				int now=twoToTen(s[i]);//????????¬????????????10????????§?????????????????????
				dp[1][j^now]=max(dp[1][j^now],dp[0][j]+1);
				dp[1][j]=max(dp[1][j],dp[0][j]);
			}

		}
		else{
				if(dp[1][j]!=N){
				//cout<<i<<" "<<j<<"A"<<endl;
				int now=twoToTen(s[i]);//????????¬????????????10????????§?????????????????????
				dp[0][j^now]=max(dp[0][j^now],dp[1][j]+1);
				dp[0][j]=max(dp[0][j],dp[1][j]);
		}
		}
	}
	}

	return dp[n%2][0];
}


int main(){
	while(cin>>n>>m,n||m){

	for(int i=0;i<n;i++)cin>>s[i];
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++)s2[i][j]=s[i][j]-'0';
	}
	if(n<=m)cout<<dfs(0,"")<<endl;
	else cout<<dpp()<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int dfs(int, std::string)':
a.cc:22:17: error: 'memset' was not declared in this scope
   22 |                 memset(tmp,0,sizeof tmp);
      |                 ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include<cstdio>
  +++ |+#include <cstring>
    6 | #include<stdio.h>
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<bitset>
#include<stdio.h>
using namespace std;
int n,m;
string s[1000];
int dp[2][1<<23];
//t=100?????????0????????¨,
//t=101?????????0??¨2????????¨
int N=-1;
bool tmp[1000];
bool s2[501][501];

int dfs(int h,string t){//h????????±???,t????????¨????????¬??????
	if(h==n){

		int cnt=0;
		//for(int i=0;i<m;i++)tmp[i]=0;
		memset(tmp,0,sizeof tmp);

		for(int i=0;i<n;i++){
			bool f=t[i]-'0';
			if(f){//?????¨????????¬????????????
				for(int j=0;j<m;j++){
					tmp[j]=tmp[j]^(s2[i][j]);
				}
				cnt++;
			}
		}

		for(int i=0;i<m;i++)if(tmp[i])return 0;
		return cnt;
	}

	return max(dfs(h+1,t+"1"),dfs(h+1,t+"0"));
}

int twoToTen(string x){
	int sum=0;
	int xs=x.size();
	for(int i=xs;i>=0;i--){
		if(x[i]-'0'==1)sum+=1<<(xs-i-1);
	}
	return sum;
}


int dpp(){
	for(int i=0;i<(1<<m);i++)
	dp[0][i]=dp[1][i]=N;

		dp[0][0]=0;

	for(int i=0;i<n;i++){
		for(int j=0;j<1<<m;j++){
		if((i+1)%2==1){
			if(dp[0][j]!=N){
				//cout<<i<<" "<<j<<"A"<<endl;
				int now=twoToTen(s[i]);//????????¬????????????10????????§?????????????????????
				dp[1][j^now]=max(dp[1][j^now],dp[0][j]+1);
				dp[1][j]=max(dp[1][j],dp[0][j]);
			}

		}
		else{
				if(dp[1][j]!=N){
				//cout<<i<<" "<<j<<"A"<<endl;
				int now=twoToTen(s[i]);//????????¬????????????10????????§?????????????????????
				dp[0][j^now]=max(dp[0][j^now],dp[1][j]+1);
				dp[0][j]=max(dp[0][j],dp[1][j]);
		}
		}
	}
	}

	return dp[n%2][0];
}


int main(){
	while(cin>>n>>m,n||m){

	for(int i=0;i<n;i++)cin>>s[i];
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++)s2[i][j]=s[i][j]-'0';
	}
	if(n<=m)cout<<dfs(0,"")<<endl;
	else cout<<dpp()<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int dfs(int, std::string)':
a.cc:23:17: error: 'memset' was not declared in this scope
   23 |                 memset(tmp,0,sizeof tmp);
      |                 ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include<bitset>
  +++ |+#include <cstring>
    7 | #include<stdio.h>
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<bitset>
#include<cassert>
#include<climits>
#include<stdio.h>
using namespace std;
int n,m;
string s[1000];
int dp[2][1<<23];
//t=100?????????0????????¨,
//t=101?????????0??¨2????????¨
int N=-1;
bool tmp[1000];
bool s2[501][501];

int dfs(int h,string t){//h????????±???,t????????¨????????¬??????
	if(h==n){

		int cnt=0;
		//for(int i=0;i<m;i++)tmp[i]=0;
		memset(tmp,0,sizeof tmp);

		for(int i=0;i<n;i++){
			bool f=t[i]-'0';
			if(f){//?????¨????????¬????????????
				for(int j=0;j<m;j++){
					tmp[j]=tmp[j]^(s2[i][j]);
				}
				cnt++;
			}
		}

		for(int i=0;i<m;i++)if(tmp[i])return 0;
		return cnt;
	}

	return max(dfs(h+1,t+"1"),dfs(h+1,t+"0"));
}

int twoToTen(string x){
	int sum=0;
	int xs=x.size();
	for(int i=xs;i>=0;i--){
		if(x[i]-'0'==1)sum+=1<<(xs-i-1);
	}
	return sum;
}


int dpp(){
	for(int i=0;i<(1<<m);i++)
	dp[0][i]=dp[1][i]=N;

		dp[0][0]=0;

	for(int i=0;i<n;i++){
		for(int j=0;j<1<<m;j++){
		if((i+1)%2==1){
			if(dp[0][j]!=N){
				//cout<<i<<" "<<j<<"A"<<endl;
				int now=twoToTen(s[i]);//????????¬????????????10????????§?????????????????????
				dp[1][j^now]=max(dp[1][j^now],dp[0][j]+1);
				dp[1][j]=max(dp[1][j],dp[0][j]);
			}

		}
		else{
				if(dp[1][j]!=N){
				//cout<<i<<" "<<j<<"A"<<endl;
				int now=twoToTen(s[i]);//????????¬????????????10????????§?????????????????????
				dp[0][j^now]=max(dp[0][j^now],dp[1][j]+1);
				dp[0][j]=max(dp[0][j],dp[1][j]);
		}
		}
	}
	}

	return dp[n%2][0];
}


int main(){
	while(cin>>n>>m,n||m){

	for(int i=0;i<n;i++)cin>>s[i];
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++)s2[i][j]=s[i][j]-'0';
	}
	if(n<=m)cout<<dfs(0,"")<<endl;
	else cout<<dpp()<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int dfs(int, std::string)':
a.cc:25:17: error: 'memset' was not declared in this scope
   25 |                 memset(tmp,0,sizeof tmp);
      |                 ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include<climits>
  +++ |+#include <cstring>
    9 | #include<stdio.h>
Language: C++

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<bitset>
#include<deque>
#include<cstring>
#include<cassert>
#include<climits>

using namespace std;
int n,m;
string s[501];
int dp[2][1<<23];
//t=100?????????0????????¨,
//t=101?????????0??¨2????????¨
int N=-1;
bool tmp[501];
bool s2[501][501];
int s3[501];//??¬???????????¶???????????´??°?????????????????????
int dfs(int h,string t){//h????????±???,t????????¨????????¬??????
	if(h==n){	
		//cout<<t<<endl;
		int cnt=0;
		//for(int i=0;i<m;i++)tmp[i]=0;
		memset(tmp,0,sizeof tmp);

		for(int i=0;i<n;i++){
			bool f=t[i]-'0';
			if(f==1){//?????¨????????¬????????????

			//	for(int j=0;j<m;j++)tmp[j]=tmp[j]^s2[i][j];
			tmp^=s2[i];
				cnt++;
			}
		}

		for(int i=0;i<m;i++)if(tmp[i])return 0;
		//for(int i=0;i<m;i++)cout<<tmp[i];cout<<" "<<t<<" "<<cnt<<endl;
		return cnt;
	}

	return max(dfs(h+1,t+"1"),dfs(h+1,t+"0"));
}

int twoToTen(string x){
	int sum=0;
	int xs=x.size();
	for(int i=xs;i>=0;i--){
		if(x[i]-'0'==1)sum+=1<<(xs-i-1);
	}
	return sum;
}


int dpp(){
	//for(int i=0;i<(1<<m);i++)
	//dp[0][i]=dp[1][i]=N;
	memset(dp[0],-1,sizeof dp[0]);
	memset(dp[1],-1,sizeof dp[1]);

		dp[0][0]=0;

	for(int i=0;i<n;i++){
		for(int j=0;j<1<<m;j++){
		if((i+1)%2==1){
			if(dp[0][j]!=N){
				//cout<<i<<" "<<j<<"A"<<endl;
				int now=twoToTen(s[i]);//????????¬????????????10????????§?????????????????????
				dp[1][j^now]=max(dp[1][j^now],dp[0][j]+1);
				dp[1][j]=max(dp[1][j],dp[0][j]);
			}

		}
		else{
				if(dp[1][j]!=N){
				//cout<<i<<" "<<j<<"A"<<endl;
				int now=twoToTen(s[i]);//????????¬????????????10????????§?????????????????????
				dp[0][j^now]=max(dp[0][j^now],dp[1][j]+1);
				dp[0][j]=max(dp[0][j],dp[1][j]);
		}
		}
	}
	}

	return dp[n%2][0];
}


int main(){
	while(cin>>n>>m,n||m){

	for(int i=0;i<n;i++)cin>>s[i];
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++)s2[i][j]=s[i][j]-'0';
	}
	for(int i=0;i<n;i++)s3[i]=twoToTen(s[i]);

	if(n<=22)cout<<dfs(0,"")<<endl;
	else cout<<dpp()<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int dfs(int, std::string)':
a.cc:33:28: error: invalid operands of types 'bool [501]' and 'bool*' to binary 'operator^'
   33 |                         tmp^=s2[i];
      |                         ~~~^~~~~~~
a.cc:33:28: note:   in evaluation of 'operator^=(bool [501], bool*)'
Language: C++

#include<bits/stdc++.h>
using namespace std;
  
int n,m,b[510][510];
int pc[1<<24],dp[2][1<<24],bits[510];
  
void compute() {
  int maxi = 0;
  if( n <= m ) {
    for(int i=0;i<(1<<n);i++) {
      if( maxi >= pc[i] ) continue;
      bool ok = true;
      for(int x=0;x<m;x++) {
    int cnt = 0;
    for(int y=0;y<n;y++) if( ( (i>>y) & 1 ) && b[y][x] ) ++cnt;
    if( cnt & 1 ) {
      ok = false;
      break;
    }
      }
      if( ok ) maxi = max(maxi,pc[i]);
    }
  } else { // n > m
   int list[501];
      fill(list,list+n,0);
      for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
          if(a[i][j]){
            list[i]=list[i]|(1<<j);
          }
        }
      }
      for(int i=0;i<2;i++)for(int j=0;j<(1<<m);j++)dp[i][j]=-1;
      dp[0][0]=0;
      for(int i=0;i<n;i++){
        for(int j=0;j<(1<<m);j++)dp[(i+1)&1][j]=-1;
        for(int j=0;j<(1<<m);j++){
          if(dp[i&1][j]==-1)continue;
          dp[(i+1)&1][j^list[i]]=max(dp[(i+1)&1][j^list[i]],dp[i&1][j]+1);
          dp[(i+1)&1][j]=max(dp[(i+1)&1][j],dp[i&1][j]);
        }
      }
      if(dp[n&1][0]!=-1)maxi=dp[n&1][0];
  }
  cout << maxi << endl;
}
  
int main() {
  for(int i=0;i<(1<<23);i++) pc[i] = __builtin_popcount(i);
  while( cin >> n >> m, n|m ) {
    for(int i=0;i<n;i++) {
      string s;
      cin >> s;
      for(int j=0;j<m;j++) b[i][j] = ( s[j] == '1' );
    }
    compute();
  }
  return 0;
}


Compiler output:
a.cc: In function 'void compute()':
a.cc:28:14: error: 'a' was not declared in this scope
   28 |           if(a[i][j]){
      |              ^
Language: C++

#include<stdio.h>

int mod(int max,int m);
int del_R(int num,int I,int n,int m,int max,int R[]);
int main()
{
	int n,m,R[500],MAX,max_R,c;
	
	while(1)
	{
		scanf("%d",&n);
		scanf("%d",&m);
		if(n==0&&m==0) break;
		MAX=0;
		max_R=0;
		for(int i=0;i<n;i++)
		{
			scanf("%d",&R[i]);
			MAX+=R[i];
		}
		if(mod(MAX,m)) max_R=n;
		else
		{
			for(int i=1;i<n-1;i++)//何個引くか i回 引いた個数 I
			{
				int I=0,c;
				c=del_R(i,I,n,m,MAX,R);
				if(c>max_R)
				{
					max_R=c;
					break;
				}
			}
		}
		printf("%d\n",max_R);
	}
	return 0;
}

int del_R(int num,int I,int n,int m,int max,int R[])//引く個数=num 引いた個数=I 何種類目 i
{
	int c,max_R=0;
	//全パターン
	for(int i=I;i<n;i++)
	{
		c=mod(max-R[i],m);
		if(num==1)
		{
			if(c==1) return n-num;
			else continue;
		}
		else if(del_R(num-1,i+1,n,m,max-R[i],R);) return num;
	}
	return max_R;
}

int mod(int max,int m)//戻したのが 1>>割り切れた 0>>余りあり
{
	int judge=1,a=1;
	for(int i=1;i<m;i++) a*=10;
	for(int i=0;i<m;i++)
	{
		if((max/a)%2!=0)
		{
			judge=0;
			break;
		}
		max=max%a;
		a=a/10;
	}
	return judge;
}


Compiler output:
a.cc: In function 'int del_R(int, int, int, int, int, int*)':
a.cc:52:57: error: expected primary-expression before ')' token
   52 |                 else if(del_R(num-1,i+1,n,m,max-R[i],R);) return num;
      |                                                         ^
Language: C++

#include<stdio.h>


int del_R(int num,int I,int n,int m,int max,int R[]);

int mod(int max,int m);
int main()
{
	int n,m,R[500],MAX,max_R,c;
	
	while(1)
	{
		scanf("%d",&n);
		scanf("%d",&m);
		if(n==0&&m==0) break;
		MAX=0;
		max_R=0;
		for(int i=0;i<n;i++)
		{
			scanf("%d",&R[i]);
			MAX+=R[i];
		}
		if(mod(MAX,m)) max_R=n;
		else
		{
			for(int i=1;i<n-1;i++)//何個引くか i回 引いた個数 I
			{
				int I=0,c;
				c=del_R(i,I,n,m,MAX,R);
				if(c>max_R)
				{
					max_R=c;
					break;
				}
			}
		}
		printf("%d\n",max_R);
	}
	return 0;
}

int del_R(int num,int I,int n,int m,int max,int R[])//引く個数=num 引いた個数=I 何種類目 i
{
	int c,max_R=0;
	//全パターン
	for(int i=I;i<n;i++)
	{
		c=mod(max-R[i],m);
		if(num==1)
		{
			if(c==1) return n-num;
			else continue;
		}
		else if(del_R(num-1,i+1,n,m,max-R[i],R);) return num;
	}
	return max_R;
}

int mod(int max,int m)//戻したのが 1>>割り切れた 0>>余りあり
{
	int judge=1,a=1;
	for(int i=1;i<m;i++) a*=10;
	for(int i=0;i<m;i++)
	{
		if((max/a)%2!=0)
		{
			judge=0;
			break;
		}
		max=max%a;
		a=a/10;
	}
	return judge;
}


Compiler output:
a.cc: In function 'int del_R(int, int, int, int, int, int*)':
a.cc:54:57: error: expected primary-expression before ')' token
   54 |                 else if(del_R(num-1,i+1,n,m,max-R[i],R);) return num;
      |                                                         ^
Language: C++

#include <iostream>
#include <vector>
#include <cstdio>
using namespace std;
#define rep(i,a,n) for(int i=a; i<n; i++)
#define repq(i,a,n) for(int i=a; i<=n; i++)
typedef long long int ll;
typedef pair<int, int> pii;

int main() {
  long long int N, I, J;
  while(cin >> N >> I >> J, N){
    vector<ll> height;
    --I;
    --J;
    ll t = I;
    for(int i = 0; i < N; ++i){
      height.push_back(t);
      t = (1LL<<(N-i-1))-t;
      if(t > 0) --t;
      else t = -t;
    }
    height.push_back(t);
    reverse(height.begin(),height.end());
    //for(int i = 0; i < N+1; ++i)
    //cout << height[i] << endl;
    string ans = "";
    for(int i = 0; i < N; ++i){
      if((height[i+1] == height[i] + (1LL<<(i))) ^ (J >= (1LL<<(N-i-1)))){
	ans += "R";
	if(J >= 1LL<<(N-i-1)) 
	  J = (1LL<<(N-i))-J-1;
      }else{
	ans += "L";
	if(J >= (1LL<<(N-i-1))) J = -(1LL<<(N-i-1))+J;
	else J = (1LL<<(N-i-1))-J-1;
      }
      //printf("J = %lld\n", J);
    }
    cout << ans << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: 'reverse' was not declared in this scope
   24 |     reverse(height.begin(),height.end());
      |     ^~~~~~~
Language: C++

#include <stdio.h>

int main()

return 


Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: expected identifier at end of input
    5 | return
      |       ^
a.cc:5:1: error: named return values are no longer supported
    5 | return
      | ^~~~~~
a.cc:5:7: error: expected '{' at end of input
    5 | return
      |       ^