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

#include<iostream>
#include<vector>

using namespace std;

const int MAX = 100;
typedef pair<int,int> P;

int n;
int in[MAX][MAX];
P ans[MAX][MAX];

void row(int m){
  int s = (1<<20);

  for(int i = 0; i < n; i++)
    s = min(s,in[m][i]);

  for(int i = 0; i < n; i++)
    if(s == in[m][i]) ans[m][i].first = true;

    
}
void column(int m){

  int l = -1;

  for(int i = 0; i < n; i++)
    l = max(l,in[i][m]);

  for(int i = 0; i < n; i++)
      if(l == in[i][m]) ans[i][m].second = true;

}

void init(){
  for(int i = 0; i < MAX; i++)
    for(int j = 0; j < MAX; j++)
      ans[i][j] = P(false,false);

}
int main(){
  while(cin >> n && n){
    init();
    for(int i = 0; i < n; i++)
      for(int j = 0; j < n; j++)
	cin >> in[i][j];


    for(int i = 0; i < n; i++){
      row(i);
      column(i);
    }

    vector<int> V;

    for(int i = 0; i < n; i++)
      for(int j = 0; j < n; j++)
	if(ans[i][j] == P(true,true)) V.push_back(in[i][j]);

    if(V.size() == 0) cout << "0" << endl;
    else if(V.size() == 1) cout << V[0] << endl;
    else{
      sort(V.begin(),V.end());
      vector<int> :: iterator ite = V.begin();
      while(ite != V.end()){
	cout << *ite << endl;
	ite = upper_bound(V.begin(),V.end(),*ite);
      }
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:7: error: 'sort' was not declared in this scope; did you mean 'short'?
   64 |       sort(V.begin(),V.end());
      |       ^~~~
      |       short
a.cc:68:15: error: 'upper_bound' was not declared in this scope
   68 |         ite = upper_bound(V.begin(),V.end(),*ite);
      |               ^~~~~~~~~~~
Language: C++

# -*- coding: utf-8 -*-

import sys
import copy

while True:
    n = int(raw_input())

    if n == 0:
        break

    array = []
    array2 = []
    minflag = []
    maxflag = []
    
    for i in range(n):
        l = []
        for j in range(n):
            l.append(0)
        minflag.append(copy.copy(l))
        maxflag.append(copy.copy(l))

    for i in range(n):
        row = map(int, raw_input().split())
        array.append(row)
        array2.append(row)

    for i, row in enumerate(array):
        for j, e in enumerate(row):
            if e == min(row):
                minflag[i][j] = 1
            else:
                minflag[i][j] = 0

    # print minflag

    for i, column in enumerate(map(list, zip(*array2))):
        for j, e in enumerate(column):
            if e == max(column):
                maxflag[j][i] = 1
            else:
                maxflag[j][i] = 0

    # print minflag               
    # print maxflag

    for i in range(n):
        for j in range(n):
            if (minflag[i][j] == 1 and maxflag[i][j] == 1):
                print array[i][j]

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding: utf-8 -*-
      |   ^
a.cc:36:7: error: invalid preprocessing directive #print
   36 |     # print minflag
      |       ^~~~~
a.cc:45:7: error: invalid preprocessing directive #print
   45 |     # print minflag
      |       ^~~~~
a.cc:46:7: error: invalid preprocessing directive #print
   46 |     # print maxflag
      |       ^~~~~
a.cc:3:1: error: 'import' does not name a type
    3 | import sys
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;

int transformation(int n)
{
    return 60*n/100+n%100;
}

int main()
{
    for(int n,p,q;cin>>n>>p>>q,n|p|q;){
    {
        vector<int> bla(24*60+10,0);
        p = transformation(p);
        q = transformation(q);
        for(int c=0;c<n;c++)
        {
            int t;
            cin>>t;
            while(t--)
            {
                int first,second;
                cin>>first>>second;
                first = transformation(first);
                second = transformation(second);
                for(int c2=first;c2<second;c2++) bla[c2]++;
            }
        }
        int act = 0;
        int res = 0;
        for(int c=p;c<q;c++)
        {
            if(bla[c]==n) act=0;
            else act++;
            res=max(res,act);
        }
        cout<<res<<endl;

    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:2: error: expected '}' at end of input
   44 | }
      |  ^
a.cc:14:1: note: to match this '{'
   14 | {
      | ^
Language: C++

 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 
 using namespace std;
 
 //??\?????\??´?????£??????????????\?°¨?????°??????map?????¨??????????????°??? 
 
 int main()
 {
   int N;
   int start,end;
   while(cin>>N>>start>>end)
   {
     bool arr[2000]=false;
     //map<int,int> mm;
     //map<int,int>::iterator iter;
     //map<int,int>::iterator iter2;
     if(N==0&&start==0&&end==0) break;
     start=(start/100)*60+(start%60);
     end=(end/100)*60+(end%100);
     for(int i=0;i<N;i++)
     {
       int kk;
       int temp;
       cin>>kk;
       int a,b;
       for(int j=0;j<kk;j++)
       {
         cin>>a>>b;
         a=(a/100)*60+(a%100);
         b=(b/100)*60+(b%100);
         if(j==0)
         {
           //if(a>start) mm[start]=a;
           if(a>start) for(int k=start;k<a;k++) arr[k]=true;            
         }
         else
         {
           for(int k=temp;k<a;k++) arr[k]=true; 
           //mm[temp]=a;        
         }        
         temp=b;
       }
       if(end>temp)
       { 
         for(int k=temp;k<end;k++) arr[k]=true;
         //mm[temp]=end;
       }
     }
     /*
     for(iter2=mm.begin();iter2!=mm.end();++iter2)
     {
       cout<<iter2->first<<" "<<iter2->second<<endl;                                             
     }
     */
     int max=0;
     int duration=0;
     for(int i=start;i<(end+1);i++)
     {
       if(arr[i]) duration++;
       else
       {
         if(duration>max) max=duration;
         duration=0;    
       }
       //cout<<duration<<endl;            
     }
     cout<<max<<endl;
     /*
     iter=mm.begin();
     int start2=iter->first; 
     int end2=iter->second;
     int max=end2-start2;
     iter++;
     for(;iter!=mm.end();++iter)
     {
       int p=iter->first;
       int q=iter->second;
       if(p<=end2&&q>=end2) end2=q;
       else if(p>end2)
       { 
         start2=p;
         end2=q;
       }
       int dur=end2-start2;
       if(dur>max) max=dur;                                  
     }
     cout<<max<<endl;
   }
   */
   }
   //while(1);
   return 0;
 }

 
  

 

Compiler output:
a.cc: In function 'int main()':
a.cc:26:21: error: array must be initialized with a brace-enclosed initializer
   26 |      bool arr[2000]=false;
      |                     ^~~~~
Language: C++

1 2100 2400
1
2130 2200
3 2100 2400
3
2100 2130 2200 2230 2300 2330
2
2130 2200 2330 2400
2
2100 2130 2330 2400
0 0 0


Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 1 2100 2400
      | ^
Language: C++

#include<iostream>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
	int n,p,q,k,s[99],e[99],a,b,cm,ans,prev,sum;
	while(cin>>n>>p>>q,n){
		p=p/100*60+p%100,q=q/100*60+q%100;sum=0;
		rep(j,n){
			cin>>k;
			rep(i,k)cin>>a>>b,s[sum+i]=a/100*60+a%100,e[sum+i]=b/100*60+b%100;
			sum+=k;
		}
		sort(s,s+sum);sort(e,e+sum);
		cm=0;ans=0;prev=p;
		for(int si=0,ei=0;si<sum||ei<sum;){
			if(si<sum&&s[si]<e[ei]){
				cm++;
				if(cm==n&&ans<s[si]-prev)ans=s[si]-prev;
				si++;
			}else{
				cm--;if(cm==n-1)prev=e[ei];ei++;
			}
		}
		if(ans<q-prev)ans=q-prev;
		cout<<ans<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |                 sort(s,s+sum);sort(e,e+sum);
      |                 ^~~~
      |                 short
Language: C++

#include<iostream>

#define N 2500;

using namespace std;

int main(){

  int in, start,end;

  while(cin >> in >>start >> end){
    if(in == 0 && start == 0 && end == 0) break;
    int data[N];
    int com[N];

    for(int i = 0; i < end; i++){
      com[i] = 0;
      data[i] = 0;
    }

    for(int i = start; i < end; i++){
      if(i%100 < 60) data[i] = 1;      
    }

    int comnum, s,e;
    for(int i = 0; i < in; i++){
      cin >> comnum;
      for(int j = 0; j < comnum; j++){
	cin >> s >> e;
	for(int i = s; i < e; i++){
	  if(i % 100 < 60) com[i]++;
	}
      }
    }

    for(int i = 0; i < end; i++){
      if(com[i] == in) data[i] = 0;
    }

    int sum = 0;
    for(int i = 0; i < end; i++){
      if(data[i] == 1) sum++;
    }

    cout << sum << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:15: error: expected ']' before ';' token
    3 | #define N 2500;
      |               ^
a.cc:13:14: note: in expansion of macro 'N'
   13 |     int data[N];
      |              ^
a.cc:13:15: error: expected primary-expression before ']' token
   13 |     int data[N];
      |               ^
a.cc:3:15: error: expected ']' before ';' token
    3 | #define N 2500;
      |               ^
a.cc:14:13: note: in expansion of macro 'N'
   14 |     int com[N];
      |             ^
a.cc:14:14: error: expected primary-expression before ']' token
   14 |     int com[N];
      |              ^
a.cc:17:7: error: 'com' was not declared in this scope
   17 |       com[i] = 0;
      |       ^~~
a.cc:18:11: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   18 |       data[i] = 0;
      |           ^
a.cc:22:26: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   22 |       if(i%100 < 60) data[i] = 1;
      |                          ^
a.cc:31:28: error: 'com' was not declared in this scope
   31 |           if(i % 100 < 60) com[i]++;
      |                            ^~~
a.cc:37:10: error: 'com' was not declared in this scope
   37 |       if(com[i] == in) data[i] = 0;
      |          ^~~
a.cc:37:28: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   37 |       if(com[i] == in) data[i] = 0;
      |                            ^
a.cc:42:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   42 |       if(data[i] == 1) sum++;
      |              ^
Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

#define N 505
#define M 5005

int n, p, q;
bool a[N][M];
int dp[2][N][M];

inline int gao() {
    int x;
    scanf("%d", &x);
    return x / 100 * 60 + x % 100;
}

int main() {
    while (EOF != scanf("%d", &n)) {
        p = gao();
        q = gao();
        if (0 == n && 0 == p && 0 == q) break;
        memset(a, 0, sizeof(a));
        for (int i = 0; i < n; ++i) {
            int m, l, r;
            scanf("%d", &m);
            while (m--) {
                l = max(p, gao());
                r = min(q, gao());
                for (int j = l; j < r; ++j)
                    a[i][j - p] = true;
            }
        }
        memset(dp, 0, sizeof(dp));        
        for (int j = p + 1; j <= q; ++j)
            for (int i = 0; i < n; ++i) {
                for (int k = 0; k < n; ++k) {
                    if (a[k][j - 1 - p]) {
                        int tmp = 0;
                        tmp = max(tmp, dp[0][k][j - 1 - p]);
                        tmp = max(tmp, dp[1][k][j - 1 - p]);
                        dp[1][i][j - p] = max(dp[1][i][j - p], tmp);
                    } else {
                        dp[0][i][j - p] = max(dp[0][i][j - p], dp[0][k][j - 1 - p] + 1);
                    }
                }
                dp[1][i][j - p] = max(dp[1][i][j - p], dp[0][i][j - p]);
            }
        int ans = 0;
        for (int i = 0; i < n; ++i)
            ans = max(ans, max(dp[1][i][q - p], dp[0][i][q - p]);
        printf("%d\n", ans);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:65: error: expected ')' before ';' token
   52 |             ans = max(ans, max(dp[1][i][q - p], dp[0][i][q - p]);
      |                      ~                                          ^
      |                                                                 )
Language: C

#include<stdio.h>

int main(){
	int n,i,j,k=1,cnt,d[10][10];

	while(scanf("%d",&n),n){
		a=1;
		for(i=0;i<n*2;i++){
			if(i%2){
				for(j=0;j<i;j++){
					d[j][i-j]=a++;
				}
			}else{
				for(j=i-1;j>=0;j++){
					d[j][i-j]=a++;
				}
			}
		}
		printf("Case %d:\n",k++);
		for(i=0;i<n;i++){
			for(j=0;j<n;j++){
				printf("%3d",d[i][j]);
			}
			puts("");
		}
	}
	return 0;
}		

Compiler output:
main.c: In function 'main':
main.c:7:17: error: 'a' undeclared (first use in this function)
    7 |                 a=1;
      |                 ^
main.c:7:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<iostream>
#include<cstring>
#include <iomanip>

using namespace std;
void init(int  matrix[11][11])
{
	int i,j;
	for(i = 0; i < 11;i ++)
	{
		for(j = 0; j < 11; j ++)
		{
			matrix[i][j] = 0;
		}
	}
}

bool OnBoundary(int i,int j,int caseNum)
{
	//if(i == 0 || i == caseNum - 1 || j == 0 || j == caseNum - 1)
	if((i == 0 && j >= 0 && j <= caseNum - 1) || (i == caseNum - 1 && j >= 0 && j <= caseNum - 1)
		|| (j == 0 && i >= 0 && i <= caseNum - 1) || (j == caseNum - 1 && i >= 0 && i <= caseNum - 1))
	{
		return true;
	}
	else
	{
		return false;
	}
}
bool OutBoundary(int i,int j,int caseNum)
{
	if(i <  0 || i > caseNum - 1 || j < 0 || j > caseNum - 1)
	{
		return true;
	}
	else
	{
		return false;
	}
}


int main()
{	
	int caseNum;
	int n = 0;
	while(cin>>caseNum)
	{
		if(caseNum == 0) break;
		
		else
		{	n ++;
			int i;
			int j;
			int matrix[11][11];

			init(matrix);

			int lit = (caseNum - 1) + (caseNum - 1);

			int seed = 1;
			bool up = true;
		
			for(i = 0,j =0;i + j <= lit; )
			{
				matrix[i][j] = seed;
			
				seed ++;
				// find next
				if(up == true )
				{
					if(OutBoundary(i - 1,j + 1,caseNum) == true)
					{
						if(OnBoundary(i,j + 1,caseNum) == true)
						{
							i = i ;
							j = j + 1;
						}
						else
						{
							i = i + 1;
							j = j;
						}
						up = false;
					}
					else
					{
						i = i - 1;
						j = j + 1;
					}
				}
				else if(up == false  )
				{
					if(OutBoundary(i + 1,j - 1,caseNum) == true)
					{
						if(OnBoundary(i + 1,j ,caseNum) == true)
						{
							i = i + 1 ;
							j = j ;
						}
						else
						{
							i = i ;
							j = j + 1;
						}
						up = true;
					}
					else
					{
						i = i + 1;
						j = j - 1;
					}
				}
			}
			// output
			cout<<"Case "<<n<<":"<<endl;
			for(i = 0; i < caseNum ; i ++)
			{
				for(j = 0; j < caseNum; j ++)
				{
					cout.setf(ios::right);
					cout<<setw(3)<<matrix[i][j]<<" ";
				}
				cout<<endl;
			}
			
			// output
		}

	}
	return 0;


}

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

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

int** alloc_mat(int mat_size); //蜉ィ諤∽コ檎サエ謨ー扈?噪蛻??
void del_mat(int **mat, int mat_size); //蛻?勁蜉ィ諤∝?驟咲噪莠檎サエ謨ー扈?void print_mat(int **mat, int mat_size); //謇灘魂莠檎サエ謨ー扈?void fill_mat(int **mat, int mat_size); //蝪ォ蜈?焚扈?クコ陞コ譌区焚扈?
int main()
{
    int **zigzag_mat;
    int mat_size;
    int count=1;
    while(cin >> mat_size,mat_size)
    {
        cout<<"Case "<<count<<":"<<endl;
        zigzag_mat = alloc_mat(mat_size);
        fill_mat(zigzag_mat,mat_size);
        print_mat(zigzag_mat, mat_size);
        del_mat(zigzag_mat, mat_size);
        count++;
    }
    return 0;
}

int** alloc_mat(int mat_size)
{
    int **mat;
    int i, j;
    mat = new int*[mat_size];
    for (i = 0; i < mat_size; i++)
    {
        *(mat+i) = new int[mat_size];
    }
    for (i = 0; i < mat_size; i++)
        for (j = 0; j < mat_size; j++)
            mat[i][j] = 0;
    return mat;
}

void del_mat(int **mat, int mat_size)
{
    int i;
    for(i = 0; i < mat_size; i++)
        delete[] mat[i];
    delete[] mat;
}

void print_mat(int **mat, int mat_size)
{
    int i, j;
    for(i = 0; i < mat_size; i++)
    {
        for (j = 0; j < mat_size; j++)
            printf("%3d", mat[i][j]+1);
        cout << endl;
    }
}

void fill_mat(int **mat, int mat_size)
{
    int squa = mat_size * mat_size;
    int i, j, s;
    for (i = 0; i < mat_size; i++)
        for (j = 0; j < mat_size; j++)
        {
            s = i + j;
            if (s < mat_size)
                mat[i][j] = s * (s + 1) / 2 + (((i + j) % 2) ? i : j);
            else
            {
                s = (mat_size - 1 - i) + (mat_size - 1 - j);
                mat[i][j] = squa - s * (s + 1) / 2 - (mat_size - ((( i + j) % 2) ? i : j));
            }
        }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'fill_mat' was not declared in this scope
   16 |         fill_mat(zigzag_mat,mat_size);
      |         ^~~~~~~~
a.cc:17:9: error: 'print_mat' was not declared in this scope
   17 |         print_mat(zigzag_mat, mat_size);
      |         ^~~~~~~~~
Language: C++

#define d for(x=0;x<N;x++){for(y=0;y<N;y++
c,m[10][10],x,N;main(y){for(;scanf("%d",&N),N;div(0)){d)m[x][y]=(x+y)*(x-~y)/2-~(x+y&1?x:y);}printf("Case %d:\n",++c);d)printf("%3d",x+y<N?m[x][y]:N*N+1-m[N+~x][N+~y]);puts("");}}}

Compiler output:
a.cc:2:1: error: 'c' does not name a type
    2 | c,m[10][10],x,N;main(y){for(;scanf("%d",&N),N;div(0)){d)m[x][y]=(x+y)*(x-~y)/2-~(x+y&1?x:y);}printf("Case %d:\n",++c);d)printf("%3d",x+y<N?m[x][y]:N*N+1-m[N+~x][N+~y]);puts("");}}}
      | ^
a.cc:2:21: error: expected constructor, destructor, or type conversion before '(' token
    2 | c,m[10][10],x,N;main(y){for(;scanf("%d",&N),N;div(0)){d)m[x][y]=(x+y)*(x-~y)/2-~(x+y&1?x:y);}printf("Case %d:\n",++c);d)printf("%3d",x+y<N?m[x][y]:N*N+1-m[N+~x][N+~y]);puts("");}}}
      |                     ^
Language: C++

class Map
  def initialize(x,y,number,move)
    @x = x
    @y = y
    @move = move
    @number = number
  end
  attr_accessor :x,:y,:move,:number
  def +(map)
    x = self.x + map.x
    y = self.y + map.y
    m = self.move
    n = self.number + 1
    tmp = Map.new(x,y,n,m)
  end
end
@b = []
@b << Map.new(1,0, 1,0) #sita
@b << Map.new(0,1, 1,1) #migi
@b << Map.new(1,-1,1,2) #hidarisita
@b << Map.new(-1,1,1,3) #migiue

def work(map,m)
  n=m-1
  if map.move==3 && map.x!=0 && map.y!=n then
    return map+@b[3]
  elsif map.move==2 && map.y!=0 && map.x!=n then
    return map+@b[2]
  elsif (map.move==3&&map.x==0)||(map.move==2&&map.x==n) then
    if map.move==3 then
      move = 2
    else
      move = 3
    end
    temp = map + @b[1]
    temp.move = move
    if map.y==n then
      temp.move = 2
      temp.x = 1
      temp.y = n
      return temp
    else
      return temp
    end
  else
    if map.move==3 then
      move = 2
    else
      move = 3
    end
    temp = map + @b[0]
    temp.move = move
    return temp
  end
end
$m = Map.new(0,0,1,2)
$n = 3
def w(m,n)
  return work( m, n )
end
$COU = 0
def printmap(n)
  $COU = $COU + 1
  puts "Case %d" % $COU
  c=[$m]
  i=1
  while i<n*n
    c << w(c[i-1],n)
    i = i+1
  end
  i=0
  while i < n
    for mapp in c do
      if mapp.y==i then
        print "%3d" % mapp.number
      end
    end
    puts
  i=i+1
  end
end
while true
  a = gets.to_i
  if a==0 then
    break
  end
  printmap(a)
end

Compiler output:
a.cc:3:5: error: stray '@' in program
    3 |     @x = x
      |     ^
a.cc:4:5: error: stray '@' in program
    4 |     @y = y
      |     ^
a.cc:5:5: error: stray '@' in program
    5 |     @move = move
      |     ^
a.cc:6:5: error: stray '@' in program
    6 |     @number = number
      |     ^
a.cc:17:1: error: stray '@' in program
   17 | @b = []
      | ^
a.cc:18:1: error: stray '@' in program
   18 | @b << Map.new(1,0, 1,0) #sita
      | ^
a.cc:18:25: error: stray '#' in program
   18 | @b << Map.new(1,0, 1,0) #sita
      |                         ^
a.cc:19:1: error: stray '@' in program
   19 | @b << Map.new(0,1, 1,1) #migi
      | ^
a.cc:19:25: error: stray '#' in program
   19 | @b << Map.new(0,1, 1,1) #migi
      |                         ^
a.cc:20:1: error: stray '@' in program
   20 | @b << Map.new(1,-1,1,2) #hidarisita
      | ^
a.cc:20:25: error: stray '#' in program
   20 | @b << Map.new(1,-1,1,2) #hidarisita
      |                         ^
a.cc:21:1: error: stray '@' in program
   21 | @b << Map.new(-1,1,1,3) #migiue
      | ^
a.cc:21:25: error: stray '#' in program
   21 | @b << Map.new(-1,1,1,3) #migiue
      |                         ^
a.cc:26:16: error: stray '@' in program
   26 |     return map+@b[3]
      |                ^
a.cc:28:16: error: stray '@' in program
   28 |     return map+@b[2]
      |                ^
a.cc:35:18: error: stray '@' in program
   35 |     temp = map + @b[1]
      |                  ^
a.cc:51:18: error: stray '@' in program
   51 |     temp = map + @b[0]
      |                  ^
a.cc:2:7: error: expected initializer before 'initialize'
    2 |   def initialize(x,y,number,move)
      |       ^~~~~~~~~~
Language: Java

import java.util.Arrays;
import java.util.Scanner;
public class AOJ_1008_2
{
	public static int a[];
	public static void main(String[] args) 
	{
		Scanner in=new Scanner(System.in);
		for(;;)
		{
			int n=in.nextInt();//n<1000000
			if(n==0)
				return;
			a=new int[n];
			for(int i=0;i<n;i++)
				a[i]=in.nextInt();
			Arrays.sort(a);
			int cnt=0;
			int ans=-1;
			int ele=a[0];
			for(int i=0;i<n;i++)
			{
				if(ele==a[i])
				{
					cnt++;
					if(cnt>n/2)
					{
						ans=ele;
						break;
					}
				}
				else
				{
					cnt=1;
					ele=a[i];
				}
			}
			System.out.println(ans!=-1 ? ans:"NO COLOR");
		}
	}
	static public void debug(Object... o)
	{
		System.out.println(Arrays.deepToString(o));
	}
}

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

import java.util.Map.Entry;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		while (true) {
			final int N = sc.nextInt();

			if (N == 0) {
				break;
			}
			
			System.gc();

			HashMap<Integer, Integer> map = new HashMap<Integer, Integer>(N);
			
			for(int i = 0; i < N; i++){
				final int A = sc.nextInt();
				
				int value = 0;
				if(map.containsKey(A)){
					value = map.get(A);
				}
				value++;
				
				map.put(A, value);
			}
			//System.out.println(map);
			
			Set<Entry<Integer, Integer>> set = new TreeSet<Entry<Integer, Integer>>(new Comparator<Entry<Integer, Integer>>(){

				@Override
				public int compare(Entry<Integer, Integer> arg0,
						Entry<Integer, Integer> arg1) {
					if(arg1.getValue() != arg0.getValue()){
						return arg1.getValue() - arg0.getValue();
					}
					return 0;
				}
				
			});
			
			set.addAll(map.entrySet());
			
			for(Entry<Integer, Integer> entry : set){
				//System.out.println(entry.getValue());
				
				if(entry.getValue() <= N / 2){
					System.out.println("NO COLOR");
				}else{
					System.out.println(entry.getKey());
				}
				
				break;
			}
		}

	}

}

Compiler output:
Main.java:21: error: cannot find symbol
			HashMap<Integer, Integer> map = new HashMap<Integer, Integer>(N);
			^
  symbol:   class HashMap
  location: class Main
Main.java:21: error: cannot find symbol
			HashMap<Integer, Integer> map = new HashMap<Integer, Integer>(N);
			                                    ^
  symbol:   class HashMap
  location: class Main
Main.java:36: error: cannot find symbol
			Set<Entry<Integer, Integer>> set = new TreeSet<Entry<Integer, Integer>>(new Comparator<Entry<Integer, Integer>>(){
			                                                                            ^
  symbol:   class Comparator
  location: class Main
Main.java:38: error: method does not override or implement a method from a supertype
				@Override
				^
4 errors
Language: Java

import java.util.Scanner;
import java.util.TreeMap;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		//int[] array = new int[1000001];
		
		while (true) {
			final int N = sc.nextInt();

			if (N == 0) {
				break;
			}
			System.gc();
			int[] array = new int[N];
			
			
			//Arrays.fill(array, Integer.MAX_VALUE);
			for(int i = 0; i < N; i++){
				array[i] = sc.nextInt();
			}
			
			Arrays.sort(array);
			
			int prev = array[0];
			int count = 1;
			boolean flag = false;;
			for(int i = 1; i < N; i++){
				if(prev == array[i]){
					count++;
				}else{
					if(count > N / 2){
						System.out.println(prev);
						flag = true;
						break;
					}
					
					prev = array[i];
					count = 1;
				}
			}
			
			if(count > 0){
				if(count > N / 2){
					System.out.println(prev);
					flag = true;
				}
			}
			
			if(!flag){
				System.out.println("NO COLOR");
			}
			
		}

	}

}

Compiler output:
Main.java:26: error: cannot find symbol
			Arrays.sort(array);
			^
  symbol:   variable Arrays
  location: class Main
1 error
Language: Java

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		//int[] array = new int[1000001];
		
		while (true) {
			final int N = sc.nextInt();

			if (N == 0) {
				break;
			}
			try {
				Thread.sleep(1);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			System.gc();
			int[] array = new int[N];
			
			
			//Arrays.fill(array, Integer.MAX_VALUE);
			for(int i = 0; i < N; i++){
				array[i] = sc.nextInt();
			}
			
			Arrays.sort(array);
			
			int prev = array[0];
			int count = 1;
			boolean flag = false;;
			for(int i = 1; i < N; i++){
				if(prev == array[i]){
					count++;
				}else{
					if(count > N / 2){
						System.out.println(prev);
						flag = true;
						break;
					}
					
					prev = array[i];
					count = 1;
				}
			}
			
			if(count > 0){
				if(count > N / 2){
					System.out.println(prev);
					flag = true;
				}
			}
			
			if(!flag){
				System.out.println("NO COLOR");
			}
			
		}

	}

}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
Main.java:29: error: cannot find symbol
			Arrays.sort(array);
			^
  symbol:   variable Arrays
  location: class Main
3 errors
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;

class Main{
	public static void main_(String args[]){
		(new Main_()).sets();
	}

	HashMap<String, OriginalSet> setsEnvironment;
	OriginalSet setU;

	void sets(){
		// 標準入力準備
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = new String();
		setsEnvironment = new HashMap<String, OriginalSet>();

		setU = new OriginalSet();

		// 集合定義のためのハッシュ
		try{
			while((str = br.readLine()) != null){
				int n = Integer.parseInt(str);
				if(n == 0) return;

				str = br.readLine();
				String array[] = str.split(" ");
			}
		}catch(Exception e){
			System.err.println(e);
		}
	}
}

Compiler output:
Main.java:10: error: cannot find symbol
	HashMap<String, OriginalSet> setsEnvironment;
	                ^
  symbol:   class OriginalSet
  location: class Main
Main.java:11: error: cannot find symbol
	OriginalSet setU;
	^
  symbol:   class OriginalSet
  location: class Main
Main.java:7: error: cannot find symbol
		(new Main_()).sets();
		     ^
  symbol:   class Main_
  location: class Main
Main.java:17: error: cannot find symbol
		setsEnvironment = new HashMap<String, OriginalSet>();
		                                      ^
  symbol:   class OriginalSet
  location: class Main
Main.java:19: error: cannot find symbol
		setU = new OriginalSet();
		           ^
  symbol:   class OriginalSet
  location: class Main
5 errors
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;

class Main{
	public static void main(String args[]){
		(new Main_()).sets();
	}

	HashMap<String, OriginalSet> setsEnvironment;
	OriginalSet setU;

	void sets(){
		// 標準入力準備
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = new String();
		setsEnvironment = new HashMap<String, OriginalSet>();

		setU = new OriginalSet();

		// 集合定義のためのハッシュ
		try{
			while((str = br.readLine()) != null){
				int n = Integer.parseInt(str);
				if(n == 0) return;

				str = br.readLine();
				String array[] = str.split(" ");
			}
		}catch(Exception e){
			System.err.println(e);
		}
	}
}

Compiler output:
Main.java:10: error: cannot find symbol
	HashMap<String, OriginalSet> setsEnvironment;
	                ^
  symbol:   class OriginalSet
  location: class Main
Main.java:11: error: cannot find symbol
	OriginalSet setU;
	^
  symbol:   class OriginalSet
  location: class Main
Main.java:7: error: cannot find symbol
		(new Main_()).sets();
		     ^
  symbol:   class Main_
  location: class Main
Main.java:17: error: cannot find symbol
		setsEnvironment = new HashMap<String, OriginalSet>();
		                                      ^
  symbol:   class OriginalSet
  location: class Main
Main.java:19: error: cannot find symbol
		setU = new OriginalSet();
		           ^
  symbol:   class OriginalSet
  location: class Main
5 errors
Language: Java

import java.io.*;
import java.util.*;
 
public class p1008yet {
    public static void main(String[] args) {
    	Scanner s = new Scanner(System.in);
        //BufferedReader r = new BufferedReader(new InputStreamReader(System.in));       
        try {
            int A_size;
            
            while(true){
                /* input from here */
                A_size = s.nextInt();
                long[] A = new long[A_size];
                if(A_size==0){
                    break;
                } else if(A_size==1){
                    System.out.println(s.nextInt());
                    continue;
                } else {               
                    for(int i=0;i<A_size;i++){
                        A[i] = s.nextInt();
                    }
                }
                /* input till here */
                /* processing from here */
                Arrays.sort(A);
                 
                /* processing till here */
                /* output */
                 
                boolean nosol = true;
                int count = 1;
                for(int i=0;i<A_size-1;i++){
                    if(A[i]==A[i+1]){
                        count++;
                        if(count>A_size/2){
                            System.out.println(A[i]);
                            nosol = false;
                            break;
                        }
                    } else {
                        count = 1;
                        if(i>A_size/2){
                            break;
                        }
                    }                  
                }
                if(nosol){
                    System.out.println("NO COLOR");
                }      
                 
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
        	s.close();
        }
    }
}

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

#include<stdio.h>
imt a[1000000];
int main(void){
int n;
int i,j;
while(scanf("%d",&n),n){
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
qsort
}
return 0;}

Compiler output:
main.c:2:1: error: unknown type name 'imt'; did you mean 'int'?
    2 | imt a[1000000];
      | ^~~
      | int
main.c: In function 'main':
main.c:10:1: error: 'qsort' undeclared (first use in this function)
   10 | qsort
      | ^~~~~
main.c:10:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:6: error: expected ';' before '}' token
   10 | qsort
      |      ^
      |      ;
   11 | }
      | ~
Language: C

#include<stdio.h>
imt a[1000000];
int cmp(const void *a,const void *b){
return (int *)b-(int *)a;
}
int main(void){
int n,m,k;
int i,j;
while(scanf("%d",&n),n){
m=0;
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
qsort(a,0,n-1,cmp);
for(i=0;i<n;i++){
for(j=i+1;j<n;j++){
if(a[i]!=b[i]){
if(m<j-i){
m=j-i;
k=a[i];
}
i=j-1;
break;
}
}
}
if(n/2<m)printf("%d\n",k);
else puts("NO COLOR");
}
return 0;}

Compiler output:
main.c:2:1: error: unknown type name 'imt'; did you mean 'int'?
    2 | imt a[1000000];
      | ^~~
      | int
main.c: In function 'main':
main.c:14:1: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
   14 | qsort(a,0,n-1,cmp);
      | ^~~~~
main.c:17:10: error: 'b' undeclared (first use in this function)
   17 | if(a[i]!=b[i]){
      |          ^
main.c:17:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int a[1000000];
int cmp(const void *a,const void *b){
return (int *)b-(int *)a;
}
int main(void){
int n,m,k;
int i,j;
while(scanf("%d",&n),n){
m=0;
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
qsort(a,0,n-1,cmp);
for(i=0;i<n;i++){
for(j=i+1;j<n;j++){
if(a[i]!=b[i]){
if(m<j-i){
m=j-i;
k=a[i];
}
i=j-1;
break;
}
}
}
if(n/2<m)printf("%d\n",k);
else puts("NO COLOR");
}
return 0;}

Compiler output:
main.c: In function 'main':
main.c:14:1: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
   14 | qsort(a,0,n-1,cmp);
      | ^~~~~
main.c:17:10: error: 'b' undeclared (first use in this function)
   17 | if(a[i]!=b[i]){
      |          ^
main.c:17:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
 
using namespace std;
 
#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,s,e) for(int i=(s); i<(e); i++)
#define pb(n) push_back((n))
#define mp(n,m) make_pair((n),(m))
#define all(r) r.begin(),r.end()
#define fi first
#define se second
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
 
const int INF = 10000000;
const int mod = 1e9 + 7;
const double EPS = 1e-9;


int main(){
	int n, t, ans;
	while(cin>>n && n > 0){
		map<int,int> mp;
		for(int i = 0; i < n; i++){
			cin>>t;
			++m[t];
		}
		ans = -1;
		for(auto it = mp.begin(); it != mp.end(); ++it){
			if(it->se*2>n) ans = it->fi;
		}
		if(ans == -1) cout<<"NO COLOR"<<endl;
		else cout<<ans<<endl;
	}
}	

Compiler output:
a.cc: In function 'int main()':
a.cc:46:27: error: 'm' was not declared in this scope
   46 |                         ++m[t];
      |                           ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
ll n;
ll a[1000010];
ll *p, *q;

int main() {
	while (cin >> n, n)
	{
		ll res = 0, t, s, color;
		for (int i = 0; i < n;i++)scanf_s("%lld", &a[i]);
		sort(a, a + n);
		res = upper_bound(a, a + n, a[0]) - lower_bound(a, a + n, a[0]);
		for (p = &a[0]; upper_bound(a, a + n, *p) != a + n; ) {
			p = upper_bound(a, a + n, *p);
			s = upper_bound(a, a + n, *p) - lower_bound(a, a + n, *p);
			if (res < s) {
				res = s;
				color = *p;
			}
		}
		if (2 * res > n ) { cout << color << endl; }
		else cout << "NO COLOR" << endl;
	
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:43: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   13 |                 for (int i = 0; i < n;i++)scanf_s("%lld", &a[i]);
      |                                           ^~~~~~~
      |                                           scanf
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
ll n;
ll a[1000010];
ll *p, *q;

int main() {
	while (cin >> n, n)
	{
		ll res = 0, t, s, color;
		for (int i = 0; i < n;i++)scanf_s("%lld", &a[i]);
		sort(a, a + n);
		color = a[0];
		t=res = upper_bound(a, a + n, a[0]) - lower_bound(a, a + n, a[0]);
		for (p = &a[0]; t < n; ) {
			p = upper_bound(a, a + n, *p);
			s = upper_bound(a, a + n, *p) - lower_bound(a, a + n, *p);
			t += upper_bound(a, a + n, *p) - lower_bound(a, a + n, *p);
			if (res < s) {
				res = s;
				color = *p;
			}
		}
		if (2 * res > n ) { cout << color << endl; }
		else cout << "NO COLOR" << endl;
	
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:43: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   13 |                 for (int i = 0; i < n;i++)scanf_s("%lld", &a[i]);
      |                                           ^~~~~~~
      |                                           scanf
Language: C++

while 1:
    nums = int(input())
    if nums != 0:
        d = {}
        stars = list(map(int,input().split()))
        for x in stars:
            if x not in d:
                d[x] = 1
            else:
                d[x] += 1

        key = list(d.keys())
        val = list(d.values())
        m = int(max(val))
        if m > nums/2:
            res = key[val.index(m)]
            print(res)
        else:
            print("NO COLOR")
    else:break

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while 1:
      | ^~~~~
a.cc:5:9: error: 'stars' does not name a type
    5 |         stars = list(map(int,input().split()))
      |         ^~~~~
Language: C++

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

int getInt(){
  int ret = 0, c;
  c = getchar();
  while(!isdigit(c)) c = getchar();
  while(isdigit(c)){
    ret *= 10;
    ret += c - '0';
    c = getchar();
  }
  return ret;
}

#define mask (0x7F)
int cnt[mask];

int main(){
  int n, i;
  while(n = getInt()){
    const int n2 = n / 2;
    memset(cnt, 0, sizeof(cnt));

    for(i = 0; i < n; i++){
      int a = getInt();
      if(++cnt[a & mask] > n2){
	printf("%d\n", a);
	for(++i; i < n; i++)
	  getInt();
	goto end;
      }
    }

    puts("NO COLOR");

  end:;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int getInt()':
a.cc:8:10: error: 'isdigit' was not declared in this scope
    8 |   while(!isdigit(c)) c = getchar();
      |          ^~~~~~~
a.cc:9:9: error: 'isdigit' was not declared in this scope
    9 |   while(isdigit(c)){
      |         ^~~~~~~
Language: C++

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

#define BUFF_SIZE 1024
char buffer[1024 * 1024];
int pos = 0;
int end = 0;

int mygetchar(){
  if(pos == end){
    int i;
    end = read(0, buffer, sizeof(buffer));
    pos = 0;
  }
  return buffer[pos++];
}

int getInt(){
  int ret = 0, c;
  c = mygetchar();
  while(!isdigit(c)) c = mygetchar();
  while(isdigit(c)){
    ret *= 10;
    ret += c - '0';
    c = mygetchar();
  }
  return ret;
}

#define mask (0x7F)
int cnt[mask];

int main(){
  int n, i;
  while(n = getInt()){
    const int n2 = n / 2;
    memset(cnt, 0, sizeof(cnt));

    for(i = 0; i < n; i++){
      int a = getInt();

      if(++cnt[a & mask] > n2){
	printf("%d\n", a);
	for(++i; i < n; i++)
	  getInt();
	goto end;
      }

    }

    puts("NO COLOR");

  end:;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int mygetchar()':
a.cc:13:11: error: 'read' was not declared in this scope; did you mean 'fread'?
   13 |     end = read(0, buffer, sizeof(buffer));
      |           ^~~~
      |           fread
a.cc: In function 'int getInt()':
a.cc:22:10: error: 'isdigit' was not declared in this scope
   22 |   while(!isdigit(c)) c = mygetchar();
      |          ^~~~~~~
a.cc:23:9: error: 'isdigit' was not declared in this scope
   23 |   while(isdigit(c)){
      |         ^~~~~~~
Language: C++

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

#define BUFF_SIZE 1024
char buffer[4 * 1024 * 1024];
int pos = 0;
int end = 0;

int mygetchar(){
  if(pos == end){
    end = read(0, buffer, sizeof(buffer));
    pos = 0;
  }
  return buffer[pos++];
}

__attribute__((always_inline)) int getInt(){
  int ret = 0, c;
  c = mygetchar();
  while(!isdigit(c)) c = mygetchar();
  while(isdigit(c)){
    ret *= 10;
    ret += c - '0';
    c = mygetchar();
  }
  return ret;
}

#define mask (0x7F)

int main(){
  int n, i;
  while(n = getInt()){
    const int n2 = n / 2;
    int cnt[mask] = { 0 };
    // memset(cnt, 0, sizeof(cnt));

    for(i = 0; i < n; i++){
      int a = getInt();

      if(++cnt[a & mask] > n2){
	printf("%d\n", a);
	for(++i; i < n; i++)
	  getInt();
	goto end;
      }

    }

    puts("NO COLOR");

  end:;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int mygetchar()':
a.cc:12:11: error: 'read' was not declared in this scope; did you mean 'fread'?
   12 |     end = read(0, buffer, sizeof(buffer));
      |           ^~~~
      |           fread
a.cc: In function 'int getInt()':
a.cc:21:10: error: 'isdigit' was not declared in this scope
   21 |   while(!isdigit(c)) c = mygetchar();
      |          ^~~~~~~
a.cc:22:9: error: 'isdigit' was not declared in this scope
   22 |   while(isdigit(c)){
      |         ^~~~~~~
a.cc: At global scope:
a.cc:18:36: warning: 'always_inline' function might not be inlinable unless also declared 'inline' [-Wattributes]
   18 | __attribute__((always_inline)) int getInt(){
      |                                    ^~~~~~
Language: C++

#include<iostream>

using namespace std;


int main()
{	
	long long caseNum;
	while(cin>>caseNum)
	{
		if(caseNum == 0) break;
		else
		{	
			int *table;
			table = (int *)malloc(10000000*sizeof(int));
			memset(table,0,10000000);	
			long long big = -100;
			long long small = 100;

			for(long i = 0;i < caseNum; i ++)
			{	
				long long deal;
				cin>>deal;
				if(big < deal) big = deal;
				if(small > deal) small = deal;

				table[deal] ++;
			}
			
			long threadhold = caseNum / 2;
			//cout<<"t "<<threadhold<<endl;

			long j;
			for( j = small; j <= big; j ++)
			{
				//cout<<j<<" "<<table[j]<<endl;
				if(table[j] > threadhold) 
				{
					cout<<j<<endl;
					break;
				}
			}
			if(j > big)
			{
				cout<<"NO COLOR"<<endl;
			}
			free(table);
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:25: error: 'memset' was not declared in this scope
   16 |                         memset(table,0,10000000);
      |                         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 |
Language: C++

#include<iostream>
#include<memory>

using namespace std;


int main()
{	
	long long caseNum;
	while(cin>>caseNum)
	{
		if(caseNum == 0) break;
		else
		{	
			int *table;
			table = (int *)malloc(10000000*sizeof(int));
			memset(table,0,10000000);	
			long long big = -100;
			long long small = 100;

			for(long i = 0;i < caseNum; i ++)
			{	
				long long deal;
				cin>>deal;
				if(big < deal) big = deal;
				if(small > deal) small = deal;

				table[deal] ++;
			}
			
			long threadhold = caseNum / 2;
			//cout<<"t "<<threadhold<<endl;

			long j;
			for( j = small; j <= big; j ++)
			{
				//cout<<j<<" "<<table[j]<<endl;
				if(table[j] > threadhold) 
				{
					cout<<j<<endl;
					break;
				}
			}
			if(j > big)
			{
				cout<<"NO COLOR"<<endl;
			}
			free(table);
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:25: error: 'memset' was not declared in this scope
   17 |                         memset(table,0,10000000);
      |                         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<memory>
  +++ |+#include <cstring>
    3 |
Language: C++

#include<iostream>
#include<memory>
#include<stdlib.h>

using namespace std;


int main()
{	
	long long caseNum;
	while(cin>>caseNum)
	{
		if(caseNum == 0) break;
		else
		{	
			int *table;
			table = (int *)malloc(10000000*sizeof(int));
			memset(table,0,10000000);	
			long long big = -100;
			long long small = 100;

			for(long i = 0;i < caseNum; i ++)
			{	
				long long deal;
				cin>>deal;
				if(big < deal) big = deal;
				if(small > deal) small = deal;

				table[deal] ++;
			}
			
			long threadhold = caseNum / 2;
			//cout<<"t "<<threadhold<<endl;

			long j;
			for( j = small; j <= big; j ++)
			{
				//cout<<j<<" "<<table[j]<<endl;
				if(table[j] > threadhold) 
				{
					cout<<j<<endl;
					break;
				}
			}
			if(j > big)
			{
				cout<<"NO COLOR"<<endl;
			}
			free(table);
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:25: error: 'memset' was not declared in this scope
   18 |                         memset(table,0,10000000);
      |                         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<stdlib.h>
  +++ |+#include <cstring>
    4 |
Language: Java

class Main {
    public static void main(String[] args) {
        try {
        	Scanner scan = new Scanner(System.in);
        	String str1 = scan.next();
        	String str2 = scan.next();
        	if(Integer.parseInt(str1)>10000 || Integer.parseInt(str2)>10000)
        	{
        		System.out.println("??°??????100000????????§??\?????????????????????");
        	}
        	System.out.println(getGreatest(str1,str2));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

 
   private static int getGreatest(String a,String b) {
        int num1 = Integer.parseInt(a);
        int num2 = Integer.parseInt(b);
        int min_num = Math.min(num1, num2);
        for(int d = min_num; d>0; d--)
        {
             if(num1%d==0 && num2%d==0)
             {
            	 return d;
             }
   
        }
       return 0; 
        
       }
}

Compiler output:
Main.java:9: error: illegal escape character
        		System.out.println("?????????100000???????????\?????????????????????");
        		                                               ^
1 error
Language: Java

import java.io.*;
import java.util.Scanner;


public class Main {
    public static void main(String[] args) {
       
        	Scanner scan = new Scanner(System.in);
        	String str1 = scan.next();
        	String str2 = scan.next();
        	if(Integer.parseInt(str1)>10000 || Integer.parseInt(str2)>10000)
        	{
        		System.out.println("??°??????100000????????§??\?????????????????????");
        	}
        	System.out.println(getGreatest(Integer.parseInt(str1),Integer.parseInt(str2)));
       
    }

 
   public static int getGreatest(int a,int b) {
       
	   int r;
       
	   if(a<b)
       {
    	   int temp = a;
    	   a = b;
    	   b = temp;
       }
       
       while(b>0)
       {
    	   r = a % b;
    	   a = b;
    	   b = r;
    	   return r;
       }
       return 0;
       }

Compiler output:
Main.java:13: error: illegal escape character
        		System.out.println("?????????100000???????????\?????????????????????");
        		                                               ^
Main.java:39: error: reached end of file while parsing
       }
        ^
2 errors
Language: Java

class Main {
    public static void main(String[] args) {
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String line = br.readLine();
            StringTokenizer st = new StringTokenizer(line, " ");
            while(line != "") {
            	int x = Integer.parseInt(st.nextToken());
                int y = Integer.parseInt(st.nextToken());

            	if(x < y) {
            		x = x + y;
                	y = x - y;
                	x = x - y;

            	}

            	while(y > 0) {
            		int r = x % y;
            		x = y;
            		y = r;
            	}
            	System.out.println(x);
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

Compiler output:
Main.java:29: error: reached end of file while parsing
    }
     ^
1 error