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

#include<bits/stdc++.h>
using namespace std;
int combination(int n,int r){
    int sum=1;
    for(int i=1;i<=r;i++) //注意i的取值
        //P(n,r)=n*(n-1)...(n-r+1)
        //C(n,r)=P(n,r)/r!
        sum = sum*(n-i+1)/i;
    return sum;
}


int main()  
{  
    int n;
    int a[100002];
    memset(a,0,sizeof(a));
    cin >> n;
    for(int i = 0; i<n;i++) cin >> a[i];
    sort(a,a+n);

    int b(100002,100002);
    memset(b,0,sizeof(b));

   // for(int i = 0; i<n;i++) cout << a[i] <<" ";
    //cout << endl;
    
    int ans = 0;
    int max = 0;
    int A,B;
    A = B = 0;
    for(int i=0; i<n-1; i++)
        for(int j=i+1; j<n; j++)
            if(a[i]<a[j]){
                if(!b[a[j]][a[i]]){
                    ans = combination(a[j],a[i]);
                    b[a[j]][a[i]] = ans;
                }
                else
                    ans = b[a[j]][a[i]];
               // cout << a[j] <<" " << a[i] << " " << ans <<endl;
                if(max < ans){
                    max = ans; A = a[i]; B = a[j];
                }
            }
    cout << B << " " << A <<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: expression list treated as compound expression in initializer [-fpermissive]
   22 |     int b(100002,100002);
      |                        ^
a.cc:23:12: error: invalid conversion from 'int' to 'void*' [-fpermissive]
   23 |     memset(b,0,sizeof(b));
      |            ^
      |            |
      |            int
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:61:28: note:   initializing argument 1 of 'void* memset(void*, int, size_t)'
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                      ~~~~~~^~~
a.cc:35:22: error: invalid types 'int[int]' for array subscript
   35 |                 if(!b[a[j]][a[i]]){
      |                      ^
a.cc:37:22: error: invalid types 'int[int]' for array subscript
   37 |                     b[a[j]][a[i]] = ans;
      |                      ^
a.cc:40:28: error: invalid types 'int[int]' for array subscript
   40 |                     ans = b[a[j]][a[i]];
      |                            ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int combination(int n,int r){
    int sum=1;
    for(int i=1;i<=r;i++) //注意i的取值
        //P(n,r)=n*(n-1)...(n-r+1)
        //C(n,r)=P(n,r)/r!
        sum = sum*(n-i+1)/i;
    return sum;
}


int main()  
{  
    int n;
    int a[100002];
    memset(a,0,sizeof(a));
    cin >> n;
    for(int i = 0; i<n;i++) cin >> a[i];
    sort(a,a+n);

   // for(int i = 0; i<n;i++) cout << a[i] <<" ";
    //cout << endl;
    
    int ans = 0;
    int max = 0;
    int A,B;
    A = B = 0;
    for(int i=0; i<n-1; i++)
        for(int j=i+1; j<n; j++)
            if(a[i]<a[j]){
                ans = combination(a[j],a[i]);
               // cout << a[j] <<" " << a[i] << " " << ans <<endl;
                if(max < ans){
                    max = ans; A = a[i]; B = a[j];
                }
            }
    cout << B << " " << A <<endl;
    return 0;
}

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

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

int main() {
  long long int comb(long long int x, long long int y);
  int n;
  cin >> n;
  int ain[n];
  vector<int> a;
  for (int i = 0; i < n; i++) {
    cin >> ain[i];
    a.push_back(ain[i]);
  }
  sort(a.begin(), a.end());
  int mae, ato;
  int ima = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (ima < comb(a[j], a[i])) {
        mae = j;
        ato = i;
      }
    }
  }
  cout << mae << " " << ato << endl;
}

long long int comb(long long int x, long long int y) {
  long long int kaijou(int x);
  return kaijou(x) / (kaijou(y) * kaijou(y - x));
}

long long int kaijou(int x, int y) {
  long long int a = 1;
  for (int i = x; i <= y; i++) {
    a = a * i;
  }
  return a;
}


Compiler output:
/usr/bin/ld: /tmp/ccapG0Bn.o: in function `comb(long long, long long)':
a.cc:(.text+0x231): undefined reference to `kaijou(int)'
/usr/bin/ld: a.cc:(.text+0x23f): undefined reference to `kaijou(int)'
/usr/bin/ld: a.cc:(.text+0x259): undefined reference to `kaijou(int)'
collect2: error: ld returned 1 exit status
Language: C++

#include<algorithm>
#include<stdio.h>
#include<stdlib.h>
#include<queue>
#include<stack>
#include<vector>

using namespace std;

int main(void) {
	int N = 0,p = 0;
	int min = INT_MAX;
	int CENTER = 0;
	scanf("%d", &N);
	vector<int> list(N);
	for (int i = 0; i < N; i++) {
		int j = 0;
		scanf("%d", &j);
		list[i] = j;
	}

	sort(list.begin(), list.end());

	CENTER = list[N - 1] / 2 + ((list[N - 1] % 2) == 0 ? 0 : 1);

	for (int i = 0; i < N; i++) {
		if (abs(CENTER  - list[i]) < min) {
			min = abs(CENTER - list[i]);
			p = list[i];
		}
	}

	printf("%d %d\n", list[N - 1], p);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: 'INT_MAX' was not declared in this scope
   12 |         int min = INT_MAX;
      |                   ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include<stack>
  +++ |+#include <climits>
    6 | #include<vector>
Language: C++

#include<algorithm>
#include<stdio.h>
#include<stdlib.h>
#include<queue>
#include<stack>
#include<vector>

using namespace std;

int main(void) {
	int N = 0;
	int min = INT_MAX, p = 0;
	int CENTER = 0;
	scanf("%d", &N);
	vector<int> list(N);
	for (int i = 0; i < N; i++) {
		int j = 0;
		scanf("%d", &j);
		list[i] = j;
	}

	sort(list.begin(), list.end());

	CENTER = list[N - 1] / 2 + ((list[N - 1] % 2) == 0 ? 0 : 1);

	for (int i = 0; i < N; i++) {
		if (abs(CENTER  - list[i]) < min) {
			min = abs(CENTER - list[i]);
			p = list[i];
		}
	}

	printf("%d %d\n", list[N - 1], p);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: 'INT_MAX' was not declared in this scope
   12 |         int min = INT_MAX, p = 0;
      |                   ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include<stack>
  +++ |+#include <climits>
    6 | #include<vector>
a.cc:29:25: error: 'p' was not declared in this scope
   29 |                         p = list[i];
      |                         ^
a.cc:33:40: error: 'p' was not declared in this scope
   33 |         printf("%d %d\n", list[N - 1], p);
      |                                        ^
Language: C++

#include<algorithm>
#include<stdio.h>
#include<stdlib.h>
#include<queue>
#include<stack>
#include<vector>

using namespace std;

int main(void) {
	int N = 0;
	int min = INT_MAX, p = 0;
	int CENTER = 0;
	scanf("%d", &N);
	vector<int> list(N);
	for (int i = 0; i < N; i++) {
		int j = 0;
		scanf("%d", &j);
		list[i] = j;
	}

	sort(list.begin(), list.end());

	int CENTER = list[N - 1] / 2 + ((list[N - 1] % 2) == 0 ? 0 : 1);

	for (int i = 0; i < N; i++) {
		if (abs(CENTER  - list[i]) < min) {
			min = abs(CENTER - list[i]);
			p = list[i];
		}
	}

	printf("%d %d\n", list[N - 1], p);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: 'INT_MAX' was not declared in this scope
   12 |         int min = INT_MAX, p = 0;
      |                   ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include<stack>
  +++ |+#include <climits>
    6 | #include<vector>
a.cc:24:13: error: redeclaration of 'int CENTER'
   24 |         int CENTER = list[N - 1] / 2 + ((list[N - 1] % 2) == 0 ? 0 : 1);
      |             ^~~~~~
a.cc:13:13: note: 'int CENTER' previously declared here
   13 |         int CENTER = 0;
      |             ^~~~~~
a.cc:29:25: error: 'p' was not declared in this scope
   29 |                         p = list[i];
      |                         ^
a.cc:33:40: error: 'p' was not declared in this scope
   33 |         printf("%d %d\n", list[N - 1], p);
      |                                        ^
Language: C++

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

int main() {
  long long int comb(long long int x, long long int y);
  int n;
  cin >> n;
  int ain[n];
  vector<int> a;
  for (int i = 0; i < n; i++) {
    cin >> ain[i];
    a.push_back(ain[i]);
  }
  sort(a.begin(), a.end());
  int mae, ato;
  int ima = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (ima < comb(a[j], a[i])) {
        mae = j;
        ato = i;
      }
    }
  }
  cout << mae << " " << ato << endl;
}

long long int comb(long long int x, long long int y) {
  long long int kaijou(int x);
  return kaijou(y + 1, x);
}

long long int kaijou(int x, int y) {
  long long int a = 1;
  for (int i = x; i <= y; i++) {
    a = a * i;
  }
  return a;
}


Compiler output:
a.cc: In function 'long long int comb(long long int, long long int)':
a.cc:32:16: error: too many arguments to function 'long long int kaijou(int)'
   32 |   return kaijou(y + 1, x);
      |          ~~~~~~^~~~~~~~~~
a.cc:31:17: note: declared here
   31 |   long long int kaijou(int x);
      |                 ^~~~~~
Language: C++

#include<algorithm>
#include<stdio.h>
#include<stdlib.h>
#include<queue>
#include<stack>
#include<vector>

using namespace std;

int main(void) {
	int N = 0;
	scanf("%d", &N);
	vector<int> list(N);
	for (int i = 0; i < N; i++) {
		int j = 0;
		scanf("%d", &j);
		list[i] = j;
	}

	sort(list.begin(), list.end());

	int min = INT_MAX,p = 0;
	const int CENTER = list[N - 1] / 2 + ((list[N - 1] % 2) == 0 ? 0 : 1);

	for (int i = 0; i < N; i++) {
		if (abs(CENTER  - list[i]) < min) {
			min = abs(CENTER - list[i]);
			p = list[i];
		}
	}

	printf("%d %d\n", list[N - 1], p);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:19: error: 'INT_MAX' was not declared in this scope
   22 |         int min = INT_MAX,p = 0;
      |                   ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include<stack>
  +++ |+#include <climits>
    6 | #include<vector>
a.cc:28:25: error: 'p' was not declared in this scope
   28 |                         p = list[i];
      |                         ^
a.cc:32:40: error: 'p' was not declared in this scope
   32 |         printf("%d %d\n", list[N - 1], p);
      |                                        ^
Language: C++

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

int main() {
  long long int comb(long long int x, long long int y);
  int n;
  cin >> n;
  int ain[n];
  vector<int> a;
  for (int i = 0; i < n; i++) {
    cin >> ain[i];
    a.push_back(ain[i]);
  }
  sort(a.begin(), a.end());
  int mae, ato;
  int ima = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (ima < comb(a[j], a[i])) {
        mae = j;
        ato = i;
      }
    }
  }
  cout << mae << " " << ato << endl;
}

long long int comb(long long int x, long long int y) {
  long long int kaijou(int x);
  return kaijou(x) / kaijou(y);
}

long long int kaijou(int x) {
  long long int a = 1;
  for (int i = 1; i <= x; i++) {
    a = a * i;
  }
  return a
}


Compiler output:
a.cc: In function 'long long int kaijou(int)':
a.cc:40:11: error: expected ';' before '}' token
   40 |   return a
      |           ^
      |           ;
   41 | }
      | ~
Language: C++

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

int main() {
  long long int comb(long long int x, long long int y);
  int n;
  cin >> n;
  int ain[n];
  vector<int> a;
  for (int i = 0; i < n; i++) {
    cin >> ain[i];
    a.push_back(ain[i]);
  }
  sort(a.begin(), a.end());
  int mae, ato;
  int ima = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (ima < comb(a[j] / a[i])) {
        mae = j;
        ato = i;
      }
    }
  }
  cout << mae << " " << ato << endl;
}

long long int comb(long long int x, long long int y) {
  long long int kaijou(int x);
  return kaijou(x) / kaijou(y);
}

long long int kaijou(int x) {
  long long int a = 1;
  for (int i = 1; i <= x; i++) {
    a = a * i;
  }
  return a
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:21: error: too few arguments to function 'long long int comb(long long int, long long int)'
   21 |       if (ima < comb(a[j] / a[i])) {
      |                 ~~~~^~~~~~~~~~~~~
a.cc:7:17: note: declared here
    7 |   long long int comb(long long int x, long long int y);
      |                 ^~~~
a.cc: In function 'long long int kaijou(int)':
a.cc:40:11: error: expected ';' before '}' token
   40 |   return a
      |           ^
      |           ;
   41 | }
      | ~
Language: C++

/*
   0 1 2 3 4 5 6 7 8 910
1: 1 1------------
2: 1 2 1----------
3: 1 3 3 1--------
4: 1 4 6 4 1------
5: 1 51010 5 1--
6: 1 6152015 6 1-----
7: 1 721353521 7 1

*/
#include <iostream>
#include <cmath>
#include <algorithm>
using ll=long long;
using namespace std;
ll n;
ll a[NMAX];
int main(){
  cin >> n;
  for(int i=0;i < n; ++i){
    cin >> a[i];
  }
  sort(a, a + n);
  int i=1, j = 0;
  for(i=2;i < n; ++i){
    if(abs(a[i]/2 - a[j]) > 
       abs(a[i]/2 - a[j+1]))
      ++j;
  }
  cout << a[i] << " " << a[j] << endl;
  return 0;
}

Compiler output:
a.cc:18:6: error: 'NMAX' was not declared in this scope
   18 | ll a[NMAX];
      |      ^~~~
a.cc: In function 'int main()':
a.cc:22:12: error: 'a' was not declared in this scope
   22 |     cin >> a[i];
      |            ^
a.cc:24:8: error: 'a' was not declared in this scope
   24 |   sort(a, a + n);
      |        ^
Language: C++

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

int main() {
  int n;
  cin >> n;
  int ain[N];
  vector<int> a;
  for (int i = 0; i < n; i++) {
    cin >> ain[i];
    a.push_back(ain[i]);
  }
  sort(a.begin(), a.end());
  int mae, ato;
  int ima = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (ima < comb(a[j] / a[i])) {
        mae = j;
        ato = i;
      }
    }
  }
  cout << mae << " " << ato << endl;
}

long long int comb(long long int x, long long int y) {
  return kaijou(x) / kaijou(y);
}

long long int kaijou(int x) {
  long long int a = 1;
  for (int i = 1; i <= x; i++) {
    a = a * i;
  }
  return a
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: 'N' was not declared in this scope
    9 |   int ain[N];
      |           ^
a.cc:12:12: error: 'ain' was not declared in this scope; did you mean 'main'?
   12 |     cin >> ain[i];
      |            ^~~
      |            main
a.cc:20:17: error: 'comb' was not declared in this scope; did you mean 'wctomb'?
   20 |       if (ima < comb(a[j] / a[i])) {
      |                 ^~~~
      |                 wctomb
a.cc: In function 'long long int comb(long long int, long long int)':
a.cc:30:10: error: 'kaijou' was not declared in this scope
   30 |   return kaijou(x) / kaijou(y);
      |          ^~~~~~
a.cc: In function 'long long int kaijou(int)':
a.cc:38:11: error: expected ';' before '}' token
   38 |   return a
      |           ^
      |           ;
   39 | }
      | ~
Language: C++

#include<cstdio>
#include<math.h>
#include<algorithm>
#include<vector>

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1001001001;
#define LLINF 1001001001001001001001;
uintmax_t combination(int n,  int r) {
  if ( r * 2 > n ) r = n - r;
  uintmax_t dividend = 1;
  uintmax_t divisor  = 1;
  for ( int i = 1; i <= r; ++i ) {
    dividend *= (n-i+1);
    divisor  *= i;
  }
  return dividend / divisor;
}

int main(){
    int N;int A[100002];
    scanf("%d",&N);
    rep(i,N){
        scanf("%d",&A[i]);
    }
    sort(A,A+N);int ai=0,aj=0;long long int ans=0;
    rep(i,N){
        int _C=A[i];
        if(_C==0)continue;
        int C_big=min(_C, int(lower_bound(A,A+N,(_C+1)/2) -A) );
        int C_small=max(C_big-1,0);
        long long int C_big_C=combination(_C,A[C_big]);
        long long int C_small_C=combination(_C,A[C_small]);
       // printf("%d %d %d\n",_C,A[C_big],A[C_small]);
        if( C_big_C > C_small_C ){
            if(ans<C_big_C){
                ans=C_big_C;ai=_C;aj=A[C_big];
            }
        }else{
            if(ans<C_small_C){
                ans=C_small_C;ai=_C;aj=A[C_small];
            }
        }
    }
    printf("%d %d\n",ai,aj);
}

Compiler output:
a.cc:10:1: error: 'uintmax_t' does not name a type
   10 | uintmax_t combination(int n,  int r) {
      | ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:33:31: error: 'combination' was not declared in this scope
   33 |         long long int C_big_C=combination(_C,A[C_big]);
      |                               ^~~~~~~~~~~
Language: C++

/*
   0 1 2 3 4 5 6 7 8 910
1: 1 1------------
2: 1 2 1----------
3: 1 3 3 1--------
4: 1 4 6 4 1------
5: 1 51010 5 1--
6: 1 6152015 6 1-----
7: 1 721353521 7 1

*/
#include <iostream>
#include <cmath>

using namespace std;
ll n;
ll a[NMAX];
int main(){
  cin>> n;
  for(int i=0;i < n; ++i){
    cin >> a[i];
  }
  sort(a, a + n);
  int i=1, j = 0;
  for(i=2;i < n; ++i){
    if(abs(a[i]/2 - a[j]) > 
       abs(a[i]/2 - a[j+1]))
      ++j;
  }
  cout << a[i] << " " << a[j] << endl;
  return 0;
}

Compiler output:
a.cc:16:1: error: 'll' does not name a type
   16 | ll n;
      | ^~
a.cc:17:1: error: 'll' does not name a type
   17 | ll a[NMAX];
      | ^~
a.cc: In function 'int main()':
a.cc:19:9: error: 'n' was not declared in this scope; did you mean 'yn'?
   19 |   cin>> n;
      |         ^
      |         yn
a.cc:21:12: error: 'a' was not declared in this scope
   21 |     cin >> a[i];
      |            ^
a.cc:23:8: error: 'a' was not declared in this scope
   23 |   sort(a, a + n);
      |        ^
a.cc:23:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   23 |   sort(a, a + n);
      |   ^~~~
      |   sqrt
Language: C++

#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
int comb(int n, int r) {
  if (r == 0 || r == n)
    return 1;
  else if (r == 1)
    return n;
  return (comb(n - 1, r - 1) + comb(n - 1, r));
}
int main() {
  int n, max, im, jm;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++)
    cin >> a[i];
  sort(a.begin(), a.end(), greater<int>());
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (comb(a[i], a[j]) > max) {
        max = comb(a[i], a[j]);
        im = a[i];
        jm = a[j];
      }
    }
  }
  cout << im << " " << jm << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   18 |   sort(a.begin(), a.end(), greater<int>());
      |   ^~~~
      |   short
Language: C++

/*
   0 1 2 3 4 5 6 7 8 910
1: 1 1------------
2: 1 2 1----------
3: 1 3 3 1--------
4: 1 4 6 4 1------
5: 1 51010 5 1--
6: 1 6152015 6 1-----
7: 1 721353521 7 1

*/
#include <iostream>

using namespace std;
ll n;
ll a[NMAX];
int main(){
  cin>> n;
  for(int i=0;i < n; ++i){
    cin >> a[i];
  }
  sort(a, a + n);
  int i=1, j = 0;
  for(i=2;i < n; ++i){
    if(abs(a[i]/2 - a[j]) > 
       abs(a[i]/2 - a[j+1]))
      ++j;
  }
  cout << a[i] << " " << a[j] << endl;
  return 0;
}

Compiler output:
a.cc:15:1: error: 'll' does not name a type
   15 | ll n;
      | ^~
a.cc:16:1: error: 'll' does not name a type
   16 | ll a[NMAX];
      | ^~
a.cc: In function 'int main()':
a.cc:18:9: error: 'n' was not declared in this scope
   18 |   cin>> n;
      |         ^
a.cc:20:12: error: 'a' was not declared in this scope
   20 |     cin >> a[i];
      |            ^
a.cc:22:8: error: 'a' was not declared in this scope
   22 |   sort(a, a + n);
      |        ^
a.cc:22:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   22 |   sort(a, a + n);
      |   ^~~~
      |   short
Language: C++

#include <iostream>
#include <vector>
#include <cstdlib>

using namespace std;

int main(){
  int n;
  vector<long long> v;
  cin >> n;
  for (int i=0;i<n;i++) {
    long long a;
    cin >> a;
    v.push_back(a);
  }
  sort(v.begin(), v.end());
  long long max_a = v.back();
  long long a, b;
  if (max_a % 2 == 0) {
    a = max_a/2;
    b = max_a/2;
  } else {
    a = max_a/2;
    b = max_a/2 + 1;
  }
  long long mindiff = max_a;
  long long r;
  cout << a << endl;
  cout << b << endl;
  for (auto it = v.begin();it != v.end();it++) {
    long long da = llabs(*it - a);
    long long db = llabs(*it - b);
    long long d = da > db?da:db;
    if (d <= mindiff) {
      mindiff = d;
      r = *it;
    }
  }
  cout << max_a << " " << r << endl;
  return(0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   16 |   sort(v.begin(), v.end());
      |   ^~~~
      |   short
Language: C

include <stdio.h>

long comb(int n, int r){
    long ans = 1;
    for (int i = n; i > n - r; --i) {
        ans = ans*i;
    }
    for (int i = 1 ; i < r + 1; ++i) {
        ans = ans / i;
    }
    return ans;
}

int main(){

    int n,m,a[100001];
    int i,j,k,t;
    int cn,cr;
    long max=0;
    long ans;

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

    for(i=0;i<n-1;i++){
        for(j=n-1;j>i;j--){
            if(a[j-1]>a[j]){
                t = a[j];
                a[j] = a[j-1];
                a[j-1] = t;
            }
        }
    }

    for(i=0;i<n-1;i++){
        for(j=i+1;j<n;j++){
            if(a[i]>a[j]-a[i] && a[j]-a[i]>=0){
                ans = comb(a[j],a[j]-a[i]);
            }else{
                ans = comb(a[j],a[i]);
            }
            //printf("%d %d %ld\n", a[j],a[i],ans);
            if(max<ans){
                max = ans;
                cn=a[j]; cr=a[i];
            }
        }
    }

    printf("%d %d\n", cn,cr);


    return 0;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c: In function 'main':
main.c:22:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   22 |     scanf("%d", &n);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include <stdio.h>
main.c:22:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   22 |     scanf("%d", &n);
      |     ^~~~~
main.c:22:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:40:23: error: implicit declaration of function 'comb' [-Wimplicit-function-declaration]
   40 |                 ans = comb(a[j],a[j]-a[i]);
      |                       ^~~~
main.c:52:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   52 |     printf("%d %d\n", cn,cr);
      |     ^~~~~~
main.c:52:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:52:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:52:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define fol(i,n) for(int i=0;i<n;++i)
#define pb push_back
typedef long long ll;
typedef pair<int,int> P;
typedef vector<P> vip;

int main(){
    int n;cin>>n;
    int MX = 0;
    int arr[n]={};
    fol(i,n){
        cin>>arr[i];
        MX = max(MX,arr[i]);
    }
    int NX = MX/2;
    int ans = 0;
    fol(i,n){
        if(arr[i]!=MX){
          if(arr[i]>NX){arr[i]-=NX;
        ans = max(ans,arr[i]);}
    }
    printf("%d %d\n",MX,ans);
    return 0;
}


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

#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <iomanip>
#include <iterator>
#include <algorithm>
#include <functional>
#include <typeinfo>
#include <utility>
#include <tuple>
#include <queue>
#include <deque>

using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define reprrev(i, a, b) for (int i = (int)(b) - 1; i >= (int)(a); i--)
#define reprev(i, n) reprrev(i, 0, n)
#define mp(a, b) make_pair(a, b)
#define all(vec) (vec).begin(), (vec).end()
#define yn(formula) (formula) ? (cout << "Yes" << endl) : (cout << "No" << endl)
#define YN(formula) (formula) ? (cout << "YES" << endl) : (cout << "NO" << endl)
#define MIN(a, b) ((a) < (b)) ? (a) : (b)

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<pii> vp;
typedef vector<pll> vpl;
typedef vector<vi> vvi;
typedef vector<vll> vvl;
typedef vector<vb> vvb;
typedef vector<vc> vvc;
typedef vector<vs> vvs;
typedef vector<vp> vvp;
typedef vector<vpl> vvpl;

constexpr double PI = 3.14159265358979323846;
constexpr ll INF = 1 << 29;
constexpr ll MOD = (ll)1e9 + 7;
constexpr double EPS = 1e-7;
constexpr int dy[4] = { 0, 1, 0, -1 };
constexpr int dx[4] = { 1, 0, -1, 0 };

struct edge { ll to; ll cost; };

/*<ここから>***********************************************************/


int main()
{
	int n;
	cin >> n;
	vll a(n);
	rep(i, n) cin >> a[i];

	sort(all(a));
	
	ll ma = a[n - 1];
	double nans = ma / 2.0;
	ll d = LLONG_MAX;
	ll ans = 0;
	rep(i, n) {
		if (abs(nans - a[i]) < d) {
			d = abs(nans - a[i]);
			ans = a[i];
		}
	}

	cout << ma << ' ' << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:16: error: 'LLONG_MAX' was not declared in this scope
   68 |         ll d = LLONG_MAX;
      |                ^~~~~~~~~
a.cc:13:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   12 | #include <queue>
  +++ |+#include <climits>
   13 | #include <deque>
Language: C++

https://www.youtube.com/playlist?list=PLwak55LwUqMV3p-br-BaQilJIZnsmKyRj

Compiler output:
a.cc:1:1: error: 'https' does not name a type
    1 | https://www.youtube.com/playlist?list=PLwak55LwUqMV3p-br-BaQilJIZnsmKyRj
      | ^~~~~
Language: C++

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

int n,x[200005];
pair<int,int> a1[200005],a[200005];

bool cmp(pair<int,int> a,pair<int,int> b)
{
    return a.second<b.second;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>x[i];
        a[i]={x[i],i};
        a1[i]={x[i],i};
    }
    sort(a+1,a+1+n);
    int m=a[n/2].first,M=a[n/2+1].first;
    for(int i=1;i<=n;i++)
    {
        a1[a[i].second].second=i;
    }
    /*for(int i=1;i<=n;i++)
        cout<<a1[i].first<<" "<<a1[i].second<<endl;*/
    for(int i=1;i<=n;i++)
    {
        if(a1[i].second<=n/2)
            cout<<M<<endl;
        else if(a1[i].second=>n/2+1)
            cout<<m<<endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:30: error: expected primary-expression before '>' token
   36 |         else if(a1[i].second=>n/2+1)
      |                              ^
Language: C++

domain=$1

if [ $domain = "aoj" ]; then
    echo "submit is not compatible with AOJ."
fi

# 2020/05/24現在、ABC, ARC, AGCのみ対応
if [ $domain = "atcoder" ]; then
    contest_id=$2
    problem=$3
    if [[ $contest_id == *abc* ]]; then
        cd ./in-progress/atcoder/abc/${contest_id}/${problem}
    elif [[ $contest_id == *arc* ]]; then
        cd ./in-progress/atcoder/arc/${contest_id}/${problem}
    elif [[ $contest_id == *agc* ]]; then
        cd ./in-progress/atcoder/agc/${contest_id}/${problem}
    else
        cd ./in-progress/atcoder/other-contests/${contest_id}/${problem}
    fi
    oj s https://atcoder.jp/contests/${contest_id}/tasks/${problem} ${problem}.cpp
fi

Compiler output:
a.cc:7:7: error: "/" is not a valid filename
    7 | # 2020/05/24現在、ABC, ARC, AGCのみ対応
      |       ^
a.cc:7:11: error: extended character 、 is not valid in an identifier
    7 | # 2020/05/24現在、ABC, ARC, AGCのみ対応
      |           ^
a.cc:1:1: error: 'domain' does not name a type
    1 | domain=$1
      | ^~~~~~
a.cc:3:25: error: 'then' does not name a type
    3 | if [ $domain = "aoj" ]; then
      |                         ^~~~
a.cc:8:29: error: 'then' does not name a type
    8 | if [ $domain = "atcoder" ]; then
      |                             ^~~~
a.cc:11:36: error: 'then' does not name a type
   11 |     if [[ $contest_id == *abc* ]]; then
      |                                    ^~~~
a.cc:12:51: error: expected unqualified-id before '/' token
   12 |         cd ./in-progress/atcoder/abc/${contest_id}/${problem}
      |                                                   ^
a.cc:13:5: error: 'elif' does not name a type
   13 |     elif [[ $contest_id == *arc* ]]; then
      |     ^~~~
a.cc:13:38: error: 'then' does not name a type
   13 |     elif [[ $contest_id == *arc* ]]; then
      |                                      ^~~~
a.cc:14:51: error: expected unqualified-id before '/' token
   14 |         cd ./in-progress/atcoder/arc/${contest_id}/${problem}
      |                                                   ^
a.cc:15:5: error: 'elif' does not name a type
   15 |     elif [[ $contest_id == *agc* ]]; then
      |     ^~~~
a.cc:15:38: error: 'then' does not name a type
   15 |     elif [[ $contest_id == *agc* ]]; then
      |                                      ^~~~
a.cc:16:51: error: expected unqualified-id before '/' token
   16 |         cd ./in-progress/atcoder/agc/${contest_id}/${problem}
      |                                                   ^
a.cc:17:5: error: expected unqualified-id before 'else'
   17 |     else
      |     ^~~~
a.cc:18:62: error: expected unqualified-id before '/' token
   18 |         cd ./in-progress/atcoder/other-contests/${contest_id}/${problem}
      |                                                              ^
a.cc:19:5: error: 'fi' does not name a type
   19 |     fi
      |     ^~
Language: C++

#include <bits/stdc++.h>//復習必須
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
#define rep(i, n) for (int i = 0; i < n; ++i)
using ll = long long;
using namespace std;
#define P pair<int, int>
int main (){ 
    ll N ;
    cin >> N ;
    vector<int> x(n);
    rep(i, n) cin >> x[i];
    vector<int> s;
    s.assign(x.begin(), x.end());
    sort(s.begin(), s.end(), less<int>());
 
    rep(i, n) {
    int l = s[n / 2 - 1];
    int r = s[n / 2];
    int mid = x[i] <= l ? r : l;
    cout << mid << endl;
  }

}
    

 


Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: 'n' was not declared in this scope
   15 |     vector<int> x(n);
      |                   ^
Language: C++

#include<bits/stdc++.h>
#define god dimasi5eks
#pragma GCC optimize("O3")
#define fi first
#define se second
#define pb push_back
#define pf push_front
#define mod 1000000007
#define dancila 3.14159265359
#define eps 1e-9

// #define fisier 1

using namespace std;

typedef long long ll;


int add(int a, int b)
{
    int x = a+b;
    if(x >= mod)
        x -= mod;
    if(x < 0)
        x += mod;
    return x;
}
ll mul(ll a, ll b)
{
    return (a*b) % mod;
}

ll pw(ll a, ll b)
{
    ll ans = 1;
    while(b)
    {
        if(b & 1)
            ans = (ans * a) % mod;
        a = (a * a) % mod;
        b >>= 1;
    }
    return ans;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long rand_seed()
{
    long long a = rng();
    return a;
}

int n, v[200002], pi[200002], ans[200002];

bool cmp(int a, int b)
{
    return v[a] < v[b];
}
int main()
{

    #ifdef fisier
        ifstream f("input.in");
        ofstream g("output.out");
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n;
    for(int i = 1; i <= n; ++i)
        cin >> v[i], pi[i] = i;
    sort(pi + 1, pi + n + 1, cmp);
    for(int i = 1; i <= n; ++i)
        if(i <= n/2)
            ans[pi[i]] = v[pi[n/2+1]];
        else
            ans[pi[i]] = v[pi[n/2]];
    for(int i = 1; i <= n; ++i)
        cout << ans[i] '\n';
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:79:23: error: expected ';' before '\xa'
   79 |         cout << ans[i] '\n';
      |                       ^~~~~
      |                       ;
Language: C++

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int64_t abs(int64_t n) {
  if (n < 0) {
    n = -n;
  }
  return n;
}
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
int64_t factorial(int64_t n) {
  if (n == 1) {
    return 1;
  }
  int64_t ans = factorial(n-1);
  return ans*n;
}

int main() {
  int64_t n;
  cin >> n;
  vector <int64_t> v(n);
  vector <int64_t> data(n);
  rep(i, n) {
    cin >> v.at(i);
    data.at(i) = v.at(i);
  }
  sort(v.begin(), v.end());
  double mid1 = (double)v.at((n/2)-1), (double)mid2 = v.at(n/2);
  double mid = (mid1+mid2)/2.0;
  rep(i, n) {
    if (data.at(i) <= mid) {
      cout << (int64_t)mid2 << endl;
    } else {
      cout<< (int64_t)mid1 << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:41: error: expected unqualified-id before 'double'
   49 |   double mid1 = (double)v.at((n/2)-1), (double)mid2 = v.at(n/2);
      |                                         ^~~~~~
a.cc:49:41: error: expected ')' before 'double'
   49 |   double mid1 = (double)v.at((n/2)-1), (double)mid2 = v.at(n/2);
      |                                        ~^~~~~~
      |                                         )
a.cc:50:22: error: 'mid2' was not declared in this scope; did you mean 'mid'?
   50 |   double mid = (mid1+mid2)/2.0;
      |                      ^~~~
      |                      mid
Language: C++

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

int main(void){
 long long int a,b[200010],c;
  
  cin >> a;
  
  for(int i=1;i<=a;i++)
    cin >> b[i];
  
  
  sort(b,b+a);
  
  c = (b[a/2]+b[a/2+1])/2;
  
  
  for(int i=1 i<=a;i++){
    
    if(c %2 == 0){
      cout << c << endl;
    }
    
    else{
      
      if(b[i] <c){
        
        cout << c+1 << endl;
      }
      
      else{
        cout << c << endl;
      }
    }
  }
}
      
  
  
  
    

Compiler output:
a.cc: In function 'int main()':
a.cc:19:14: error: expected ';' before 'i'
   19 |   for(int i=1 i<=a;i++){
      |              ^~
      |              ;
Language: C++

n=int(input())
x=list(map(int,input().split()))
y=sorted(x)
midl=y[n//2-1]
midr=y[n//2]
for i in range(n):
    print(midl if x[i]>midl else midr)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n=int(input())
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
signed main(){
  int a;
  cin>>a;
  vector<int> b(a),c;
  fo(i,a)
    cin>>b[i];
  c=b;
  Sort(c);
  int d,e;
  d=c[a/2-1];
  e=c[a/2];
  fo(i,a){
    if(b[i]<=d)
      cout<<e<<endl;
    else
      cou<<d<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:88:7: error: 'cou' was not declared in this scope; did you mean 'cos'?
   88 |       cou<<d<<endl;
      |       ^~~
      |       cos
Language: C++

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

main(){
  multiset<long> st;
  vector<long> A;
  int n;cin>>n;
  for(int i=0;i<n;++i){
    long a;cin>>a;
    st.insert(a);
    A.push_back(a);
  }
  for(int i=0;i<n;++i){
    ll key=A[i],mid=n/2;
    auto itr=st.find(key);
    st.erase(itr);
    ll ans=*(st.begin()+mid);
    cout<<ans<<endl;
    st.insert(key);
  }
}


Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:14:5: error: 'll' was not declared in this scope
   14 |     ll key=A[i],mid=n/2;
      |     ^~
a.cc:15:22: error: 'key' was not declared in this scope; did you mean 'key_t'?
   15 |     auto itr=st.find(key);
      |                      ^~~
      |                      key_t
a.cc:17:7: error: expected ';' before 'ans'
   17 |     ll ans=*(st.begin()+mid);
      |       ^~~~
      |       ;
a.cc:18:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |     cout<<ans<<endl;
      |           ^~~
      |           abs
Language: C++

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

main(){
  multiset<long> st;
  vector<ll> A;
  int n;cin>>n;
  for(int i=0;i<n;++i){
    long a;cin>>a;
    st.insert(a);
    A.push_back(a);
  }
  for(int i=0;i<n;++i){
    ll key=A[i],mid=n/2;
    auto itr=st.find(key);
    st.erase(itr);
    ll ans=*(st.begin()+mid);
    cout<<ans<<endl;
    st.insert(key);
  }
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:10: error: 'll' was not declared in this scope
    6 |   vector<ll> A;
      |          ^~
a.cc:6:12: error: template argument 1 is invalid
    6 |   vector<ll> A;
      |            ^
a.cc:6:12: error: template argument 2 is invalid
a.cc:11:7: error: request for member 'push_back' in 'A', which is of non-class type 'int'
   11 |     A.push_back(a);
      |       ^~~~~~~~~
a.cc:14:7: error: expected ';' before 'key'
   14 |     ll key=A[i],mid=n/2;
      |       ^~~~
      |       ;
a.cc:15:22: error: 'key' was not declared in this scope; did you mean 'key_t'?
   15 |     auto itr=st.find(key);
      |                      ^~~
      |                      key_t
a.cc:17:7: error: expected ';' before 'ans'
   17 |     ll ans=*(st.begin()+mid);
      |       ^~~~
      |       ;
a.cc:18:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |     cout<<ans<<endl;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>

using namespace std;
int main(){
  int n;
   cin >>n;
  
  vector<long> x(n),y(n);
  for(int i=0;i<n;i++) {
    cin >> x[i];
    y[i]=x[i];
  }
  sort(y.begin(),y.end(),greater<long>());
  
 
  for(int i=0;i<n;i++){
  if((x[i]>y[n/2-1])||(x[i]==y[n/2-1]&&y[n/2-1]>y[n/2])) cout << y[n/2] << endl;
  else cout << y[n/2-1] << endl;
  }
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:19:4: error: expected '}' at end of input
   19 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: Java

import java.util.Arrays;
import java.util.Scanner;


public class AtCoder2 {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int inputNum = sc.nextInt();

		sc.nextLine();

		String input = sc.nextLine();

		int centerValue = inputNum / 2;

		String[] arrayStr = input.split(" ");
		int[] arrayInt = new int[arrayStr.length];
		int[] arrayIntCopy = new int[arrayStr.length];
		for(int i = 0 ; i < arrayStr.length ; i++) {

			arrayInt[i] = Integer.parseInt(arrayStr[i]);
			arrayIntCopy[i] = Integer.parseInt(arrayStr[i]);

		}

		for(int i = 0 ; i < arrayStr.length ; i++) {

			arrayInt[i] = 0;
			Arrays.sort(arrayInt);
			System.out.println(arrayInt[centerValue]);

			System.arraycopy(arrayIntCopy, 0, arrayInt, 0, arrayInt.length);


		}

		sc.close();

	}

}

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

import java.util.Arrays;
import java.util.Scanner;


public class AtCoder2 {


	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);

		//個数の入力
		int inputNum = sc.nextInt();
		//改行の読み込み
		sc.nextLine();
		//数字の入力
		String input = sc.nextLine();

		int centerValue = inputNum / 2;

		//String型の配列をint型にする
		String[] arrayStr = input.split(" ");
		int[] arrayInt = new int[arrayStr.length];
		int[] arrayIntCopy = new int[arrayStr.length];
		for(int i = 0 ; i < arrayStr.length ; i++) {

			arrayInt[i] = Integer.parseInt(arrayStr[i]);
			arrayIntCopy[i] = Integer.parseInt(arrayStr[i]);
			//System.out.println(arrayInt[i]);

		}


		for(int i = 0 ; i < arrayStr.length ; i++) {

			arrayInt[i] = 0;
			Arrays.sort(arrayInt);
			System.out.println(arrayInt[centerValue]);

			System.arraycopy(arrayIntCopy, 0, arrayInt, 0, arrayInt.length);


		}

		sc.close();


	}


}

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

import java.util.Arrays;
import java.util.Scanner;

public class C_Many_Medians {

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

		int number;

		//int swap;
		int zero=0;

		System.out.print("Nを入力：");

		number=sc.nextInt();

		int[] a=new int[number];
		int[] swap1=new int[number];



		for(int i=0;i<number;i++) {

			a[i]=sc.nextInt();

		}

		System.out.println();

	for(int j=0;j<number;j++) {

		for(int k=0;k<number;k++) {
			swap1[k]=a[k];
		}
		//swap=swap1[j];
		swap1[j]=zero;


		Arrays.sort(swap1);


		System.out.println(swap1[(number/2)]);

	}

	sc.close();

}
}


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

import java.util.Arrays;
import java.util.Scanner;

public class C_Many_Medians {

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

		int number;

		//int swap;
		int zero=0;

		System.out.print("Nを入力：");

		number=sc.nextInt();

		int[] a=new int[number];
		int[] swap1=new int[number];



		for(int i=0;i<number;i++) {

			a[i]=sc.nextInt();

		}

		System.out.println();

	for(int j=0;j<number;j++) {

		for(int k=0;k<number;k++) {
			swap1[k]=a[k];
		}
		//swap=swap1[j];
		swap1[j]=zero;


		Arrays.sort(swap1);


		System.out.println(swap1[(number/2)]);

	}

	sc.close();

}

}


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

#include<iostream>
using namespace std;

int main(){
  int n, mid1, mid2;
  cin >> n;
  int a[n], b[n];
  for (int i = 0; i < n; i++){
    cin >> a[i];
    b[i] = a[i];
  }
  sort(b, b+n);
  mid1 = b[n/2-1];
  mid2 = b[n/2];
  for (int i = 0; i < n; i++){
    if(a[i] <= mid1) cout << mid2 << endl;
    else cout << mid1 << endl;
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |   sort(b, b+n);
      |   ^~~~
      |   short
Language: C++

#include<cstdio>
#include<algorithm>
using namespace std;
vector<int> same,sorted;
int main()
{
    int N,x,i;
    scanf("%d",&N);
    for(i=0;i<N;i++)
    {
        scanf("%d",&x);
        same.push_back(x);
        sorted.push_back(x);
    }
    sort(sorted.begin(),sorted.end());
    int med=sorted[N/2-1]+sorted[N/2];
    for(i=0;i<N;i++)
    {
        if(same[i]>med/2) printf("%d\n",sorted[N/2]);
        else printf("%d\n",sorted[N/2-1]);
    }
}


Compiler output:
a.cc:4:1: error: 'vector' does not name a type
    4 | vector<int> same,sorted;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:12:9: error: 'same' was not declared in this scope
   12 |         same.push_back(x);
      |         ^~~~
a.cc:13:9: error: 'sorted' was not declared in this scope; did you mean 'strtod'?
   13 |         sorted.push_back(x);
      |         ^~~~~~
      |         strtod
a.cc:15:10: error: 'sorted' was not declared in this scope; did you mean 'strtod'?
   15 |     sort(sorted.begin(),sorted.end());
      |          ^~~~~~
      |          strtod
a.cc:19:12: error: 'same' was not declared in this scope
   19 |         if(same[i]>med/2) printf("%d\n",sorted[N/2]);
      |            ^~~~
Language: C

#include<cstdio>
#include<algorithm>
using namespace std;
vector<int> same,sorted;
int main()
{
    int N,x,i;
    scanf("%d",&N);
    for(i=0;i<N;i++)
    {
        scanf("%d",&x);
        same.push_back(x);
        sorted.push_back(x);
    }
    sort(sorted.begin(),sorted.end());
    int med=sorted[N/2-1]+sorted[N/2];
    for(i=0;i<N;i++)
    {
        if(same[i]>med/2) printf("%d\n",sorted[N/2]);
        else printf("%d\n",sorted[N/2-1]);
    }
}


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

#include <cstdio>
#include <algorithm>
using namespace std;
vector<int> vec;
int ar[200005],ans1,ans2;
int main(){
int n;
scanf("%d",&n);
for(int a=1;a<=n;++a){
    scanf("%d",&ar[a]);
    vec.push_back(ar[a]);
}
sort(vec.begin(),vec.end());
    int mid=n/2;
    ans1=vec[mid-1];
    ans2=vec[mid];
for(int a=1;a<=n;++a){
    if(ar[a]<=ans1){
        printf("%d\n",ans2);
    }else{
        printf("%d\n",ans1);
    }
}
return 0;}


Compiler output:
a.cc:4:1: error: 'vector' does not name a type
    4 | vector<int> vec;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:11:5: error: 'vec' was not declared in this scope
   11 |     vec.push_back(ar[a]);
      |     ^~~
a.cc:13:6: error: 'vec' was not declared in this scope
   13 | sort(vec.begin(),vec.end());
      |      ^~~