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

#include <stdio.h>
void Search(int,int );
int S[10000],T[10000];

void Search(int n,int q){
int i,j,k;
	for(i=0;i<n;i++){
	for(j=0;j<q;j++){
		if(S[i]==T[q])
			k++;
	 T[]=T[]-T[q];
	}
	}
return k;
}
int main(){
int n,q,i,j;

scanf("%d",&n);
for(i=0;i<n;i++)
	scanf("%s",S[i]);

scanf("%d",&q);
for(j=0;j<n;j++)
	scanf("%s",T[j]);
	
Search(n,q);
return 0;
}

Compiler output:
main.c: In function 'Search':
main.c:11:12: error: expected expression before ']' token
   11 |          T[]=T[]-T[q];
      |            ^
main.c:14:8: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   14 | return k;
      |        ^
main.c:5:6: note: declared here
    5 | void Search(int n,int q){
      |      ^~~~~~
Language: C

#include <stdio.h>
void Search(int,int);
int S[10000],T[10000];

void Search(int n,int q){
int left,right,mid,k;
while(left < right){
    mid = (left + right) / 2;
    if(S[mid] == k){
     return 1;
    }
    else if(k < S[mid]){
      right = mid ; 
    }
    else{
      left = mid + 1;
    }
  }
return 0;

}
int main(){
int n,q,i,j,count;

scanf("%d",&n);
for(i=0;i<n;i++)
	scanf("%d",&S[i]);

scanf("%d",&q);
for(j=0;j<n;j++)
scanf("%d",&T[j]);

 if(Search(n,q))count++;
}
printf("%d\n",count);

return 0;
}

Compiler output:
main.c: In function 'Search':
main.c:10:13: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   10 |      return 1;
      |             ^
main.c:5:6: note: declared here
    5 | void Search(int n,int q){
      |      ^~~~~~
main.c:19:8: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   19 | return 0;
      |        ^
main.c:5:6: note: declared here
    5 | void Search(int n,int q){
      |      ^~~~~~
main.c: In function 'main':
main.c:33:5: error: void value not ignored as it ought to be
   33 |  if(Search(n,q))count++;
      |     ^~~~~~
main.c: At top level:
main.c:35:8: error: expected declaration specifiers or '...' before string constant
   35 | printf("%d\n",count);
      |        ^~~~~~
main.c:35:15: error: unknown type name 'count'
   35 | printf("%d\n",count);
      |               ^~~~~
main.c:37:1: error: expected identifier or '(' before 'return'
   37 | return 0;
      | ^~~~~~
main.c:38:1: error: expected identifier or '(' before '}' token
   38 | }
      | ^
Language: C

#include <stdio.h>
void Search(int,int);
int S[10000],T[10000];

void Search(int n,int q){
int left,right,mid,k;
while(left < right){
    mid = (left + right) / 2;
    if(S[mid] == k){
     return 1;
    }
    else if(k < S[mid]){
      right = mid ; 
    }
    else{
      left = mid + 1;
    }
  }
return 0;

}
int main(){
int n,q,i,j,count;

scanf("%d",&n);
for(i=0;i<n;i++)
	scanf("%d",&S[i]);

scanf("%d",&q);
for(j=0;j<n;j++)
scanf("%d",&T[j]);

 if( Search(n,q) )count++;

printf("%d\n",count);

return 0;
}

Compiler output:
main.c: In function 'Search':
main.c:10:13: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   10 |      return 1;
      |             ^
main.c:5:6: note: declared here
    5 | void Search(int n,int q){
      |      ^~~~~~
main.c:19:8: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   19 | return 0;
      |        ^
main.c:5:6: note: declared here
    5 | void Search(int n,int q){
      |      ^~~~~~
main.c: In function 'main':
main.c:33:6: error: void value not ignored as it ought to be
   33 |  if( Search(n,q) )count++;
      |      ^~~~~~
Language: C

#include <stdio.h>
void Search(int,int);
int S[10000],T[10000];

void Search(int k){
int left,right,mid,k;
while(left < right){
    mid = (left + right) / 2;
    if(S[mid] == k){
     return 1;
    }
    else if(k < S[mid]){
      right = mid ; 
    }
    else{
      left = mid + 1;
    }
  }
return 0;

}
int main(){
int n,q,i,j,count;

scanf("%d",&n);
for(i=0;i<n;i++)
	scanf("%d",&S[i]);

scanf("%d",&q);
for(j=0;j<n;j++){
scanf("%d",&T[j]);

 if( Search(T[j]) )count++;
}
printf("%d\n",count);

return 0;
}

Compiler output:
main.c:5:6: error: conflicting types for 'Search'; have 'void(int)'
    5 | void Search(int k){
      |      ^~~~~~
main.c:2:6: note: previous declaration of 'Search' with type 'void(int,  int)'
    2 | void Search(int,int);
      |      ^~~~~~
main.c: In function 'Search':
main.c:6:20: error: 'k' redeclared as different kind of symbol
    6 | int left,right,mid,k;
      |                    ^
main.c:5:17: note: previous definition of 'k' with type 'int'
    5 | void Search(int k){
      |             ~~~~^
main.c:10:13: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   10 |      return 1;
      |             ^
main.c:5:6: note: declared here
    5 | void Search(int k){
      |      ^~~~~~
main.c:19:8: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   19 | return 0;
      |        ^
main.c:5:6: note: declared here
    5 | void Search(int k){
      |      ^~~~~~
main.c: In function 'main':
main.c:33:6: error: void value not ignored as it ought to be
   33 |  if( Search(T[j]) )count++;
      |      ^~~~~~
Language: C

#include <stdio.h>
void Search(int,int);
int S[10000],n;

void Search(int k){

int left=0;
int right=n;
int mid;
while(left < right){
    mid = (left + right) / 2;
    if(S[mid] == k){
     return 1;
    }
    else if(k < S[mid]){
      right = mid ; 
    }
    else{
      left = mid + 1;
    }
  }
return 0;

}
int main(){
int n,q,i,j,count;

scanf("%d",&n);
for(i=0;i<n;i++)
	scanf("%d",&S[i]);

scanf("%d",&q);
for(j=0;j<n;j++){
scanf("%d",&T[j]);
 if( Search(T[j]) )count++;
}
printf("%d\n",count);

return 0;
}

Compiler output:
main.c:5:6: error: conflicting types for 'Search'; have 'void(int)'
    5 | void Search(int k){
      |      ^~~~~~
main.c:2:6: note: previous declaration of 'Search' with type 'void(int,  int)'
    2 | void Search(int,int);
      |      ^~~~~~
main.c: In function 'Search':
main.c:13:13: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   13 |      return 1;
      |             ^
main.c:5:6: note: declared here
    5 | void Search(int k){
      |      ^~~~~~
main.c:22:8: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   22 | return 0;
      |        ^
main.c:5:6: note: declared here
    5 | void Search(int k){
      |      ^~~~~~
main.c: In function 'main':
main.c:34:13: error: 'T' undeclared (first use in this function)
   34 | scanf("%d",&T[j]);
      |             ^
main.c:34:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int S[10000],n;

int Search(int k[]){
int left=0;
int right=n;
int mid;
while(left < right){
    mid = (left + right) / 2;
    if(S[mid] == k[])
     return 1;
    else if(k[] < S[mid]){
      right = mid ; 
    }
    else
      left = mid + 1;
  }
return 0;
}

int main(){

int n,q,i,j,T[10000];
int count=0;


scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&S[i]);

scanf("%d",&q);
for(j=0;j<n;j++){
scanf("%d",T[j]);
 if( Search(T[j])==1 )count++;
}
printf("%d\n",count);
return 0;
}

Compiler output:
main.c: In function 'Search':
main.c:11:20: error: expected expression before ']' token
   11 |     if(S[mid] == k[])
      |                    ^
main.c: In function 'main':
main.c:35:14: error: passing argument 1 of 'Search' makes pointer from integer without a cast [-Wint-conversion]
   35 |  if( Search(T[j])==1 )count++;
      |             ~^~~
      |              |
      |              int
main.c:5:16: note: expected 'int *' but argument is of type 'int'
    5 | int Search(int k[]){
      |            ~~~~^~~
Language: C

#include<stdio.h>










int main(){
 int i,j,n,q;
 int count=0;
 int pivot;

scanf("%d",&n);
int S[n];
for(i=0;i<n;i++){ scanf("%d",&S[i]);}

scanf("%d",&q);
int T[q];
for(i=0;i<q;i++){ scanf("%d",&T[i]);}

pivot=S[n/2];

for(i=0;i<q;i++){ 
 if(T[i]<pivot){
  for(j=0;j<n/2;j++){ if(T[i]==S[j]){count++; break;}
 }else{
  for(j=n/2;j<n;j++){ if(T[i]==S[j]){count++; break;}
 }

}



if(T[i]==S[j]){count++; break;} }}

printf("%d\n",count);

return 0;
} 

Compiler output:
main.c: In function 'main':
main.c:30:3: error: expected '}' before 'else'
   30 |  }else{
      |   ^~~~
main.c: At top level:
main.c:40:8: error: expected declaration specifiers or '...' before string constant
   40 | printf("%d\n",count);
      |        ^~~~~~
main.c:40:15: error: unknown type name 'count'
   40 | printf("%d\n",count);
      |               ^~~~~
main.c:42:1: error: expected identifier or '(' before 'return'
   42 | return 0;
      | ^~~~~~
main.c:43:1: error: expected identifier or '(' before '}' token
   43 | }
      | ^
Language: C

#include<stdio.h>

int S[100000], T[50000], C = 0;

void binarysearch(int,int,int);

int main(){
    //??\???
    int n, q= 0;
    scanf("%d",&n);
    printf("%d\n",n);
    for(int i = 0; i < n; i++){
        scanf("%d",&S[i]);
        printf("%d ",S[i]);
    }//S??????????????????????????????
    printf("\n");
    scanf("%d",&q);
    printf("%d\n",q);
    for(int j = 0; j < q; j++){
        scanf("%d",&T[j]);
        printf("%d ",T[j]);
        
    }
    printf("\n");//T??????????????????????????????
    
   
    for(int k = 0; k < q; k++){
        binarysearch(S[0],S[n-1],T[k]);
    }
    printf("%d\n",C);
    return 0;
}


void binarysearch(left,right,key){
    int mid;
    mid = (left + right)/2;
    if(left < right){
        if (mid == key){
            C++;
        }
        else{
            if(mid < key){
                binarysearch(mid + 1,right,key);
            }
            else{
                binarysearch(left, mid);
            }
        }
    }
    else if(left == right){
        if (mid == key){
            C++;
        }
    }
}

Compiler output:
main.c: In function 'binarysearch':
main.c:35:6: error: type of 'left' defaults to 'int' [-Wimplicit-int]
   35 | void binarysearch(left,right,key){
      |      ^~~~~~~~~~~~
main.c:35:6: error: type of 'right' defaults to 'int' [-Wimplicit-int]
main.c:35:6: error: type of 'key' defaults to 'int' [-Wimplicit-int]
main.c:47:17: error: too few arguments to function 'binarysearch'
   47 |                 binarysearch(left, mid);
      |                 ^~~~~~~~~~~~
main.c:35:6: note: declared here
   35 | void binarysearch(left,right,key){
      |      ^~~~~~~~~~~~
Language: C

#include<stdio.h>

int S[100000], T[50000], C = 0;

void binarysearch(int,int,int);

int main(){
    //??\???
    int n, q= 0;
    scanf("%d",&n);
    //printf("%d\n",n);
    for(int i = 0; i < n; i++){
        scanf("%d",&S[i]);
        //printf("%d ",S[i]);
    }//S??????????????????????????????
    //printf("\n");
    scanf("%d",&q);
    //printf("%d\n",q);
    for(int j = 0; j < q; j++){
        scanf("%d",&T[j]);
        //printf("%d ",T[j]);
        
    }
    //printf("\n");//T??????????????????????????????
    
   
    for(int k = 0; k < q; k++){
        binarysearch(0,n-1,T[k]);
    }
    printf("%d\n",C);
    return 0;
}


void binarysearch(left,right,key){
    int mid;
    mid = (left + right)/2;
    if(left < right){
        if (S[mid] == key){
            C++;
        }
        else{
            if(S[mid] < key){
                binarysearch(mid + 1,right,key);
            }
            else{
                binarysearch(left, mid);
            }
        }
    }
    else if(left == right){
        if (S[mid] == key){
            C++;
        }
    }
}

Compiler output:
main.c: In function 'binarysearch':
main.c:35:6: error: type of 'left' defaults to 'int' [-Wimplicit-int]
   35 | void binarysearch(left,right,key){
      |      ^~~~~~~~~~~~
main.c:35:6: error: type of 'right' defaults to 'int' [-Wimplicit-int]
main.c:35:6: error: type of 'key' defaults to 'int' [-Wimplicit-int]
main.c:47:17: error: too few arguments to function 'binarysearch'
   47 |                 binarysearch(left, mid);
      |                 ^~~~~~~~~~~~
main.c:35:6: note: declared here
   35 | void binarysearch(left,right,key){
      |      ^~~~~~~~~~~~
Language: C

#include<stdio.h>

int S[100000], T[50000], C = 0;

void binarysearch(int,int,int);

int main(){
    int n, q= 0;
    scanf("%d",&n);
    for(int i = 0; i < n; i++){
        scanf("%d",&S[i]);
    }
    scanf("%d",&q);
    for(int j = 0; j < q; j++){
        scanf("%d",&T[j]);
        
    }
    
   
    for(int k = 0; k < q; k++){
        binarysearch(0,n-1,T[k]);
    }
    printf("%d\n",C);
    return 0;
}


void binarysearch(left,right,key){
    int mid;
    mid = (left + right)/2;
    if(left < right){
        if (S[mid] == key){
            C++;
        }
        else{
            if(S[mid] < key){
                binarysearch(mid + 1,right,key);
            }
            else{
                binarysearch(left, mid);
            }
        }
    }
    else if(left == right){
        if (S[mid] == key){
            C++;
        }
    }
}

Compiler output:
main.c: In function 'binarysearch':
main.c:28:6: error: type of 'left' defaults to 'int' [-Wimplicit-int]
   28 | void binarysearch(left,right,key){
      |      ^~~~~~~~~~~~
main.c:28:6: error: type of 'right' defaults to 'int' [-Wimplicit-int]
main.c:28:6: error: type of 'key' defaults to 'int' [-Wimplicit-int]
main.c:40:17: error: too few arguments to function 'binarysearch'
   40 |                 binarysearch(left, mid);
      |                 ^~~~~~~~~~~~
main.c:28:6: note: declared here
   28 | void binarysearch(left,right,key){
      |      ^~~~~~~~~~~~
Language: C

#include<bits/stdc++.h>

#define ms(a,x) memset(a,x,sizeof(a))
using namespace std;

typedef long long ll;

int gcd(int a,int b){
	if(b==0)return a;
	return gcd(b,a%b);}
int lcm(int a,int b){
	return a/gcd(a,b)*b;}

int main(){
	int A[1000000],n,q;
	
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>A[i];
	} 
	cin>>q;
	int x,ans=0;
	for(int i=0;i<q;i++){
		cin>>x;
		if(*lower_bound(A,A+n,x)==x)ans++;
	}
	cout<<ans<<endl;
	return 0;
}




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

#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>


#define MAX 100001

int kensaku(int S[], int T[], int Q, int N)
{

	int i = 0, j = 0, k = 0, z = 0;
	int EOFcount = 0, V[MAX];

	for (j = 0; j < N; j++) {
		
			for (k = 0; k < z; k++) {
				if (S[j] == V[k]) {//S[j]の値がV[]の中にあったら
					EOFcount++;
					break;
				}
			}
		
		for (i = 0; i < Q; i++) {
			if (EOFcount == 1) { break; }
			
			if (S[j] == T[i]) {//SがTと同じ値なら
				V[z] = S[j];
				z++;
				break;
			}
		}
		EOFcount = 0;
		}

	return z;
}



int main(void)
{
	int i;
	int n, q, count = 0;
	int s[MAX], t[MAX];

	/////一つ目の配列の要素数と要素/////
	scanf("%d", &n);

	for (i = 0; i < n; i++) {
		scanf("%d", &s[i]);
	}
	////////////////////////////////////

	/////二つ目の配列の要素数と要素/////
	scanf("%d", &q);

	for (i = 0; i < q; i++) {
		scanf("%d", &t[i]);
	}
	////////////////////////////////////

	printf("%d\n", count = kensaku(s, t, q, n));

	return 0;
}}


Compiler output:
main.c:64:2: error: expected identifier or '(' before '}' token
   64 | }}
      |  ^
Language: C

define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>


#define MAX 1000

int kensaku(const int S[], const int T[], const int Q, const int N)
{

	int i = 0, j = 0, k = 0, z = 0;
	int  V[MAX];
	int mid, top, bot, error = 0;
	bot = 0;
	top = N;
	mid = ((bot + top) / 2);
	
	

	for (i = 0; i < Q; i++) {
		
		for (k = 0; k < z; k++) {
			if (T[i] == V[k]) { error++;  break; }
		}

		if (error == 1) { error = 0; continue; }


			if (T[i] < S[mid]) {
				for (j = mid; j >= 0; j--) {
					if (T[i] == S[j]) {
						V[z] = T[i];
						z++;
						break;
					}
				}
			}

			else if (T[i] > S[mid]) {
				for (j = mid; j <= top; j++) {
					if (T[i] == S[j]) {
						V[z] = T[i];
						z++;
						break;
					}
				}
			}

			else if(T[i] == S[mid]){
				V[z] = T[i];
				z++;
			}
		}
				

	return z;
}



int main(void)
{
	int i;
	int n, q, count = 0;
	int s[MAX], t[MAX];

	scanf("%d", &n);

	for (i = 0; i < n; i++) {
		scanf("%d", &s[i]);
	}

	scanf("%d", &q);

	for (i = 0; i < q; i++) {
		scanf("%d", &t[i]);
	}

	count = kensaku(s, t, q, n);
	printf("%d\n", count);

	return 0;
}


Compiler output:
main.c:1:1: error: unknown type name 'define'
    1 | define _CRT_SECURE_NO_WARNINGS
      | ^~~~~~
main.c:1:31: error: expected ';' before 'typedef'
    1 | define _CRT_SECURE_NO_WARNINGS
      |                               ^
      |                               ;
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#define MAX 10100
#define SMAX 50200

int binary_search(int a, int b[],int n);
void input(int a[]);

int main(void)
{
    int count=0;
    int n[1];
    int q[1];
    int S[MAX];
    int T[MAX];
    input(n);
    input(S);    
    input(q);
    input(T);
    for(int i=0;i<q[0];i++)
    {
        if(binary_search(T[i],S,0,n[0])){count++;}
    }
    printf("%d\n",count);


    return 0;
    
}

int binary_search(int a, int b[],int head,int tail)
{
    if(tail-head==2)
    {
        if(a==b[head]){return 1;}
        else if(a==b[tail]){return 1;}
    }
    else
    {
        if(a<=b[(head+tail)/2])
        {
            tail=(head+tail)/2;
            return binary_search(a,b,head,tail);
        }
        else
        {
            head=(head+tail)/2;
            return binary_search(a,b,head,tail);
        }
    }
}
void input(int a[])
{
    char str[SMAX];
    int x;
    int j=0;
    fgets(str,SMAX,stdin);
    int i=0;
    while(str[i]>=' ')
    {
        while(isspace(str[i])){i++;}
        if(isdigit(str[i]))
        {
            x=0;
            while(isdigit(str[i]))
            {
                x=10*x+(str[i]-'0');
                i++;
            }
            a[j]=x;
            j++;
        }
        else
        {
            i++;
        }
    }
}


Compiler output:
main.c: In function 'main':
main.c:24:12: error: too many arguments to function 'binary_search'
   24 |         if(binary_search(T[i],S,0,n[0])){count++;}
      |            ^~~~~~~~~~~~~
main.c:8:5: note: declared here
    8 | int binary_search(int a, int b[],int n);
      |     ^~~~~~~~~~~~~
main.c: At top level:
main.c:33:5: error: conflicting types for 'binary_search'; have 'int(int,  int *, int,  int)'
   33 | int binary_search(int a, int b[],int head,int tail)
      |     ^~~~~~~~~~~~~
main.c:8:5: note: previous declaration of 'binary_search' with type 'int(int,  int *, int)'
    8 | int binary_search(int a, int b[],int n);
      |     ^~~~~~~~~~~~~
Language: C

#include <stdio.h>
int n;
int Bsearch(int A[],int key){
        int left=0,right=n;
        while(left<right) {
                int mid = (left + right)/2;
                if (A[mid] == key) {
                        return 1;
                }
                if (key > A[mid]) {
                        left = mid+1;
                }
                else if(key < A[mid]){
                      right = mid;
                }
        }
        return 0;
}
int main(){
        int A[100000];
        int i,q,key,sum=0;
        scanf("%d",&n);
        for(i=0; i<n; i++) {
                scanf("%d",&A[i]);
        }
        scanf("%d",&q);
        for(i=0; i<q; i++) {
                scanf("%d",&key);
                if(Bsearch(A,key)) {
                        sum++;
                }
        }
        printf("%d\n",sum);
        return 0;


Compiler output:
main.c: In function 'main':
main.c:34:9: error: expected declaration or statement at end of input
   34 |         return 0;
      |         ^~~~~~
Language: C

#include<stdio.h>

int A[1000000],n;

int binarysearch(int key){
  int left=0;
  int right=n;
  int mid;
  while(left<right){
    mid=(left+right)/2;
    if(key==A[mid]) return 1;
    if(key>A[mid]) left=mid+1;
    else if(key<A[mid]) right = mid;
  }
  return 0;
}

int main(){
  int i,q,k,sum=0;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }

  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&k);
    if(binarysearch(k)) sum++;
  }
  print("%d\n",sum);
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:31:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   31 |   print("%d\n",sum);
      |   ^~~~~
      |   printf
Language: C

#include<stdio.h>

int main(){

  int n,q,i,j,k,C=0,m,r;
  int S[100000];
  int T[50000];

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&T[i]);
  }


    for(i=0;i<q;i++){
      r=n-1;
      l=0;
      while(1){
	m=(r-l)/2;
	if(S[m]>T[i]){
	  if((r-l)%2!=0)r=m-1; 
	  else r=m;
	}
	  else if(S[m]<T[i]){
	    if((r-l)%2!=0)l=m+1;
	    else l=m;
	  }
	  else{
	  C++;
	  break;
	}
      }
      if((r-l)==2) break;
    }	
  printf("%d\n",C);
  return 0;
}



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

#include <stdio.h>

#define N 100000

int binarySearch(int[],int[],int,int);

int main(){
    
    int i,n,q;
    
    scanf("%d",&n);
    
   if(n<=N){
        
        int s[N];
        
        for(i=0 ; i<n ; i++){
            scanf("%d",&s[i]);
        }

        scanf("%d",&q);
        
       if(q<=N){
            
            int t[N];
            
            for(i=0 ; i<q ; i++){
                scanf("%d",&t[i]);
            }
            
            printf("%d\n",linerSearch(s,t,n,q));

        }
    }
    return 0;
}


int  biinarySearch(int s[N],int t[N],int n,int q){
    int i,j=0,count=0,key;
    for(i=0 ; i<q ; i++){
        j = 0;
        key = t[i];
        while(s[j] != key){
           j++;
           if(j==n)break;
        }
        if(j!=n)count++;
    }
    return count;
}



Compiler output:
main.c: In function 'main':
main.c:31:27: error: implicit declaration of function 'linerSearch'; did you mean 'binarySearch'? [-Wimplicit-function-declaration]
   31 |             printf("%d\n",linerSearch(s,t,n,q));
      |                           ^~~~~~~~~~~
      |                           binarySearch
Language: C

#include <stdio.h>

#define N 100000

int binarySearch(int[],int[],int,int);

int main(){
    
    int i,n,q;
    
    scanf("%d",&n);
    
   if(n<=N){
        
        int s[N];
        
        for(i=0 ; i<n ; i++){
            scanf("%d",&s[i]);
        }

        scanf("%d",&q);
        
       if(q<=N){
            
            int t[N];
            
            for(i=0 ; i<q ; i++){
                scanf("%d",&t[i]);
            }
            
            printf("%d\n",binarySearch(s,t,n,q));

        }
    }
    return 0;
}


int  binarySearch(int s[N],int t[N],int n,int q){
    int key,i,mid,left=0,right = n;
    for(i=0;i<q;i++){
        key = t[i];
        while(left<right){
            mid = (left+right)/2;
            if(s[mid] == key)count++;
            else if(key<s[mid]) right = mid;
            else left = mid + 1;
        }
    }
    return count;
}



Compiler output:
main.c: In function 'binarySearch':
main.c:45:30: error: 'count' undeclared (first use in this function)
   45 |             if(s[mid] == key)count++;
      |                              ^~~~~
main.c:45:30: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main(){

  int n,q,i,j,k,C=0,m,r,l;
  int S[100000];
  int T[50000];

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&T[i]);
  }


    for(i=0;i<q;i++){
      r=n-1;
      l=0;
      while(l<r){
	m=(r+l)/2;
	if(S[m]>T[i]){ 
	  r=m;
	  continue;
	}
	  else if(S[m]<T[i]){
	    l=m+1;
	    continue;
	  }
	  else (S[m]==T[i]){
	  C++;
	  break;
	}
	
    }	
  printf("%d\n",C);
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:32:28: error: expected ';' before '{' token
   32 |           else (S[m]==T[i]){
      |                            ^
      |                            ;
main.c:40:1: error: expected declaration or statement at end of input
   40 | }
      | ^
Language: C

#include<stdio.h>
#define n_find 0
#define find 1
int b_search(int);
void sort();
void swap(int,int);
int n;
int q;
int l[100000];
int main(){
  int i;
  int q_n;
  int result=0;
  scanf("%d",&n);
  for(i=0;i<n;i++)scanf("%d",&l[i]);
  sort();
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&q_n);
    result+=b_search(q_n);
  }
  printf("%d\n",result);
  return 0;
}
int b_search(int x){
  int i;
  int left=0;
  int right=n;
  int mid;
  int flag=0;
  while(left<right){
    mid=(left+right)/2;
    if(l[mid]==x)return find;
    else if(x<l[mid])right=mid;
    else left=mid+1;
  }
  return n_find;
}
void sort(){
  int i;
  int j;
  int min;
  for(i=0;i<n-1;i++){
    min=i;
    for(j=i;j<n-1;j++){
      if(l[j]>l[j+1])min=j;
    }
    if(min!=i)swap(min,i);
  }
}
void swap(int x){
  int temp;
  temp=l[x];
  l[x]=l[x+1];
  l[x+1]=temp;
}
  



Compiler output:
main.c:51:6: error: conflicting types for 'swap'; have 'void(int)'
   51 | void swap(int x){
      |      ^~~~
main.c:6:6: note: previous declaration of 'swap' with type 'void(int,  int)'
    6 | void swap(int,int);
      |      ^~~~
Language: C

#include<stdio.h>

int Btree(int[],int,int);

int main(){
  int n,data[10001],q,key,i,total=0;
  scanf("%d",&n);
  for(i=0;i<n;i++)scanf("%d",&data[i]);
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&key);
    if(Btree(data,key))total++;
  }
  printf("%d\n",total);
  return 0;
}

int Btree(int data[],int key,int n){
  int left,right,mid;
  left=0;
  right=n;
  while(left<right){
    mid=(left+right)/2;
  if(data[mid]==key)return 1;
  else if(key<data[mid])right=mid;
  else left=mid+1;
  }
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:12:8: error: too few arguments to function 'Btree'
   12 |     if(Btree(data,key))total++;
      |        ^~~~~
main.c:3:5: note: declared here
    3 | int Btree(int[],int,int);
      |     ^~~~~
Language: C

#include<stdio.h>
#define N 10000

int binarySearch(int [],int,int);
int main(){
    int A[N],i,n,q,key,x,count=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&A[i]);
    }
    scanf("%d",&q);
    for(i=0;i<q;i++){
        scanf("%d",&key);
        x= binarySearch(A,n,key);
        if(x==1) count++;
    }
    printf("%d\n",count);
    
    return 0;
}

int  binarySearch(int A[],int n, int key){
    int left=0;
    int right =n;
   
    while(left<right){
        int mid=(left+right)/2;
        if(A[mid]==key) return 1;
        else if(ke>A[mid]) right=mid;
        else left = mid+1;right=mid;
    }
    return n+1;
    
}



Compiler output:
main.c: In function 'binarySearch':
main.c:29:17: error: 'ke' undeclared (first use in this function); did you mean 'key'?
   29 |         else if(ke>A[mid]) right=mid;
      |                 ^~
      |                 key
main.c:29:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int A[10000],n;

int search(int t){
  int left=0,right=n,mid;
  while (left<right){
    mid=(left+right)/2;
    if(t==A[mid])return 1;
    if(t>A[mid])left=mid+1;
    else if(t<A[mid])right=mid;
  }
  return 0;
}


int main(){
  int i,ans=0,q,t;

  scanf("%d",&n);

  for(i=0;i<n;i++)
        scanf("%d",&S[i]);

  scanf("%d",&q);

   for(i=0;i<q;i++){
          scanf("%d",&t);
          if(search(t))
              ans++;

     }

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





Compiler output:
main.c: In function 'main':
main.c:23:21: error: 'S' undeclared (first use in this function)
   23 |         scanf("%d",&S[i]);
      |                     ^
main.c:23:21: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int N=0,N2,s[N];

int binarySearch(int key){
  int left=0;
  int right=N;
  int mid;

  while(left<right){
    mid=(left+right)/2;
    if(key==s[mid])return 1;
    if(key>s[mid])left=mid+1;
    else if(key<s[mid])right=mid;
  }
  return 0;

}

int main(){

  int i,key,c=0;

  scanf("%d",&N);

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

  scanf("%d",&N2);

  for(i=0;i<N2;i++){
    scanf("%d",&key);
    if(binarySearch(key))c++;
  }

  printf("%d\n",c);


  return 0;
}


Compiler output:
main.c:3:12: error: variably modified 's' at file scope
    3 | int N=0,N2,s[N];
      |            ^
Language: C

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

int main(int argc, char** argv) {
    
    int n;
    int q;
    int S[10000];
    
    scanf("%d", &n);
    for(int i=0; i<n; i++){
        scanf("%d", &S[i]);
    }
    scanf("%d", &q);
    int left = 0;
    int right = n;
    int mid;
    int count = 0;
    int key;
    for(int a=0; a<q; a++){
        scanf("%d", &key);
        while(left<right){
            mid = (left+right)/2;
            if(key == S[mid]){
                count++;
                break;
            }
            if(key > S[mid]){
                left = mid + 1;
            }
            else if(key > S[mid]){
                right = mid;
            }
            else return NOT_FOUND;
        }
    }
    return 0;
}




Compiler output:
main.c: In function 'main':
main.c:34:25: error: 'NOT_FOUND' undeclared (first use in this function)
   34 |             else return NOT_FOUND;
      |                         ^~~~~~~~~
main.c:34:25: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int main(int argc, char** argv) {
    
    int n;
    int q;
    int S[10000];
    
    scanf("%d", &n);
    for(int i=0; i<n; i++){
        scanf("%d", &S[i]);
    }
    scanf("%d", &q);
    int left = 0;
    int right = n;
    int mid;
    int count = 0;
    int key;
    for(int a=0; a<q; a++){
        scanf("%d", &key);
        while(left<right){
            mid = (left+right)/2;
            if(key > S[mid]){
                left = mid + 1;
            }
            else if(key > S[mid]){
                right = mid;
            }
            else if(key == S[mid]){
                count++;
                break;
            }
            
        }
    }
    printf(“%d\n”, count);
    return 0;
}




Compiler output:
main.c: In function 'main':
main.c:37:12: error: stray '\342' in program
   37 |     printf(<U+201C>%d\n<U+201D>, count);
      |            ^~~~~~~~
main.c:37:13: error: expected expression before '%' token
   37 |     printf(“%d\n”, count);
      |             ^
main.c:37:15: error: stray '\' in program
   37 |     printf(“%d\n”, count);
      |               ^
main.c:37:17: error: stray '\342' in program
   37 |     printf(<U+201C>%d\n<U+201D>, count);
      |                        ^~~~~~~~
Language: C

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

int main(int argc, char** argv) {
    
    int n;
    int q;
    int S[10000];
    
    scanf("%d", &n);
    for(int i=0; i<n; i++){
        scanf("%d", &S[i]);
    }
    scanf("%d", &q);
    int left = 0;
    int right = n;
    int mid;
    int count = 0;
    int key;
    for(int a=0; a<q; a++){
        scanf("%d", &key);
        while(left<right){
            mid = (left+right)/2;
            if(key > S[mid]){
                left = mid + 1;
            }
            else if(key > S[mid]){
                right = mid;
            }
            else if(key == S[mid]){
                count++;
                break;
            }
            
        }
    }
    printf(”%d\n”, count);
    return 0;
}




Compiler output:
main.c: In function 'main':
main.c:37:12: error: stray '\342' in program
   37 |     printf(<U+201D>%d\n<U+201D>, count);
      |            ^~~~~~~~
main.c:37:13: error: expected expression before '%' token
   37 |     printf(”%d\n”, count);
      |             ^
main.c:37:15: error: stray '\' in program
   37 |     printf(”%d\n”, count);
      |               ^
main.c:37:17: error: stray '\342' in program
   37 |     printf(<U+201D>%d\n<U+201D>, count);
      |                        ^~~~~~~~
Language: C

#include <stdio.h>
 
int S[100000]={0},T[50000]={0};
 
int main(){
  int n,q,i,j,cnt=0,start,end;
 
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&S[i]);
    }
 
    scanf("%d",&q);
    for(j=0;j<q;j++){
        scanf("%d",&T[j]);
    }
 
 
    for(i=0;i<q;i++){
 
        start=0,end=n;
 
        while(start < end){
            int middle = (start + end) / 2;
 
            if(S[middle] > T[i]){
                end = middle;
            }
            else if(S[middle] < T[i]){
                start = middle + 1;
            }
            else if(S[middle] == T[i]){
                cnt++;
                break;
            }
        }
    }
 
    printf("%d\n",counter);
 
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:39:19: error: 'counter' undeclared (first use in this function)
   39 |     printf("%d\n",counter);
      |                   ^~~~~~~
main.c:39:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int binary_search(int* A, int n, int i){
  int left  = 0, right = n;
  while(left < right){
    int mid = (left+right)/2;
    if(A[mid] == i) return 1;
    if(A[mid] < i) left = mid+1;
    else right = mid;
  }
  return 0;
}

int main(){
  int S[100000], T[50000], n, m, i, num, = 0;
  scanf("%d",&n);
  for(i = 0; i < n; i++) scanf("%d",&S[i]);
  scanf("%d",&m);
  for(i = 0; i < m; i++) scanf("%d",&T[i]);
  for(i = 0; i < m; i++) num += binary_search(S, n, T[i]);
  printf("%d\n", num);
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:15:42: error: expected identifier or '(' before '=' token
   15 |   int S[100000], T[50000], n, m, i, num, = 0;
      |                                          ^
Language: C

#include<stdio.h>

int binary_search(int* A, int n, int i){
  int left  = 0, right = n;
  while(left < right){
    int mid = (left+right)/2;
    if(A[mid] == i) return 1;
    if(A[mid] < i) left = mid+1;
    else right = mid;
  }
  return 0;
}

int main(){
  int S[100000], T[50000], n, m, i, num, = 0;
  scanf("%d",&n);
  for(i = 0; i < n; i++) scanf("%d",&S[i]);
  scanf("%d",&m);
  for(i = 0; i < m; i++) scanf("%d",&T[i]);
  for(i = 0; i < m; i++) num += binary_search(S, i, T[i]);
  printf("%d\n", num);
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:15:42: error: expected identifier or '(' before '=' token
   15 |   int S[100000], T[50000], n, m, i, num, = 0;
      |                                          ^
Language: C

#include<stdio.h>

int binary_search(int* A, int n, int i){
  int left  = 0, right = n;
  while(left < right){
    int mid = (left+right)/2;
    if(A[mid] == i) return 1;
    if(A[mid] < i) left = mid+1;
    else right = mid;
  }
  return 0;
}

int main(){
  int S[100000], T[50000], n, m, i, num, = 0;
  scanf("%d",&n);
  for(i = 0; i < n; i++) {
    scanf("%d",&S[i]);
  }
  scanf("%d",&m);
  for(i = 0; i < m; i++){
    scanf("%d",&T[i]);
  }
  for(i = 0; i < m; i++) {
    num += binary_search(S, n, T[i]);
  }
  printf("%d\n", num);
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:15:42: error: expected identifier or '(' before '=' token
   15 |   int S[100000], T[50000], n, m, i, num, = 0;
      |                                          ^
Language: C

#include <stdio.h>

int main()
{
  int n,q;
  int count=0,i,j,L,M,R;
  int S[100000],T[50000];

  scanf("%d",&n);
  for(i=0; i<n; i++){
    scanf("%d",&S[i]);
  }

  scanf("%d",&q);
  for(i=0; i<q; i++){
    scanf("%d",&T[i]);
    L = 0;
    R = n;
    while(L < R){
      M = (L + R) / 2;
      if(S[M] < T[i])
        L = M + 1;
      if(S[M] == T[i]){
        count++;
        break;
      }
      if(S[M] > T[i])
        R = M;
    }
  }
  printf("%d\n",C);

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:31:17: error: 'C' undeclared (first use in this function)
   31 |   printf("%d\n",C);
      |                 ^
main.c:31:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<cstdio>
#include<string>
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
  int n;
  scanf("%d",&n);
  vector<int> vc(n);
  for(int i = 0 ; i < n ; i++ ) scanf("%d",&vc[i]);
  int ans = 0,q,a;
  scanf("%d",&q);
  sort(vc.begin(),vc.end());
  while(q--){
    cin >> a;
    if(binary_search(vc.begin(),vc.end(),a)) ans++;
  }
  printf("%d\n",ans);
}



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

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

int BS(int *,int,int);

int main(){
  int i,j,n,m,c=0;
  int *P,*Q;
  scanf("%d",&n);
  P=(int *)malloc(n*sizeof(int));
  for(i=0;i<n;i++){
    scanf("%d",&P[i]);
  }
  scanf("%d",&m);
  Q=(int *)malloc(m*sizeof(int));
  for(i=0;i<m;i++){
    scanf("%d",&Q[i]);
  }
  for(i=0;i<m;i++){
    c+=BS(P,n,Q[i]);
  }
  printf("%d\n",c);
  return 0;
}

int BS(int *P,int n,int k){
  int r=n,l=0,t;
  while(l<r){
    t=(r+l)/2;
    if(k==P[t]){
      return 1;
    }
    if(k>P[t]){
      l=t+1;
    }
    else if(k<P[t]){
      r=t;
    }
    return 0;
  }



Compiler output:
main.c: In function 'BS':
main.c:40:3: error: expected declaration or statement at end of input
   40 |   }
      |   ^
Language: C

#include<stdio.h>

int S[1000000],n;
int binarySearch(int);

int binarySearch(int key){
  int l=0;
  int r=n;
  int mid;
  while(l<r){
    mid=(l+r)/2;
    if(key==S[mid])return 1;
    if(key>S[mid])l=mid+1;
    else if(key<S[mid])r=mid;
  }
  return 0;
}

int main(){
  int a,q,T[1000000],sum=0;


  scanf("%d",&n);
  for(a=0;a<n;a++){
    scanf("%d",&S[a]);
  }



  scanf("%d",&q);
  for(a=0;a<q;a++){
    scanf("%d",&T[a]);
    if(binarySaerch(T[a]))sum++;
  }
  printf("%d",sum);


  return 0;
  
}

  



Compiler output:
main.c: In function 'main':
main.c:33:8: error: implicit declaration of function 'binarySaerch'; did you mean 'binarySearch'? [-Wimplicit-function-declaration]
   33 |     if(binarySaerch(T[a]))sum++;
      |        ^~~~~~~~~~~~
      |        binarySearch
Language: C

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

int BinarySearch(int *,int,int);

int main(){
  int i,j,n,q,c=0;
  int *S,*T;

  scanf("%d",&n);
  S=(int*)malloc(n*sizeof(int));
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }

  scanf("%d",&q);
  T=(int*)malloc(q*sizeof(int));
  for(i=0;i<q;i++){
    scanf("%d",&T[i]);
  }

  for(i=0;i<q;i++){
    c+=BinarySeach(S,T[i],n);
  }

  printf("%d\n",c);

  return 0;

}

int BinarySearch(int *x,int key,int n){
  int mid,max,min=0;

  max=n;

  while(min<max){
    mid=(min+max)/2;
    if(key==x[mid]){
      return 1;
    }
    if(key>x[mid]){
      max=mid+1;
    }
    else if(key<x[mid]){
      max=mid;
    }
  }

  return 0;
}
      



Compiler output:
main.c: In function 'main':
main.c:23:8: error: implicit declaration of function 'BinarySeach'; did you mean 'BinarySearch'? [-Wimplicit-function-declaration]
   23 |     c+=BinarySeach(S,T[i],n);
      |        ^~~~~~~~~~~
      |        BinarySearch
Language: C

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

int BinarySearch(int*, int, int);

int main(){
  int i,j,n,q,c=0;
  int *S,*T;

  scanf("%d",&n);
  S=(int *)malloc(n*sizeof(int));
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }

  scanf("%d",&q);
  T=(int *)malloc(q*sizeof(int));
  for(i=0;i<q;i++){
    scanf("%d",&T[i]);
  }

  for(i=0;i<q;i++){
    c+=BinarySeach(S,T[i],n);
  }

  printf("%d\n",c);

  return 0;

}

int BinarySearch(int *x,int key,int n){
  int mid,max,min=0;

  max=n;

  while(min<max){
    mid=(min+max)/2;
    if(key==x[mid]){
      return 1;
    }
    if(key>x[mid]){
      min=mid+1;
    }
    else if(key<x[mid]){
      max=mid;
    }
  }

  return 0;
}
      



Compiler output:
main.c: In function 'main':
main.c:23:8: error: implicit declaration of function 'BinarySeach'; did you mean 'BinarySearch'? [-Wimplicit-function-declaration]
   23 |     c+=BinarySeach(S,T[i],n);
      |        ^~~~~~~~~~~
      |        BinarySearch
Language: C

#include<stdio.h>
int Binary(int);

int S[100000], n;

int main(){
  int ns, nt, i, C=0;

  scanf("%d", &ns);
  int S[ns];
  for( i = 0 ; i < n ; i++ ){
    scanf("%d", &S[i]);
  }

  scanf("%d", &nt);
  int T[nt];
  for( i = 0 ; i < nt ; i++ ){
    scanf("%d", &T[i]);
    if( binarysearch(T[i]) ){
       C++;
     }
  }
  printf("%d\n", C);
  return 0;
}

int Binary(int t){
  int l=0, r=n, mid;
  while( l < r ){
    mid = ( l + r ) / 2;
    if( t == S[mid] ) return 1;
    if( t > S[mid] ) l = mid + 1;
    else if( t < S[mid] ) r = mid;
  }
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:19:9: error: implicit declaration of function 'binarysearch' [-Wimplicit-function-declaration]
   19 |     if( binarysearch(T[i]) ){
      |         ^~~~~~~~~~~~
Language: C

import java.util.*;

class Main
{
    public static void main(String args[])
    {
	int n, q, C=0;
	long S[] = new long[100000];
	long k;
	int left, right, mid=0;
	Scanner read = new Scanner(System.in);

	//read
	n=read.nextInt();
	for(int i=0; i<n; i++)S[i]=read.nextInt();

	//search
	q=read.nextInt();
	for(int i=0; i<q; i++)
	    {
		left=0;
		right=n;
		k=read.nextInt();
		while(left<right)
		    {
			mid=(left+right)/2;
			if(S[mid]==k)
			    {
				C++;
				break;
			    }
			else if(S[mid]<k)left=mid+1;
			else right=mid;
		    }
	    }

	//print
	read.close();
	System.out.println(C);


    }
}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.*;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.*;
      |            ^
main.c:3:1: error: unknown type name 'class'
    3 | class Main
      | ^~~~~
main.c:4:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    4 | {
      | ^
Language: C

include<stdio.h>
  
int main(){
  int i, j, n, q, c=0;
  int S[100001], T[50001];
  
  scanf("%d",&n);
  for(i=1; i<=n; i++){
    scanf("%d",&S[i]);
  }
  scanf("%d",&q);
  for(i=1; i<=q; i++){
    scanf("%d",&T[i]);
  }

    for(i=1; i<=q; i++){
  for(j=1; j<=n; j++){
      if(S[j] == S[j+1]) continue;
      if(T[i] == S[j]) c++;
    }
  }
  printf("%dn",c);
  return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

include<stdio.h>
  
int main(){
  int i, j, n, q, c=0;
  int S[100001], T[50001];
  
  scanf("%d",&n);
  for(i=1; i<=n; i++){
    scanf("%d",&S[i]);
  }
  scanf("%d",&q);
  for(i=1; i<=q; i++){
    scanf("%d",&T[i]);
  }

    for(i=1; i<=q; i++){
  for(j=1; j<=n; j++){
      if(S[j] == S[j+1]) continue;
      if(T[i] == S[j]) c++;
    }
  }
  printf("%d\n",c);
  return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

include<stdio.h>
  
int main(){
  int i, j, n, q, c=0;
  int S[100001], T[50001];
  
  scanf("%d",&n);
  for(i=1; i<=n; i++){
    scanf("%d",&S[i]);
  }
  scanf("%d",&q);
  for(i=1; i<=q; i++){
    scanf("%d",&T[i]);
  }
  for(j=1; j<=n; j++){
     if(S[j] == S[j+1]) continue;
    for(i=1; i<=q; i++){
      if(T[i] == S[j]) c++;
    }
  }
  printf("%d\n",c);
  return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

include<stdio.h>
  
int main(){
  int i, j, n, q, c=0;
  int S[100001], T[50001];
  
  scanf("%d",&n);
  for(i=1; i<=n; i++){
    scanf("%d",&S[i]);
  }
  scanf("%d",&q);
  for(i=1; i<=q; i++){
    scanf("%d",&T[i]);
  }
  for(j=1; j<=n; j++){
    for(i=1; i<=q; i++){
      if(S[j] == S[j+1]) continue;
      if(T[i] == S[j]) c++;
    }
  }
  printf("%d\n",c);
  return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

#include <stdio.h>
#define N 100000
#define Q 50000
 
int search(int[],int[],int,int,int);
 
int main(void){
 
  int S[N];
  int T[Q];
  int n,q;
  int i;
  int count=0;
 
  scanf("%d",&n);
 
  for(i=0;i<n;i++)
    scanf("%d",&S[i]);
 
  scanf("%d",&q);
 
  for(i=0;i<q;i++)
    scanf("%d",&T[i]);
  
  
  MAX = T[0];

  for(i=1;i<Q;i++){
    if(MAX < T[i])
      MAX = T[i];
  }
  
  count = search(S,T,n,q,MAX);
 
  printf("%d\n",count);
 
  return 0;
}
 
int search(int S[],int T[],int n,int q,int MAX){
 
  int i,j;
  int flag;
  int count=0;
 
  for(j=0;j<q;j++){
    flag =0;
    for(i=0;i<MAX;i++){
      if(T[j] == S[i])
	flag++;   
    }
    if(flag >=1)
      count++;
  }
  return count;
}

Compiler output:
main.c: In function 'main':
main.c:26:3: error: 'MAX' undeclared (first use in this function)
   26 |   MAX = T[0];
      |   ^~~
main.c:26:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
start = time.clock()
i = 0
n=input()
S=map(int, raw_input().split())
q=input()
T=map(int, raw_input().split())
#s=sorted(set(S), key=S.index)
print len(set(S)&set(T))

Compiler output:
main.c:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/env python
      |  ^
main.c:2:3: error: invalid preprocessing directive #-
    2 | # -*- coding:utf-8 -*-
      |   ^
main.c:3:2: error: invalid preprocessing directive #from
    3 | #from __future__ import print_function
      |  ^~~~
main.c:4:1: error: unknown type name 'import'
    4 | import time
      | ^~~~~~
main.c:5:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import'
    5 | import sys
      | ^~~~~~
main.c:5:1: error: unknown type name 'import'
main.c:15:2: error: invalid preprocessing directive #s
   15 | #s=sorted(set(S), key=S.index)
      |  ^
Language: C

#include <stdio.h>

#define N 100000
#define Q 50000

int main(){
  int S[N],T[Q],ans[Q];
  int n,m,i,j,k=0,count=0,flag=0;
  scanf("%d",&n);
  for(i=0; i<n ; i++){
    scanf("%d",&S[i]);
  }

  scanf("%d",&m);
  for(i=0; i<m ; i++){
    scanf("%d",&T[i]);
    flag=0;
    for(j=0; j<n ; j++){
      if(flag!=0 && flag!=1)
	continue;
      if(S[j]==T[i]){
	ans[k]==T[i];
	k++;
	count++;
	break;
  }
  for(i=0; i<k ; i++){
    printf("%d",ans[i]);
  }
  if(count==0) printf("0\n");
  else printf("%d\n",count);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:33:1: error: expected declaration or statement at end of input
   33 | }
      | ^
main.c:33:1: error: expected declaration or statement at end of input
Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
 
int main(void){
    int i, n, q, count = 0;
    int mid, right, left;
    int s[100001], t[5001];
 
    scanf("%d", &n);
    for(i = 0; i < n; i++) {
        scanf("%d", &s[i]);
    }
 
    scanf("%d", &q);
    for(i = 0; i < n; i++) {
        scanf("%d", &t[i]);
    }

 
    for(i = 0; i<q; i++){

       right = n;
       left = 0;
 
    while(left <= right){

         mid = (right + left) / 2;
         if(s[mid] == t[i]) {
              count++;
              break;
       }
        else if(s[mid] < t[i]){
             left = mid + 1;
       }
       else if(s[mid] > t[i]){
             right = mid - 1;
        }
 
     }
  }
    printf("%d\n", count);
 
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:16: error: stray '\24' in program
    8 |     int s[10000<U+0014>1], t[5001];
      |                ^~~~~~~~
main.c:8:16: error: expected ']' before numeric constant
    8 |     int s[100001], t[5001];
      |                ^~
      |                ]
main.c:12:22: error: 's' undeclared (first use in this function)
   12 |         scanf("%d", &s[i]);
      |                      ^
main.c:12:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:22: error: 't' undeclared (first use in this function)
   17 |         scanf("%d", &t[i]);
      |                      ^