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

#include <stdio.h>

static int S[10000010];

int main(void)
{
	int n, q, c = 0;
	int i;
	
	scanf("%d", &n);
	
	for (i = 0; i < n; i++){
		scanf("%d", &q);
		s[q] = 1;
	}
	scanf("%d", &n);
	for (i = 0; i < n; i++){
		scanf("%d", &q);
		if (s[q] == 1){
			c++;
		}
	}
	
	printf("%d\n", c);
	
	return (0);
}

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

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

int main(void)
{
        int n = 0,q = 0;
        int *s;
        int *t;
        int i = 0,j = 0;
        int count = 0;


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


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



        for(i = 0; i < n; i++)
        {
                for(j = 0;j < q; j++)
                {
                        if(s[j] == t[i])
                        {
                                count++;
                                break;
                        }
                }
        }
        printf("%d\n",count);


        return 0;
}
~

Compiler output:
main.c:46:1: error: expected identifier or '(' before '~' token
   46 | ~
      | ^
Language: C

//
//  main.c
//  31
//
//  Created by x14005xx on 2016/05/31.
//  Copyright (c) 2016??´ Isikawa yuuki. All rights reserved.
//

#include <stdio.h>
#define MAX 100000
#define TMAX 50000
int main(int argc, const char * argv[])
{
    int n,q,S[MAX]={0},T[TMAX]={0};
    int i,j,C=0;
    
    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<n;i++){
        for(j=0;j<q;j++){
            if(S[j]==T[i]){
                C++;
                break;//??????????¢???£????????´????????????????????????????????????????
            }
        }
    }
    printf("%d\n",C)
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:35:21: error: expected ';' before 'return'
   35 |     printf("%d\n",C)
      |                     ^
      |                     ;
   36 |     return 0;
      |     ~~~~~~
Language: C

//
//  main.c
//  31
//
//  Created by x14005xx on 2016/05/31.
//  Copyright (c) 2016??´ Isikawa yuuki. All rights reserved.
//

#include <stdio.h>
#define MAX 100000
#define TMAX 50000
int main(int argc, const char * argv[])
{
    int n,q,S[MAX],T[TMAX];
    int i,j,C=0;
    
    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<n;i++){
        for(j=0;j<q;j++){
            if(S[j]==T[i]){
                C++;
                break;//??????????¢???£????????´????????????????????????????????????????
            }
        }
    }
    printf("%d\n",C)
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:35:21: error: expected ';' before 'return'
   35 |     printf("%d\n",C)
      |                     ^
      |                     ;
   36 |     return 0;
      |     ~~~~~~
Language: C

//
//  main.c
//  31
//
//  Created by x14005xx on 2016/05/31.
//  Copyright (c) 2016??´ Isikawa yuuki. All rights reserved.
//

#include <stdio.h>
#define MAX 100001
#define TMAX 50001
int main(int argc, const char * argv[])
{
    int n,q,S[MAX],T[TMAX];
    int i,j,C=0;
    
    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<n;i++){
        for(j=0;j<q;j++){
            if(S[j]==T[i]){
                C++;
                break;//??????????¢???£????????´????????????????????????????????????????
            }
        }
    }
    printf("%d\n",C)
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:35:21: error: expected ';' before 'return'
   35 |     printf("%d\n",C)
      |                     ^
      |                     ;
   36 |     return 0;
      |     ~~~~~~
Language: C

#include <stdio.h>
int over[10000000]
int main(void)
{
	int n, b, i, re = 0;
	scanf("%d", &n);
	
	for (i = 0; i < n; i++){
		scanf("%d", &b);
		over[b]++;
	}
	scanf("%d", &n);
	for (i = 0; i < n; i++){
		scanf("%d", &b);
		if (over[b] > 0){
			re++;
		}
	}
	printf("%d\n", re);
	return(0);
}

Compiler output:
main.c:2:19: error: expected ';' before 'int'
    2 | int over[10000000]
      |                   ^
      |                   ;
    3 | int main(void)
      | ~~~                
main.c: In function 'main':
main.c:10:17: error: 'over' undeclared (first use in this function)
   10 |                 over[b]++;
      |                 ^~~~
main.c:10:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<algorithm>
int main(){
	int i,n,q,cnt=0,S[100000]={},T[50000]={};
	//int high,mid,low=0;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&S[i]);
	}
	scanf("%d",&q);
	//high=q-1;
	for(i=0;i<q;i++){
		scanf("%d",&T[i]);
	}
	std::sort(S,S+n);
	//std::sort(T,T+q);
	for(i=0;i<q;i++){
		int low=0,high=n-1,mid;
		while(1){
			mid=(low+high)/2;
			if(T[i]==S[mid]){
				cnt++;
				break;
			}else if(T[i] > S[mid])	low=mid+1;
			else	high=mid-1;
			if(high<low)	break;
		}
	}
	printf("%d\n",cnt);
	
}

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

#include <stdio.h>
int main(void){
    int cnt=0,i,n,q,s,t;
    double hairetu[100001]={}
    scanf("%d",&n);
    for(i = 0;i < n;i++){
        scanf("%d",&s);
        hairetu[s]+=1;
    }
    scanf("%d",&q);
    for(i = 0;i < q;i++){
        scanf("%d",&t);
        hairetu[t]+=1;
    }
    for(i = 0;i < 501;i++){
        if(hairetu[i]>=2) cnt++;
    }
    printf("%d\n",cnt);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:5: error: expected ',' or ';' before 'scanf'
    5 |     scanf("%d",&n);
      |     ^~~~~
Language: C

#include <stdio.h>

int main() {
	const int MAX_V = 10000000;
	int i, v;
	int n, q, cnt = 0;
	static int cnt_s[MAX_V + 1] = {0}, cnt_t[MAX_V + 1] = {0};
	scanf("%d", &n);
	for(i = 0; i < n; i++) {
		scanf("%d", &v);
		cnt_s[v] = 1;
	}
	scanf("%d", &q);
	for(i = 0; i < q; i++) {
		scanf("%d", &v);
		cnt_t[v] = 1;
	}
	for(i = 0; i <= MAX_V; i++) {
		if(cnt_s[i] && cnt_t[i]) {
			cnt++;
		}
	}
	printf("%d\n", cnt);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:39: error: variable-sized object may not be initialized except with an empty initializer
    7 |         static int cnt_s[MAX_V + 1] = {0}, cnt_t[MAX_V + 1] = {0};
      |                                       ^
main.c:7:20: error: storage size of 'cnt_s' isn't constant
    7 |         static int cnt_s[MAX_V + 1] = {0}, cnt_t[MAX_V + 1] = {0};
      |                    ^~~~~
main.c:7:63: error: variable-sized object may not be initialized except with an empty initializer
    7 |         static int cnt_s[MAX_V + 1] = {0}, cnt_t[MAX_V + 1] = {0};
      |                                                               ^
main.c:7:44: error: storage size of 'cnt_t' isn't constant
    7 |         static int cnt_s[MAX_V + 1] = {0}, cnt_t[MAX_V + 1] = {0};
      |                                            ^~~~~
Language: C

#include <stdio.h>
const int MAX = 10000000;

int main() {
    long int i, k, n, q, C = 0;
    long int S[100000];
    long int T[MAX] = {0};
    scanf("%ld", &n);
    for(i = 0; i < n; i++) {
        scanf("%ld", &S[i]);
        T[S[i]] = 1;
    }
    scanf("%ld", &q);
    for(i = 0; i < q; i++) {
        scanf("%ld", &k);
        if(T[k]) C++;
    }
    printf("%ld\n", C);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:23: error: variable-sized object may not be initialized except with an empty initializer
    7 |     long int T[MAX] = {0};
      |                       ^
Language: C

#include <stdio.h>
const int MAX = 10000000;

int main() {
    long int i, k, n, q, C = 0;
    long int S[100000];
    int T[MAX] = {0};
    scanf("%ld", &n);
    for(i = 0; i < n; i++) {
        scanf("%ld", &S[i]);
        T[S[i]] = 1;
    }
    scanf("%ld", &q);
    for(i = 0; i < q; i++) {
        scanf("%ld", &k);
        if(T[k]) C++;
    }
    printf("%ld\n", C);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:18: error: variable-sized object may not be initialized except with an empty initializer
    7 |     int T[MAX] = {0};
      |                  ^
Language: C

#include <stdio.h>
const int N = 100000;
int data[N] = {0};
int main(){
  int n ,S ,q ,T ,i ,k ,c=0;
  scanf("%d" ,&n);
  for(i=0 ;i<n ;i++){
    scanf("%d" ,&S);
    if(!data[S])data[S]=1;
  }
  scanf("%d" ,&q);
  for(k=0 ;k<q ;k++){
    scanf("%d" ,&T);
    if(data[T])c++;
  }
  printf("%d\n" ,c);
  return 0;
}

Compiler output:
main.c:3:5: error: variably modified 'data' at file scope
    3 | int data[N] = {0};
      |     ^~~~
Language: C

#include <stdio.h>
const int MAX = 10000000;
long int S[100000];
long int C = 0;

void bound(long int n, long int m) {
    long int low = 0, high = n, mid, target = m;
    while(1) {
        mid = (high + low) / 2;
        if(S[mid] == target) {
            C++;
            break;
        } else if(S[mid] < target) {
            low = mid + 1;
        } else {
            high = mid - 1;
        }
        if(high < low) {
            break;
        }
    }
}

int main() {
    long int i, n, q, s = 0, t;
    int T[MAX + 1] = {0};
    scanf("%ld", &n);
    for(i = 0; i < n; i++) {
        scanf("%ld", &S[i]);
        T[S[i]] = 1;
    }
    for(i = 0; i <= MAX; i++) {
        if(T[i] == 1) {
            S[s] = i;
            s++;
        }
    }
    scanf("%ld", &q);
    for(i = 0; i < q; i++) {
        scanf("%ld", &t);
        bound(n, t);
    }
    printf("%ld\n", C);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:26:22: error: variable-sized object may not be initialized except with an empty initializer
   26 |     int T[MAX + 1] = {0};
      |                      ^
Language: C

#include <stdio.h>

const int MAX_V = 10000000;
static int cnt_s[MAX_V + 1] = {0}, cnt_t[MAX_V + 1] = {0};

int main() {
	int i, v;
	int n, q, cnt = 0;
	scanf("%d", &n);
	for(i = 0; i < n; i++) {
		scanf("%d", &v);
		cnt_s[v] = 1;
	}
	scanf("%d", &q);
	for(i = 0; i < q; i++) {
		scanf("%d", &v);
		cnt_t[v] = 1;
	}
	for(i = 0; i <= MAX_V; i++) {
		if(cnt_s[i] && cnt_t[i]) {
			cnt++;
		}
	}
	printf("%d\n", cnt);
	return 0;
}

Compiler output:
main.c:4:12: error: variably modified 'cnt_s' at file scope
    4 | static int cnt_s[MAX_V + 1] = {0}, cnt_t[MAX_V + 1] = {0};
      |            ^~~~~
main.c:4:36: error: variably modified 'cnt_t' at file scope
    4 | static int cnt_s[MAX_V + 1] = {0}, cnt_t[MAX_V + 1] = {0};
      |                                    ^~~~~
Language: C

#include<iostream>
using namespace std;

int n[100000], q[100000];

bool notbefore(int i){
	bool res = true;
	for(int k=0; k<i; k++){
		if(n[i]==n[k]) res=false;
	}
	return res;
}

int main(void) {
	for(int i=0; i<100000; i++){
		n[i]=0; q[i]=0;
	}
	int nn, qn;
	cin >> nn;
	for(int i=0; i<nn; i++){
		cin >> n[i];
	}
	cin >> qn;
	for(int i=0; i<qn; i++){
		cin >> q[i];
	}

	int res = 0;
	for(int i=0; i<nn; i++)
		for(int j=0; j<qn; j++)
			if( notbefore(i) && n[i]==q[j]) res++;

	cout << res << endl;
	return 0;
}

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

#include <stdio.h>
int main(void){
    int C=0,Smax=0,Tmax=0,max,i,n,q,x,S[100000],T[50000],L[50001];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&x);
        if(Smax<x)Smax=x;
        S[i]=x;
    }
    scanf("%d",&q);
    for(i=0;i<q;i++){
        scanf("%d",&x);
        if(Tmax<x)Tmax=x;
        T[i]=x;
    }
    if(Smax<Tmax)max=Smax; else max=Tmax;
    for(i=0;i<max+1;i++)L[i]=0;
    for(i=0;i<n;i++){if(S[i]<=max)L[S[i]]++;}
    for(i=0;i<q;i++){if(T[i]<=max && L[T[i]]>0)C++;
    printf("%d\n",C);
    return 0;
}

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

#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <time.h>

using namespace std;

int comp(const void *a, const void*b)
{
	return *(int*)a - *(int*)b;
}


int main(void)
{
	unsigned long  nA, nB, i, cnt=0;
	unsigned long setA[100001]={0}, setB[50001]={0}, setR[50001]={0};

	scanf("%lu", &nA);
	getchar();
	for(i=0; i<nA; i++){
		scanf("%lu", &setA[i]);
		getchar();
	}
	qsort(setA, nA, sizeof(unsigned long), comp);

	scanf("%lu", &nB);
	getchar();
	for(i=0; i<nB; i++){
		scanf("%lu", &setB[i]);
		getchar();
	}
	qsort(setB, nB, sizeof(unsigned long), comp);


	set_intersection(setA, setA+nA, setB, setB+nB, setR);
	for(i=0; i<=50000; i++){
		if(setR[i] != 0){ cnt++; };
	}

	printf("%lu\n", cnt);
	return 0;
}

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

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

void QSort(int x[ ], int left, int right);
void Swap(int x[ ], int i, int j);

int main(){
	int j,i,num,num2,k,c,temp = 0;
	int n[100000] = {0},q[50000] = {0},check[50000] = {0};
	c = 0;
	scanf("%d",&num);
	for(i = 0; i < num; i++){
		scanf("%d",&n[i]);
	}
	scanf("%d",&num2);
	for(i = 0; i < num2; i++){
		scanf("%d",&q[i]);
	}
	
	QSort(n, 0, num - 1);
	QSort(q, 0, num2 - 1);
	
	for(i = 0; i < num; i++){
		for(j = 0; j < num2;j++){
			if(n[i] == q[j] && i == 0){
				temp = n[i];
				c++;
				break;
			}
			}if(temp == n[i]){
				break;
			}if(n[i] == q[j]){
				temp = n[i];
				c++;
				break;
			}
		}
	}
	printf("%d\n",c);
	return 0;
}



void QSort(int x[ ], int left, int right)
{
    int i, j;
    int pivot;

    i = left;                      /* ソートする配列の一番小さい要素の添字 */
    j = right;                     /* ソートする配列の一番大きい要素の添字 */

    pivot = x[(left + right) / 2]; /* 基準値を配列の中央付近にとる */

    while (1) {                    /* 無限ループ */

        while (x[i] < pivot)       /* pivot より大きい値が */
            i++;                   /* 出るまで i を増加させる */

        while (pivot < x[j])       /* pivot より小さい値が */
            j--;                   /*  出るまで j を減少させる */
        if (i >= j)                /* i >= j なら */
            break;                 /* 無限ループから抜ける */

        Swap(x, i, j);             /* x[i] と x[j]を交換 */
        i++;                       /* 次のデータ */
        j--;
    }

    if (left < i - 1)              /* 基準値の左に 2 以上要素があれば */
        QSort(x, left, i - 1);     /* 左の配列を Q ソートする */
    if (j + 1 <  right)            /* 基準値の右に 2 以上要素があれば */
        QSort(x, j + 1, right);    /* 右の配列を Q ソートする */
}

void Swap(int x[ ], int i, int j)
{
    int temp;

    temp = x[i];
    x[i] = x[j];
    x[j] = temp;
}

Compiler output:
main.c:42:16: error: expected declaration specifiers or '...' before string constant
   42 |         printf("%d\n",c);
      |                ^~~~~~
main.c:42:23: error: unknown type name 'c'
   42 |         printf("%d\n",c);
      |                       ^
main.c:43:9: error: expected identifier or '(' before 'return'
   43 |         return 0;
      |         ^~~~~~
main.c:44:1: error: expected identifier or '(' before '}' token
   44 | }
      | ^
Language: C

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

void QSort(int x[ ], int left, int right);
void Swap(int x[ ], int i, int j);

int main(){
	int j,i,num,num2,k,c,temp = 0;
	int n[100000] = {0},q[50000] = {0},check[50000] = {0};
	c = 0;
	scanf("%d",&num);
	for(i = 0; i < num; i++){
		scanf("%d",&n[i]);
	}
	scanf("%d",&num2);
	for(i = 0; i < num2; i++){
		scanf("%d",&q[i]);
	}
	
	QSort(n, 0, num - 1);
	QSort(q, 0, num2 - 1);
	
	for(i = 0; i < num; i++){
		if(n[i] != n[i + 1]){
		for(j = c; j < num2;j++){
			if(n[i] == q[j] && i == 0){
				temp = n[i];
				c++;
				break;
			}
			if(temp == n[i]){
				break;
			}
			if(n[i] == q[j]){
				temp = n[i];
				c++;
				break;
			}
		}else{/* にもしない*/
		}
		}
	}
	printf("%d\n",c);
	return 0;
}



void QSort(int x[ ], int left, int right)
{
    int i, j;
    int pivot;

    i = left;                      /* ソートする配列の一番小さい要素の添字 */
    j = right;                     /* ソートする配列の一番大きい要素の添字 */

    pivot = x[(left + right) / 2]; /* 基準値を配列の中央付近にとる */

    while (1) {                    /* 無限ループ */

        while (x[i] < pivot)       /* pivot より大きい値が */
            i++;                   /* 出るまで i を増加させる */

        while (pivot < x[j])       /* pivot より小さい値が */
            j--;                   /*  出るまで j を減少させる */
        if (i >= j)                /* i >= j なら */
            break;                 /* 無限ループから抜ける */

        Swap(x, i, j);             /* x[i] と x[j]を交換 */
        i++;                       /* 次のデータ */
        j--;
    }

    if (left < i - 1)              /* 基準値の左に 2 以上要素があれば */
        QSort(x, left, i - 1);     /* 左の配列を Q ソートする */
    if (j + 1 <  right)            /* 基準値の右に 2 以上要素があれば */
        QSort(x, j + 1, right);    /* 右の配列を Q ソートする */
}

void Swap(int x[ ], int i, int j)
{
    int temp;

    temp = x[i];
    x[i] = x[j];
    x[j] = temp;
}

Compiler output:
main.c: In function 'main':
main.c:42:18: error: expected '}' before 'else'
   42 |                 }else{/* にもしない*/
      |                  ^~~~
main.c: At top level:
main.c:46:16: error: expected declaration specifiers or '...' before string constant
   46 |         printf("%d\n",c);
      |                ^~~~~~
main.c:46:23: error: unknown type name 'c'
   46 |         printf("%d\n",c);
      |                       ^
main.c:47:9: error: expected identifier or '(' before 'return'
   47 |         return 0;
      |         ^~~~~~
main.c:48:1: error: expected identifier or '(' before '}' token
   48 | }
      | ^
Language: C

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

void QSort(int x[ ], int left, int right);
void Swap(int x[ ], int i, int j);

int main(){
	int j,i,num,num2,k,c,temp = 0;
	int n[100000] = {0},q[50000] = {0},check[50000] = {0};
	c = 0;
	scanf("%d",&num);
	for(i = 0; i < num; i++){
		scanf("%d",&n[i]);
	}
	scanf("%d",&num2);
	for(i = 0; i < num2; i++){
		scanf("%d",&q[i]);
	}
	
	//QSort(n, 0, num - 1);
	QSort(q, 0, num2 - 1);
	
	for(i = 0; i < num; i++){
		for(j = c; j < num2;j++){
			if(n[i] == q[j] && i == 0){
				temp = n[i];
				c++;
				break;
			}
			if(temp == n[i]){
				continue;
			}
			if(n[i] == q[j]){
				temp = n[i];
				c++;
				break;
			}
		}
	}
	printf("%d\n",c);
	return 0;
}



void QSort(int x[ ], int left, int right)
{
    int i, j;
    int pivot;

    i = left;                      /* ソートする配列の一番小さい要素の添字 */
    j = right;                     /* ソートする配列の一番大きい要素の添字 */

    pivot = x[(left + right) / 2]; /* 基準値を配列の中央付近にとる */

    while (1) {                    /* 無限ループ */

        while (x[i] < pivot)       /* pivot より大きい値が */
            i++;                   /* 出るまで i を増加させる */

        while (pivot < x[j])       /* pivot より小さい値が */
            j--;                   /*  出るまで j を減少させる */
        if (i >= j)                /* i >= j なら */
            break;                 /* 無限ループから抜ける */

        Swap(x, i, j);             /* x[i] と x[j]を交換 */
        i++;                       /* 次のデータ */
        j--;
    }

    if (left < i - 1)              /* 基準値の左に 2 以上要素があれば */
        QSort(x, left, i - 1);     /* 左の配列を Q ソートする */
    if (j + 1 <  right)            /* 基準値の右に 2 以上要素があれば */
        QSort(x, j + 1, right);    /* 右の配列を Q ソートする */
}

Compiler output:
/usr/bin/ld: /tmp/ccVYhJOy.o: in function `QSort':
main.c:(.text+0x2a1): undefined reference to `Swap'
collect2: error: ld returned 1 exit status
Language: C

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

void QSort(int x[ ], int left, int right);
void Swap(int x[ ], int i, int j);

int main(){
	int j,i,num,num2,k,c,temp = 0;
	int n[100000] = {0},q[50000] = {0},check[50000] = {0};
	c = 0;
	scanf("%d",&num);
	for(i = 0; i < num; i++){
		scanf("%d",&n[i]);
	}
	scanf("%d",&num2);
	for(i = 0; i < num2; i++){
		scanf("%d",&q[i]);
	}
	
	QSort(n, 0, num - 1);
	//QSort(q, 0, num2 - 1);
	
	for(i = 0; i < num; i++){
		for(j = c; j < num2;j++){
			if(n[i] == q[j] && i == 0){
				temp = n[i];
				c++;
				break;
			}
			if(temp == n[i]){
				continue;
			}
			if(n[i] == q[j]){
				temp = n[i];
				c++;
				break;
			}
		}
	}
	printf("%d\n",c);
	return 0;
}



void QSort(int x[ ], int left, int right)
{
    int i, j;
    int pivot;

    i = left;                      /* ソートする配列の一番小さい要素の添字 */
    j = right;                     /* ソートする配列の一番大きい要素の添字 */

    pivot = x[(left + right) / 2]; /* 基準値を配列の中央付近にとる */

    while (1) {                    /* 無限ループ */

        while (x[i] < pivot)       /* pivot より大きい値が */
            i++;                   /* 出るまで i を増加させる */

        while (pivot < x[j])       /* pivot より小さい値が */
            j--;                   /*  出るまで j を減少させる */
        if (i >= j)                /* i >= j なら */
            break;                 /* 無限ループから抜ける */

        Swap(x, i, j);             /* x[i] と x[j]を交換 */
        i++;                       /* 次のデータ */
        j--;
    }

    if (left < i - 1)              /* 基準値の左に 2 以上要素があれば */
        QSort(x, left, i - 1);     /* 左の配列を Q ソートする */
    if (j + 1 <  right)            /* 基準値の右に 2 以上要素があれば */
        QSort(x, j + 1, right);    /* 右の配列を Q ソートする */
}

Compiler output:
/usr/bin/ld: /tmp/ccdKUNbP.o: in function `QSort':
main.c:(.text+0x2a1): undefined reference to `Swap'
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>
int main(void)
{
	int a[100000],count=0,n,q;
	register int i,k,x;

	scanf("%d",&n);

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

	scanf("%d",&q);

	for(i=0;i<q;i++){
		scanf("%d",&x);

		for(k=0;k<n;k++){
			if(x==a[k]){
				count++;
				break;
			}
		}
	}

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

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:17: error: address of register variable 'x' requested
   16 |                 scanf("%d",&x);
      |                 ^~~~~
Language: C

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

int sort_cmp(const void *a,const void *b);
int max_search(int n);

int main(void)
{
	int i,k,s,a[100000],count=0,n,q,x,min,max;//クイックソートからの二分探索でシュウゥゥゥゥー!


	scanf("%d",&n);

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

	qsort(a,i,sizeof(a[0]),sort_cmp);

	scanf("%d",&q);

	for(i=0;i<q;i++){
		scanf("%d",&x);
		min=0;
		max=n-1;
		for(k=0;k<max_search(n);k++){
			if(x>a[(min+max)/2])
				min=(min+max)/2;
			else if(x<a[(min+max)/2])
				max=(min+max)/2;
			else if(x==a[(min+max)/2]){
				count++;
				break;
			}
		}
	}
		


		
	

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

	return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccNyPNc0.o: in function `main':
main.c:(.text+0x83): undefined reference to `sort_cmp'
/usr/bin/ld: main.c:(.text+0x1a9): undefined reference to `max_search'
collect2: error: ld returned 1 exit status
Language: C

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

int sort_cmp(const void *a,const void *b)
{
	if(*(int *)a<*(int *)b)
		return -1;
	else if(*(int *)a==*(int *)b)
		return 0;

	return 1;
}

int max_search(int n)
{
	int x=1,i;
	
	for(i=0;x<n;i++)
		x*=2;

	return i;
}

int main(void)
{
	int i,k,s,a[100000],count=0,n,q,x,min,max,N;//クイックソートからの二分探索でシュウゥゥゥゥー!


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

	qsort(a,i,sizeof(a[0]),sort_cmp);

	scanf("%d",&q);

	for(i=0;i<q;i++){
		scanf("%d",&x);
		min=0;
		max=n-1;
		for(k=0;k<N;k++){
			if(x>a[(min+max)/2])
				min=(min+max)/2;
			else if(x<a[(min+max)/2])
				max=(min+max)/2;
			else if(x==a[(min+max)/2]){
				count++;
				break;
			}
		}
	}
		

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

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define PI 3.14159265358979323

//void quick(int *,long long,long long);

int main(){

	int m,n,wa,i,j;
	int a[100000],b[50000];
	bool *c;
	c = (bool *)malloc(sizeof(bool)*10000001);
	for(i=0;i<=10000001;i++)
		c[i]=0;

	scanf("%d%*c",&m);
	for(i=0;i<m;i++){
		scanf("%d",a+i);
		c[a[i]]=1;
	}
	scanf("%d%*c",&n);
	wa=0;
	for(i=0;i<n;i++){
		scanf("%d",b+i);
		if(c[b[i]]==1)
			wa++;
	}
	printf("%d\n",wa);
	//for(i=0;i<=10000000000;i++);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:9: error: unknown type name 'bool'
   12 |         bool *c;
      |         ^~~~
main.c:4:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    3 | #include <math.h>
  +++ |+#include <stdbool.h>
    4 | #define PI 3.14159265358979323
main.c:13:14: error: 'bool' undeclared (first use in this function)
   13 |         c = (bool *)malloc(sizeof(bool)*10000001);
      |              ^~~~
main.c:13:14: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:13:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:20: error: expected expression before ')' token
   13 |         c = (bool *)malloc(sizeof(bool)*10000001);
      |                    ^
Language: C

#include <stdio.h>

void quick(int *a,int left,int right){
	int pl = left;
	int pr = right;
	int axis = a[pl];

	do{
		while(a[pl] < axis) pl++;
		while(a[pr] > axis) pr--;

		if(pl <= pr){
			swap(&a[pl],&a[pr]);
			pl++;
			pr--;
		}
		if(pr > left) quick(a,left,pr);
		if(pl < right) quick(a,pl,right);
	}while(pl <= pr);

}

int main(void){
	int i,j,n,q,c=0;
	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]);

	quick(S,0,n-1);

	for(i = 0;i < q;i++){
		for(j = 0;j < n;j++){
			if(T[i] > S[j])
				break;
			if(T[i] == S[j]){
				c++;
				break;
			}
		}
	}

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

Compiler output:
main.c: In function 'quick':
main.c:13:25: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
   13 |                         swap(&a[pl],&a[pr]);
      |                         ^~~~
Language: C

int intcmp( const void * a , const void * b ) {
  /* 引数はvoid*型と規定されているのでint型にcastする */
  if(*(int *)a < *(int *)b){
    return -1;
  }else if(*(int *)a == *(int *)b){
    return 0;
  }
  return 1;
}

int main(){
    int n, q;
    int s[MAX], t[MAX];
    int i, j=0, 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]);
    }
    qsort((void *)s, n, sizeof(s[0]), intcmp);
    qsort((void *)t, q, sizeof(t[0]), intcmp);
    // sの入力は重複ありだが、カウントの重複は認められない。
    for(i=0;i<q;i++){
        for(;j<n;j++){
            if(t[i]==s[j]){
                count++;
                j++;
                break;
            }else if(t[i]<s[j]){
                break;
            }
        }
    }
    printf("%d\n", count);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:11: error: 'MAX' undeclared (first use in this function)
   13 |     int s[MAX], t[MAX];
      |           ^~~
main.c:13:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   17 |     scanf("%d", &n);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int intcmp( const void * a , const void * b ) {
main.c:17:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   17 |     scanf("%d", &n);
      |     ^~~~~
main.c:17:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:25:5: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
   25 |     qsort((void *)s, n, sizeof(s[0]), intcmp);
      |     ^~~~~
main.c:39:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   39 |     printf("%d\n", count);
      |     ^~~~~~
main.c:39:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:39:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:39:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

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

void q_sort(int nums[], int f_num, int e_num){
    
    int i, j, pbt, tmp;
    
    i = f_num;
    j = e_num;
    
    pbt = nums[(f_num+e_num) / 2];
    
    while (1) {
        
        while (nums[i] < pbt) {
            i++;
        }
        while (nums[j] > pbt) {
            j--;
        }
        if (i >= j) {
            break;
        }
        
        tmp = nums[i];
        nums[i] = nums[j];
        nums[j] = tmp;
        i++;
        j--;
    }
    
    if (f_num < i - 1) {
        q_sort(nums, f_num, i-1);
    }
    if (e_num > j + 1) {
        q_sort(nums, j+1, e_num);
    }
    
    
}

int search(int* num, int f_num, int e_num, int n){
    
    int i;
	
	if(f_num > e_num){
		return 0;
	}
	
	i = (f_num+e_num)/2 ;
	
	
	if (num[i] == n) {
		return 1;
    }
	
    if(num[i] > n){
        return  search(num, f_num, i-1, n);
    }
    else if(num[i] < n) {
        return search(num, i+1, e_num, n);
    }
    
    
}
    
    
    if(num[i] > n){
        return  search(num, f_num, i-1, n);
    }
    else if(num[i] < n) {
        return search(num, i+1, e_num, n);
    }
    
    
    
   return 0; 
}



int main(void){
	
    int i,j, c;
    
    int n, s[100001];
    int q, t;
    
    c = 0;
    
    scanf("%d", &n);
    for (i = 0; i < n; i++) {
        scanf("%d", &s[i]);
    }
    q_sort(s, 0, n-1);
    
    scanf("%d", &q);
    
    for (i = 0; i < q; i++) {
        scanf("%d", &t);
		c += search(s, 0, n-1, t);
	}
    
    
    printf("%d\n", c);
    
	
	return 0;
    
}

Compiler output:
main.c:69:5: error: expected identifier or '(' before 'if'
   69 |     if(num[i] > n){
      |     ^~
main.c:72:5: error: expected identifier or '(' before 'else'
   72 |     else if(num[i] < n) {
      |     ^~~~
main.c:78:4: error: expected identifier or '(' before 'return'
   78 |    return 0;
      |    ^~~~~~
main.c:79:1: error: expected identifier or '(' before '}' token
   79 | }
      | ^
Language: C++

#include <iostream>
#include <stdlib.h>
#define swap(type, x, y) do{type t = x; x = y; y = t; } while(0)
void quicksort(int a[], int left, int right);
using namespace std;

int main(){
    int S[100000] = {};
    int T[50000]={};
    int n,q;
    int C = 0;

    cin >> n;
    for(int i=0; i<n; i++){
        cin >> S[i];
    }
    
    cin >> q;
    for(int i=0; i<q; i++){
          cin >> T[i];
    }
    
    quicksort(S, 0, n-1);
    quicksort(T, 0, q-1);
    
    
    for(int i=0; i<q; i++){
        if(binary_search(S, S+n, T[i])){
                C++;
        }
    }

    cout << C << "\n";
    
    return 0;
}

void quicksort(int a[], int left, int right){
    int pl = left;
    int pr = right;
    int center = a[(pl + pr) / 2];
    
    while(1){
        while(a[pl] < center){
            pl++;
        }
        while(a[pr] > center){
            pr--;
        }
        
        if(pl <= pr){
            swap(int, a[pl], a[pr]);
            pl++;
            pr--;
        }
        
        if(pl > pr){
            break;
        }
    }
    
    if(left < pr){
        quicksort(a, left, pr);
    }
    
    if(pl < right){
        quicksort(a, pl, right);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:12: error: 'binary_search' was not declared in this scope
   28 |         if(binary_search(S, S+n, T[i])){
      |            ^~~~~~~~~~~~~
Language: C++

#include <iostream>
#define swap(type, x, y) do{type t = x; x = y; y = t; } while(0)
void quicksort(int a[], int left, int right);
using namespace std;

int main(){
    int S[100000] = {};
    int T[50000]={};
    int n,q;
    int C = 0;

    cin >> n;
    for(int i=0; i<n; i++){
        cin >> S[i];
    }
    
    cin >> q;
    for(int i=0; i<q; i++){
          cin >> T[i];
    }
    
    quicksort(S, 0, n-1);
    quicksort(T, 0, q-1);
    
    
    for(int i=0; i<q; i++){
        if(binary_search(S, S+n, T[i])){
                C++;
        }
    }

    cout << C << "\n";
    
    return 0;
}

void quicksort(int a[], int left, int right){
    int pl = left;
    int pr = right;
    int center = a[(pl + pr) / 2];
    
    while(1){
        while(a[pl] < center){
            pl++;
        }
        while(a[pr] > center){
            pr--;
        }
        
        if(pl <= pr){
            swap(int, a[pl], a[pr]);
            pl++;
            pr--;
        }
        
        if(pl > pr){
            break;
        }
    }
    
    if(left < pr){
        quicksort(a, left, pr);
    }
    
    if(pl < right){
        quicksort(a, pl, right);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:12: error: 'binary_search' was not declared in this scope
   27 |         if(binary_search(S, S+n, T[i])){
      |            ^~~~~~~~~~~~~
Language: C++

#include <cassert>// c
#include <ctime>
#include <iostream>// io
#include <iomanip>
#include <fstream>
#include <sstream>
#include <vector>// container
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <stack>
#include <algorithm>// other
#include <utility>
#include <complex>
#include <numeric>
#include <functional>
#include <random>
#include <regex>

using namespace std;
typedef long long ll;

#define ALL(c) (c).begin(),(c).end()
#define FOR(i,l,r) for(int i=(int)l;i<(int)r;++i)
#define REP(i,n) FOR(i,0,n)
#define FORr(i,l,r) for(int i=(int)r-1;i>=(int)l;--i)
#define REPr(i,n) FORr(i,0,n)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define IN(l,v,r) ((l)<=(v) && (v)<(r))
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end())
//debug
#define DUMP(x)  cerr << #x << " = " << (x)
#define LINE()    cerr<< " (L" << __LINE__ << ")"

template<typename T,typename U> T pmod(T x,U M){return (x%M+M)%M;}

stringstream ss;

int main(){
	cin.tie(0); ios::sync_with_stdio(false);
	ss   <<fixed <<setprecision(20);
	cout <<fixed <<setprecision(20);
	cerr <<fixed <<setprecision(20);

	//	while(true){
	    int n;cin >> n;if(n==0)break;
	    set<int> S;REP(i,n){int v;cin >> v;S.insert(v);}
	    int q;cin >> q;
	    int res=0;
	    REP(i,q){
		int v;cin >> v;res+=S.count(v);
	    }
	    cout << res <<endl;
	    //}

 	return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:47:36: error: break statement not within loop or switch
   47 |             int n;cin >> n;if(n==0)break;
      |                                    ^~~~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>

using namespace std;

int main(){
    int T,C=0,n,q;
    bool S[100000]
    
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&T);
        S[T]=true;
    }
    
    scanf("%d",&q);
    for(int i=0;i<q;i++){
        scanf("%d",&T);
        
        if(S[T])C++;
    }
    
    printf("%d\n",C);
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: expected initializer before 'scanf'
   17 |     scanf("%d",&n);
      |     ^~~~~
a.cc:20:9: error: 'S' was not declared in this scope
   20 |         S[T]=true;
      |         ^
a.cc:27:12: error: 'S' was not declared in this scope
   27 |         if(S[T])C++;
      |            ^
Language: C++

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>

using namespace std;

int main(){
    int T,C=0,n,q;
    bool S[100001]
    
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&T);
        S[T]=true;
    }
    
    scanf("%d",&q);
    for(int i=0;i<q;i++){
        scanf("%d",&T);
        
        if(S[T])C++;
    }
    
    printf("%d\n",C);
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: expected initializer before 'scanf'
   17 |     scanf("%d",&n);
      |     ^~~~~
a.cc:20:9: error: 'S' was not declared in this scope
   20 |         S[T]=true;
      |         ^
a.cc:27:12: error: 'S' was not declared in this scope
   27 |         if(S[T])C++;
      |            ^
Language: C++

using namespace std;
void input_shugo(int,int[]);
int binary_search_self(int[],int,int);
int main(){
    int S[100000],T[50000];
    int n,q,result=0;
    
    scanf("%d",&n);
    input_shugo(n, S);
    std::sort(&S[0],&S[n]);

    scanf("%d",&q);
    input_shugo(q, T);
    std::sort(&T[0],&T[q]);
   
    for (int i=0; i<q; i++){
        result += binary_search_self(S,n,T[i]);
    }
    
    printf("%d\n",result);
}


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

int binary_search_self(int search_data[],int n,int search_value){
    int max = n-1;
    int min = 0;
    int mid;
    while(min<= max) {
        mid = (max + min) / 2; 
        if (search_data[mid] == search_value) {
            return 1;
            
        } else if (search_data[mid] < search_value) {
            min = mid + 1; 
        } else {
            max = mid - 1; 
        }
    }
    return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'scanf' was not declared in this scope
    8 |     scanf("%d",&n);
      |     ^~~~~
a.cc:10:10: error: 'sort' is not a member of 'std'
   10 |     std::sort(&S[0],&S[n]);
      |          ^~~~
a.cc:14:10: error: 'sort' is not a member of 'std'
   14 |     std::sort(&T[0],&T[q]);
      |          ^~~~
a.cc:20:5: error: 'printf' was not declared in this scope
   20 |     printf("%d\n",result);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | using namespace std;
a.cc: In function 'void input_shugo(int, int*)':
a.cc:26:9: error: 'scanf' was not declared in this scope
   26 |         scanf("%d",&shugo[i]);
      |         ^~~~~
Language: C++

#include<stdio.h>
#include <algorithm>
using namespace std;
void input_shugo(int,int[]);
int binary_search_self(int[],int,int);
int main(){
    int S[100000],T[50000];
    int n,q,result=0;
    
    scanf("%d",&n);
    input_shugo(n, S);
    std::sort(&S[0],&S[n]);

    scanf("%d",&q);
    input_shugo(q, T);
    std::sort(&T[0],&T[q]);
   
    for (int i=0; i<q; i++){
        result += binary_search_self(S,n,T[i]);
    }
    
    printf("%d\n",result);
}


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

int binary_search_self(int search_data[],int n,int search_value){
    int max = n-1;
    int min = 0;
    int mid;
    while(min<= max) {
        mid = (max + min) / 2; 
        if (search_data[mid] == search_value) {
            return 1;
            
        } else if (search_data[mid] < search_value) {
            min = mid + 1; 
        } else {
            max = mid - 1; 
        }
    }
    return 0;
} 	 

Compiler output:
a.cc:3:3: error: stray '\36' in program
    3 | us<U+001E>ing namespace std;
      |   ^~~~~~~~
a.cc:11:23: error: stray '\36' in program
   11 |     input_shugo(n, S);<U+001E>
      |                       ^~~~~~~~
a.cc:3:1: error: 'us' does not name a type
    3 | using namespace std;
      | ^~
Language: C++

#include<stdio.h>
#include<algorithm>
#include<map>

using namespace std;
void input_shugo(int,std::map<int, int>);

int main(){
    std::map<int, int> input;
    int n,q,result=0,work;
    scanf("%d",&n);
//    input_shugo(n, input);
    int in;
    for (int i=0; i<n; i++) {
        scanf("%d",&in);
        input[in] = 1;
//        printf("in=%d input[in]=%d",in,input[in]);
    }
    scanf("%d",&q);
    
    for (int i=0; i<q; i++) {
        scanf("%d",&work);
        if (input[work]==1) {
            result++;
        }
    }
    printf("%d\n",result);
}


void input_shugo(int n,std::map<int, int> input){
    int in;
    for (int i=0; i<n; i++) {
        scanf("%d",&in);#include<stdio.h>


int main(){
    int n,in,result=0;
    int data[100000]={0};
    scanf("%d",&n);
    for (int i=0; i<n; i++) {
        scanf("%d",&in);
        data[in] = 1;
    }
    scanf("%d",&n);
    for (int i=0; i<n; i++) {
        scanf("%d",&in);
        if (data[in]==1) {
            result++;
        }
    }
    printf("%d\n",result);
}
        input[in] = 1;
        printf("in=%d input[in]=%d",in,input[in]);
    }
}

Compiler output:
a.cc:34:25: error: stray '#' in program
   34 |         scanf("%d",&in);#include<stdio.h>
      |                         ^
a.cc: In function 'void input_shugo(int, std::map<int, int>)':
a.cc:34:26: error: 'include' was not declared in this scope
   34 |         scanf("%d",&in);#include<stdio.h>
      |                          ^~~~~~~
a.cc:34:34: error: 'stdio' was not declared in this scope; did you mean 'stdin'?
   34 |         scanf("%d",&in);#include<stdio.h>
      |                                  ^~~~~
      |                                  stdin
a.cc:37:1: error: expected primary-expression before 'int'
   37 | int main(){
      | ^~~
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main(){
  int count = 0;
  int n,q;
  int a[1000100];
  int b[1000100];
  cin >> n;
  for (int i = 0; i < n; ++i)
  {
    cin >> a[i];
  }
  cin >> q;
  for (int i = 0; i < q; ++i)
  {
    cin >> b[i];
  }
  sort(a,a+n);
  for (int i = 0; i < q; ++i)
  {
    if(binary_search(a,a+n,b[i])){
      count ++;
    }
  }
  cout count
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:7: error: expected ';' before 'count'
   28 |   cout count
      |       ^~~~~~
      |       ;
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main(){
  int count = 0;
  int n,q;
  int a[1000100];
  int b[1000100];
  cin >> n;
  for (int i = 0; i < n; ++i)
  {
    cin >> a[i];
  }
  cin >> q;
  for (int i = 0; i < q; ++i)
  {
    cin >> b[i];
  }
  sort(a,a+n);
  for (int i = 0; i < q; ++i)
  {
    if(binary_search(a,a+n,b[i])){
      count ++;
    }
  }
  cout count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:7: error: expected ';' before 'count'
   28 |   cout count;
      |       ^~~~~~
      |       ;
Language: C++

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

template<typename T> set<T> Product(set<T>& rsettA, set<T>&rsettB) {
    set<T> settProduct;
    for (set<T>::iterator itt = rsettB.begin(); itt != rsettB.end(); itt++) {
        if (rsettA.find(*itt) != rsettA.end()) {
            settProduct.insert(*itt);
        }
    }
    return settProduct;
}

int main(){
	int i,j;
	int n , q;
	set<int> s1,s2;
	cin >> n;
	for(i=0;i<n;++i){
		cin>>j;
		s1.insert(j);
	}
	cin >> q;
	for(i=0;i<q;++i){
		cin >> j;
		s2.insert(j);
	}
	set<int> ans = Product(s1,s2);
	
	/*TLE
	for(i=0;i<q;++i){
		for(j=0;j<n;++j){
			if(t[i]==s[j]){
				ans++;
				break;
			}
		}
	}
	*/
	cout << ans.size() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'std::set<T> Product(std::set<T>&, std::set<T>&)':
a.cc:11:10: error: need 'typename' before 'std::set<T>::iterator' because 'std::set<T>' is a dependent scope
   11 |     for (set<T>::iterator itt = rsettB.begin(); itt != rsettB.end(); itt++) {
      |          ^~~~~~
a.cc:11:26: error: expected ';' before 'itt'
   11 |     for (set<T>::iterator itt = rsettB.begin(); itt != rsettB.end(); itt++) {
      |                          ^~~~
      |                          ;
a.cc:11:49: error: 'itt' was not declared in this scope; did you mean 'int'?
   11 |     for (set<T>::iterator itt = rsettB.begin(); itt != rsettB.end(); itt++) {
      |                                                 ^~~
      |                                                 int
a.cc: In instantiation of 'std::set<T> Product(std::set<T>&, std::set<T>&) [with T = int]':
a.cc:33:24:   required from here
   33 |         set<int> ans = Product(s1,s2);
      |                        ~~~~~~~^~~~~~~
a.cc:11:18: error: dependent-name 'std::set<T>::iterator' is parsed as a non-type, but instantiation yields a type
   11 |     for (set<T>::iterator itt = rsettB.begin(); itt != rsettB.end(); itt++) {
      |                  ^~~~~~~~
a.cc:11:18: note: say 'typename std::set<T>::iterator' if a type is meant
Language: C++

#include<stdio.h>
#include<iostream>
#include<list>
#include<map>
#include<vector>
#include<algorithm>
#include<string.h>
#include<bitset>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << x << endl;
using namespace std;

int main(){
    int n,s,q,t;
    bitset<1000000> count;

    while(cin >> n){
        ans = 0;
        rep(i,n){
            cin >> s;
            count[s] = 1;
        }
        cin >> q;
        rep(i,q){
            cin >> t;
            ans+= count[t];
        }
        cout << ans << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |         ans = 0;
      |         ^~~
      |         abs
Language: C++


def bi_search(a,ary)
	l = 0
	r = ary.length
	while r-l > 1
		m = (l + r)/2	#??´??°????????????
		if ary[m] > a
			r = m
		else
			l = m
		end
	end
	if ary[l] == a
		1
	else
		0
	end
end

n = gets.chomp.to_i
s = gets.chomp.split()

for i in 0..n-1
	s[i] = s[i].to_i
end

q = gets.chomp.to_i
t = gets.chomp.split()

for i in 0..t-1
	t[i] = t[i].to_i
end

sum = 0

for i in 0..t-1
	sum += bi_search(t[i],s)
end

puts sum

Compiler output:
a.cc:6:33: error: stray '#' in program
    6 |                 m = (l + r)/2   #??´??°????????????
      |                                 ^
a.cc:6:39: error: extended character ° is not valid in an identifier
    6 |                 m = (l + r)/2   #??´??°????????????
      |                                       ^
a.cc:23:10: error: too many decimal points in number
   23 | for i in 0..n-1
      |          ^~~~
a.cc:30:10: error: too many decimal points in number
   30 | for i in 0..t-1
      |          ^~~~
a.cc:36:10: error: too many decimal points in number
   36 | for i in 0..t-1
      |          ^~~~
a.cc:2:1: error: 'def' does not name a type
    2 | def bi_search(a,ary)
      | ^~~
Language: C++

#include <stdio.h>
#include <algorithm>

int main(void) {
	int i, n, s[100001], q, t[50001], c = 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]);
	for(i = 0; i < q; i++) {
		int l = std::lower_bound(s, s + n, t[i]);
		int u = std::upper_bound(s, s + n, t[i]);
		if( l == u ) c++;
	}
	printf("%d\n", c);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:41: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   11 |                 int l = std::lower_bound(s, s + n, t[i]);
      |                         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
      |                                         |
      |                                         int*
a.cc:12:41: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   12 |                 int u = std::upper_bound(s, s + n, t[i]);
      |                         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
      |                                         |
      |                                         int*
Language: C++

#include<stdio.h>
#include<algorithm>

int main(){
	int n,q,i,s[100000],t[50000],cnt=0,j,k;
	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]);
	}
	std::sort(S,S+n);
	for(j=0;j<q;j++){
		int low=0,high=n-1,mid;
		while(1){
			mid=(low+high)/2;
			if(s[mid]==t[i]){
				cnt++;
				break;
			} else if(s[mid]<t[i]){
				low=mid+1;
			} else {
				high=mid-1;
			}
			if(high<low) break;
		}
	}
	printf("%d\n",cnt);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: 'S' was not declared in this scope
   14 |         std::sort(S,S+n);
      |                   ^