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

public static class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int arr[] = new int[N+1];
    int srt[] = new int[N+1];
    for(int i = 1; i<=N; i++){
      arr[i] = sc.nextInt();
      srt[i] = arr[i];
    }
    Arrays.sort(srt);
    for(int i = 1; i<=N; i++){
      if(arr[i] >= srt[N/2+1]){
        System.out.println(srt[N/2]); 
      }
      else{
        System.out.println(srt[N/2+1]); 
      }
    }
  }


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

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

public class arc095_a {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int arr[] = new int[n + 1], srt[] = new int[n + 1];
		for (int i = 1; i <= n; i++) {
			arr[i] = sc.nextInt();
			srt[i] = arr[i];
		}
		Arrays.parallelSort(srt);
		for (int i = 1; i <= n; i++) {
			System.out.println(srt[n / 2 + (arr[i] >= srt[n / 2 + 1] ? 0 : 1)]);
		}
	}

}

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

import java.util.*;

public class Solution {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int arr[] = new int[N+1];
    int srt[] = new int[N+1];
    for(int i = 1; i<=N; i++){
      arr[i] = sc.nextInt();
      srt[i] = arr[i];
    }
    Arrays.sort(srt);
    for(int i = 1; i<=N; i++){
      if(arr[i] >= srt[N/2+1]){
        System.out.println(srt[N/2]); 
      }
      else{
        System.out.println(srt[N/2+1]); 
      }
    }
  }

}


/*

pre[i] = arr[1] + arr[2] + arr[3] + arr[4] + ... + arr[i]
The question for some l and r
arr[l] + arr[l+1] + arr[l+2] + ... + arr[r]
= 
pre[r] - pre[l-1]

pre[r]   = arr[1] + arr[2] + ... + arr[l-1] + arr[l] + arr[l+1] + ... + arr[r]
-
pre[l-1] = arr[1] + arr[2] + ... + arr[l-1]

*/


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

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int arr[] = new int[N+1];
    int srt[] = new int[N+1];
    for(int i = 1; i<=N; i++){
      arr[i] = sc.nextInt();
      srt[i] = arr[i];
    }
    Arrays.sort(srt);
    for(int i = 1; i<=N; i++){
      if(arr[i] >= srt[N/2+1]){
        System.out.println(srt[N/2]); 
      }
      else{
        System.out.println(srt[N/2+1]); 
      }
    }
  }

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

import java.util.*;
public class Con_084_ {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] arr = new int[N];
		
		for (int i=0; i<N; i++){
			arr[i] = sc.nextInt();
		}
		for (int i=0; i<N; i++){
			int[] temp = new int[N-1];
			for (int j=0, k=0; j<N; j++){
				if (j==i){
					continue;
				}
				temp[k++] = arr[j];
				
			}
			Arrays.sort(temp);
			if (temp.length%2==0){
				System.out.println((temp[temp.length/2]+temp[temp.length/2+1])/2);	
			}else{
				System.out.println(temp[temp.length/2]);
			}
		}


	}

}


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

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

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

    int n;
    cin >> n;
    vector<int> x(n);
    vector<int> x_sort(n);
    rep(i, n) {
        cin >> x[i];
        x_sort[i] = x[i];
    }
    sort(x_sort.begin(), x_sort.end());

    int c_r = x_sort[(int)x_sort.size()/2];
    int c_l = x_sort[(int)x_sort.size()/2 - 1];

    rep(i, n) {}
        if(x[i] >= c_r) printf("%d\n", c_l);
        else printf("%d\n", c_r);
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:14: error: 'i' was not declared in this scope
   25 |         if(x[i] >= c_r) printf("%d\n", c_l);
      |              ^
a.cc: At global scope:
a.cc:29:5: error: expected unqualified-id before 'return'
   29 |     return 0;
      |     ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
  cin >> n;
  
vector<long int> b(n),c(n);
  for(i=0;i<n;++i)
  {
  cin >> b.at(i);
  c.at(i)=b.at(i);
  }
  
  sort(c.begin(),c.end());
  
  for(i=0;i<n;++i)
  {
   if(c.at(n/2-1)==c.at(n/2)) cout << c.at(n/2) << endl;
   else{
   if(b.at(i)<=c.at(n/2-1)) cout << c.at(n/2) << endl;
   else cout << c.at(n/2-1) << endl;
   }
  }
  
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   for(i=0;i<n;++i)
      |       ^
a.cc:17:7: error: 'i' was not declared in this scope
   17 |   for(i=0;i<n;++i)
      |       ^
Language: C++

using namespace std;

int main() {
  int n;
  cin>>n;
  vector<int>a(n),b(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
    b[i]=a[i];
  }
  int chuo=n/2;
  sort(b.begin(),b.end());
  for(int i=0;i<n;i++){
    if(a[i] <b[chuo])cout<<b[chuo]<<endl;
    else cout<<b[chuo-1]<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>n;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int>a(n),b(n);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int>a(n),b(n);
      |          ^~~
a.cc:8:10: error: 'a' was not declared in this scope
    8 |     cin>>a[i];
      |          ^
a.cc:9:5: error: 'b' was not declared in this scope
    9 |     b[i]=a[i];
      |     ^
a.cc:12:8: error: 'b' was not declared in this scope
   12 |   sort(b.begin(),b.end());
      |        ^
a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |   sort(b.begin(),b.end());
      |   ^~~~
      |   short
a.cc:14:8: error: 'a' was not declared in this scope
   14 |     if(a[i] <b[chuo])cout<<b[chuo]<<endl;
      |        ^
a.cc:14:22: error: 'cout' was not declared in this scope
   14 |     if(a[i] <b[chuo])cout<<b[chuo]<<endl;
      |                      ^~~~
a.cc:14:22: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:37: error: 'endl' was not declared in this scope
   14 |     if(a[i] <b[chuo])cout<<b[chuo]<<endl;
      |                                     ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
a.cc:15:10: error: 'cout' was not declared in this scope
   15 |     else cout<<b[chuo-1]<<endl;
      |          ^~~~
a.cc:15:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:27: error: 'endl' was not declared in this scope
   15 |     else cout<<b[chuo-1]<<endl;
      |                           ^~~~
a.cc:15:27: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

v#include<bits/stdc++.h>
using namespace std;
#define int long long int 

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

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include<bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include<bits/stdc++.h>
      | ^
a.cc:5:1: error: 'int32_t' does not name a type
    5 | int32_t main()
      | ^~~~~~~
a.cc:1:1: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
  +++ |+#include <cstdint>
    1 | v#include<bits/stdc++.h>
Language: C++

#include "bits/stdc++.h"
#define rep(i, j) for (int i = 0; i < j; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using ull = unsigned long long;

int gcd(int x, int y);
int fac(ll n, vector<int> num);

const int INF = 1001001001;

//mint�p�̕ϐ� (10��9��)
const int mod = 1000000007;

struct mint {
    ll x; // typedef long long ll;
    mint(ll x = 0) :x((x% mod + mod) % mod) {}
    mint operator-() const { return mint(-x); }
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this; }
    mint operator+(const mint a) const { return mint(*this) += a; }
    mint operator-(const mint a) const { return mint(*this) -= a; }
    mint operator*(const mint a) const { return mint(*this) *= a; }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const { return pow(mod - 2); }
    mint& operator/=(const mint a) { return *this *= a.inv(); }
    mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream & is, const mint & a) { return is >> a.x; }
ostream& operator<<(ostream & os, const mint & a) { return os << a.x; }

int main() {
    int n;
    cin >> n;
    vector<int> x(n);
    rep(i, n) cin >> x[i];

    rep(i, n) {
        int ans;
        vector<int> sinn(n);
        sinn = x;
        sinn.erase(sinn.begin() + i);
        sinn.sort(sinn.begin(), sinn.end());
        cout << ans << endl;
    }
    return 0;
}

/*���C�u�����ő����*/
//���[�O���b�h�̌ݏ��@
int gcd(int x, int y) {
    int num[3];
    num[0] = (x > y) ? x : y;
    num[1] = (x <= y) ? x : y;
    num[2] = num[0] % num[1];

    while (num[2]) {
        num[0] = num[1];
        num[1] = num[2];
        num[2] = num[0] % num[1];
    }

    return num[1];
}

/*�f��������*/
//���색�C�u����
int fac(ll n, vector<int> num) {
    ll kazu = n;
    for (int i = 2; i <= sqrt(n); i++) {
        while (1) {
            if (kazu % i != 0) break;

            kazu /= i;
            num[i]++;
        }
    }
    if (kazu == n && n != 1) return 1;
    int ans = 0;
    if (kazu != 1) ans++;
    for (int i = 2; i <= sqrt(n); i++) {
        for (int j = 1; j <= num[i]; j++) {
            num[i] -= j;
            ans++;
        }
    }
    return ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:14: error: 'class std::vector<int>' has no member named 'sort'
   59 |         sinn.sort(sinn.begin(), sinn.end());
      |              ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
using P = pair<int,int>;
const int MOD = 1000000007;

int main() {
    int n;
    cin>>n;
    vector<int> x(n),y(n);
    rep(i,n) {
        cin>>x[i];
        y[i]=x[i];
    }
    sort(y.begin(),y.end());
    rep(i,n) {
        if (x[i]<=y[n/2-1] cout<<y[n/2]<<endl;
        else cout<<y[n/2-1]<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:27: error: expected ';' before 'cout'
   18 |         if (x[i]<=y[n/2-1] cout<<y[n/2]<<endl;
      |                           ^~~~~
      |                           ;
a.cc:19:9: error: expected primary-expression before 'else'
   19 |         else cout<<y[n/2-1]<<endl;
      |         ^~~~
a.cc:18:47: error: expected ')' before 'else'
   18 |         if (x[i]<=y[n/2-1] cout<<y[n/2]<<endl;
      |            ~                                  ^
      |                                               )
   19 |         else cout<<y[n/2-1]<<endl;
      |         ~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define Rep(i,s,n) for(int i=s;i<n;i++)
#define fi first
#define se second
#define all(c) c.begin(),c.end()
typedef long long int ll;
typedef pair<int, int> P;
typedef long double ld;
void Ans(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}

const ll INF=1001001001;
const ll mod=1000000007;

int main(){
  ll n;cin>>n;
  vector<ll> a(n);
  rep(i,n) cin>>a[i];
  sort(all(v));
  rep(i,n){
    if(i<=n/2){
      cout<<v[n/2+1]<<endl;
    }
    else{
      cout<<v[n/2]<<endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: 'v' was not declared in this scope
   20 |   sort(all(v));
      |            ^
a.cc:7:16: note: in definition of macro 'all'
    7 | #define all(c) c.begin(),c.end()
      |                ^
Language: C++

int main() {
  int n; cin>>n;
  vector<int>  vec(n),v(n);
 //vector<int> v(n)==vec(n);
  for(int i=0;i<n;i++){
    cin>>vec.at(i);
    v.at(i)=vec.at(i);//順番に注意,vにvecの値を代入する
   // cout<<vec.at(i);
  }
  sort (vec.begin(),vec.end());
  for(int i=0;i<n;i++){
    if(v.at(i)<=vec.at(n/2-1))cout<<vec.at(n/2)<<endl;
    else{cout<<vec.at(n/2-1)<<endl;}
  }
  
}






Compiler output:
a.cc: In function 'int main()':
a.cc:2:10: error: 'cin' was not declared in this scope
    2 |   int n; cin>>n;
      |          ^~~
a.cc:3:3: error: 'vector' was not declared in this scope
    3 |   vector<int>  vec(n),v(n);
      |   ^~~~~~
a.cc:3:10: error: expected primary-expression before 'int'
    3 |   vector<int>  vec(n),v(n);
      |          ^~~
a.cc:6:10: error: 'vec' was not declared in this scope
    6 |     cin>>vec.at(i);
      |          ^~~
a.cc:7:5: error: 'v' was not declared in this scope
    7 |     v.at(i)=vec.at(i);//順番に注意,vにvecの値を代入する
      |     ^
a.cc:10:9: error: 'vec' was not declared in this scope
   10 |   sort (vec.begin(),vec.end());
      |         ^~~
a.cc:10:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |   sort (vec.begin(),vec.end());
      |   ^~~~
      |   short
a.cc:12:8: error: 'v' was not declared in this scope
   12 |     if(v.at(i)<=vec.at(n/2-1))cout<<vec.at(n/2)<<endl;
      |        ^
a.cc:12:31: error: 'cout' was not declared in this scope
   12 |     if(v.at(i)<=vec.at(n/2-1))cout<<vec.at(n/2)<<endl;
      |                               ^~~~
a.cc:12:50: error: 'endl' was not declared in this scope
   12 |     if(v.at(i)<=vec.at(n/2-1))cout<<vec.at(n/2)<<endl;
      |                                                  ^~~~
a.cc:13:10: error: 'cout' was not declared in this scope
   13 |     else{cout<<vec.at(n/2-1)<<endl;}
      |          ^~~~
a.cc:13:31: error: 'endl' was not declared in this scope
   13 |     else{cout<<vec.at(n/2-1)<<endl;}
      |                               ^~~~
Language: C++

# include <bits/stdc++.h>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
using namespace std;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const long long INF = 1LL << 60;

ll gcd(ll a, ll b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}

uintmax_t combination(unsigned int n, unsigned int r) {
  if ( r * 2 > n ) r = n - r;
  uintmax_t dividend = 1;
  uintmax_t divisor  = 1;
  for ( unsigned int i = 1; i <= r; ++i ) {
    dividend *= (n-i+1);
    divisor  *= i;
  }
  return dividend / divisor;
}

int modPow(long long a, long long n, long long p) {
  if (n == 1) return a % p;
  if (n % 2 == 1) return (a * modPow(a, n - 1, p)) % p;
  long long t = modPow(a, n / 2, p);
  return (t * t) % p;
}

ll lcm(ll a, ll b)
{
   return a / gcd(a, b) * b;
}

int main()
{
  ll n;
  cin >> n;
  vector<ll> x(n),y(n);
  rep(i,n) cin >> x[i];
  rep(i,n) y[i] = x[i];

  sort(ALL(y));
  ll a = y[(l-3)/2];
  ll b = y[(l-1)/2];
  ll c = y[(l+1)/2];

  vector<ll> ans(n);

  rep(i,n){
    if(x[i] < b) ans[i] = (b+c)/2;
    else if(x[i] == b) ans[i] = (a+c)/2;
    else ans[i] = (a+b)/2;
  }
  rep(i,n) cout << ans[i] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:13: error: 'l' was not declared in this scope
   60 |   ll a = y[(l-3)/2];
      |             ^
Language: C++

import copy
N = int(input())
list_x = list(map(int,input().split()))
sorted_x = copy.copy(list_x)
sorted_x.sort()

L = sorted_x[(N-1)//2]
M = sorted_x[(N+1)//2]
base = (L+M)/2


for i in  list_x:
    if i >= base:
        print(L)
    else:
        print(M)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import copy
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: Java

import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Collections;
import java.util.NoSuchElementException;

public class Main {
	//FastScannerクラス、普通の Scannerクラスだとメモリと時間を大幅に喰らうので高速化する内部クラス。
	
	public static void main(String[]args) {
		FastScanner sc = new FastScanner(System.in);
		int N = Integer.valueOf(sc.next());
		Integer []x = new Integer[N];
		Integer []X = new Integer[N];
		
		for(int i = 0;i<N;i++) {
			x[i] = Integer.valueOf(sc.next());
			X[i] = x[i];
		}
		
		Arrays.sort(x,Collections.reverseOrder());//降順にソート
		
		for(int i = 0;i<N;i++) {
			//System.out.print(x[i]);
			//System.out.print(" ");
			//System.out.println(X[i]);
		}
		
		int num = (N-1+1)/2;
		
		for(int i = 0;i<N;i++) {
			if(X[i]<x[num-1])
				System.out.println(x[num-1]);
			else
				System.out.println(x[num-1+1]);
		}
		
		
	}
		
	}
	
	static class FastScanner {
		 
		private final InputStream in;
		private final byte[] buffer = new byte[1024];
		private int ptr = 0;
		private int buflen = 0;
 
		public FastScanner(InputStream source) {
			in = source;
		}
 
		private boolean hasNextByte() {
			if (ptr < buflen) {
				return true;
			} else {
				ptr = 0;
				try {
					buflen = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (buflen <= 0) {
					return false;
				}
			}
			return true;
		}
 
		private int readByte() {
			if (hasNextByte()) return buffer[ptr++];
			else return -1;
		}
 
		private static boolean isPrintableChar(int c) {
			return 33 <= c && c <= 126;
		}
 
		private void skipUnprintable() {
			while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
		}
 
		public boolean hasNext() {
			skipUnprintable();
			return hasNextByte();
		}
 
		public String next() {
			if (!hasNext()) throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (isPrintableChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
 
		public long nextLong() {
			if (!hasNext()) throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (b < '0' || '9' < b) {
				throw new NumberFormatException();
			}
			while (true) {
				if ('0' <= b && b <= '9') {
					n *= 10;
					n += b - '0';
				} else if (b == -1 || !isPrintableChar(b)) {
					return minus ? -n : n;
				} else {
					throw new NumberFormatException();
				}
				b = readByte();
			}
		}
	}




Compiler output:
Main.java:43: error: modifier static not allowed here
	static class FastScanner {
	       ^
1 error
Language: C++

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

int main(){
    ll n;
    cin>>n;
    vector<ll> x(n),sortx(n);
    rep(i,n) cin>>x[i];
    sortx=x;
    sort(all(sortx));
    rep(i,n){
        if(x[i]<=sortx[(n-1)/2]) cout<<sort[n/2]<<endl;
        else cout<<sort[(n-1)/2]<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:44: error: invalid types '<unresolved overloaded function type>[ll {aka long long int}]' for array subscript
   17 |         if(x[i]<=sortx[(n-1)/2]) cout<<sort[n/2]<<endl;
      |                                            ^
a.cc:18:24: error: invalid types '<unresolved overloaded function type>[ll {aka long long int}]' for array subscript
   18 |         else cout<<sort[(n-1)/2]<<endl;
      |                        ^
Language: C++

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func main() {
	sc.Split(bufio.ScanWords)
	N := getInt()
	x := make([]int, N)
	y := make([]int, N)
	for i := 0; i < N; i++ {
		x[i] = getInt()
		y[i] = x[i]
	}
	sort.Ints(x)

	for i := 0; i < N; i++ {
		if y[i] < x[N/2] {
			out(x[N/2])
		} else {
			out(x[N/2-1])
		}
	}
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
a.cc:11:26: error: expected unqualified-id before ')' token
   11 | func out(x ...interface{}) {
      |                          ^
a.cc:15:1: error: 'var' does not name a type
   15 | var sc = bufio.NewScanner(os.Stdin)
      | ^~~
a.cc:26:1: error: 'func' does not name a type
   26 | func getString() string {
      | ^~~~
a.cc:32:1: error: 'func' does not name a type
   32 | func max(a, b int) int {
      | ^~~~
a.cc:39:1: error: 'func' does not name a type
   39 | func min(a, b int) int {
      | ^~~~
a.cc:46:1: error: 'func' does not name a type
   46 | func asub(a, b int) int {
      | ^~~~
a.cc:53:1: error: 'func' does not name a type
   53 | func abs(a int) int {
      | ^~~~
a.cc:60:1: error: 'func' does not name a type
   60 | func main() {
      | ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <functional>
#include <climits>
#include <cstring>

using namespace std;

#define int long long
#define rep(i, n) for (int i=0;i<(int)n;++i)
#define rep1(i, n) for (int i=1;i<=(int)n;++i)
#define unless(a) if(!(a))
#define all(a) begin(a),end(a)
#define fst first
#define scd second
#define PB emplace_back
#define PPB pop_back

using vi=vector<int>;
using pii=pair<int, int>;

bool chmin(int&a,int b){return a>b?(a=b,true):false;}
bool chmax(int&a,int b){return a<b?(a=b,true):false;}
int read(){int a;scanf("%lld",&a);return a;}

int dy[] = {-1, 1, 0, 0};
int dx[] = {0, 0, -1, 1};

int N;

signed main()
{
	cin >> N;
	vi x(N), a;
	rep(i, N) cin >> x[i];
	a=x;
	sort(all(a));
	int med = a[N / 2 - 1];
	rep(i, N) {
		if (x[i] <= med) {
			cout << a[N / 2];
		} else {
			cout << a[N / 2 - ];
		}
		cout << '\n';
	}
}



Compiler output:
a.cc: In function 'int main()':
a.cc:50:43: error: expected primary-expression before ']' token
   50 |                         cout << a[N / 2 - ];
      |                                           ^
Language: Java

import java.util.*;
public class Main {

  public static void main(String[] args) { 
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int[] nums = new int[n];
      for(int i = 0; i < n; i++)
        nums[i] = sc.nextInt();
      int[] sortedSort = new int[n];
      Arrays.clone(nums, sortedSort);
      int midNum = sortedSort[n/2];
      int nextMid = sortedSort[n/2-1];
      for(int num : nums) {
        int res = 0;
        if(num < midNum) res = midNum;
        else if(num > midNum) res = nextMid;
        else {
          if(midNum == nextMid) res = midNum;
          else res = nextMid;
        }
        System.out.println(res);
      }
  }
}

Compiler output:
Main.java:11: error: method clone in class Object cannot be applied to given types;
      Arrays.clone(nums, sortedSort);
            ^
  required: no arguments
  found:    int[],int[]
  reason: actual and formal argument lists differ in length
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using in6 = int64_t;
using ind = double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  int n;
  cin >> n;
  vi data(n);
  rep(i,n) cin >> data[i];
  vi so(n);
  rep(i,n) so[i] = data[i];
  sort(so.begin(), so.end());
  int ans1 = so[n/2 - 1];
  int ans2 = so[n/2];
  rep(i,n) {
    if(data[i]  <= ans1) cout << ans2 << endl;
    else cout << ans1 << ednl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:26: error: 'ednl' was not declared in this scope
   21 |     else cout << ans1 << ednl;
      |                          ^~~~
Language: C++

#include <cstdio>
#include <algorithm>
#ifdef ONLINE_JUDGE
#define freopen(a, b, c)
#endif

typedef long long int ll;

namespace IPT {
  const int L = 1000000;
  char buf[L], *front=buf, *end=buf;
  char GetChar() {
    if (front == end) {
      end = buf + fread(front = buf, 1, L, stdin);
      if (front == end) return -1;
    }
    return *(front++);
  }
}

template <typename T>
inline void qr(T &x) {
  char ch = IPT::GetChar(), lst = ' ';
  while ((ch > '9') || (ch < '0')) lst = ch, ch=IPT::GetChar();
  while ((ch >= '0') && (ch <= '9')) x = (x << 1) + (x << 3) + (ch ^ 48), ch = IPT::GetChar();
  if (lst == '-') x = -x;
}

namespace OPT {
  char buf[120];
}

template <typename T>
inline void qw(T x, const char aft, const bool pt) {
  if (x < 0) {x = -x, putchar('-');}
  int top=0;
  do {OPT::buf[++top] = static_cast<char>(x % 10 + '0');} while (x /= 10);
  while (top) putchar(OPT::buf[top--]);
  if (pt) putchar(aft);
}

const int maxn = 2000005;

int n, x, y;
int MU[maxn], CU[maxn];

int main() {
  freopen("1.in", "r", stdin);
  qr(n);
  for (int i = 1; i <= n; ++i) {
    qr(MU[i]);
  }
  memcpy(CU + 1, MU + 1, n * sizeof(int));
  std::sort(MU + 1, MU + 1 + n);
  x = MU[n >> 1]; y = MU[(n >> 1) + 1];
  for (int i = 1; i <= n; ++i) {
    qw((CU[i] <= x) ? y : x, '\n', true);
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:3: error: 'memcpy' was not declared in this scope
   53 |   memcpy(CU + 1, MU + 1, n * sizeof(int));
      |   ^~~~~~
a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | #ifdef ONLINE_JUDGE
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long N;
long long ans[222222];
int main(){
    cin>>N;
    vector<pair<int,int> > latte;
    for(i=0;i<N;i++){
        int a;cin>>a;
        latte.pb(make_pair(a,i));
    }
    sort(latte.begin(),latte.end());
    for(int i=0;i<latte.size();i++){
        if(i<N/2){
            ans[latte[i].second]=latte[N/2].first;
        }
        else{
            ans[latte[i].second]=latte[N/2-1].first;
        }
    }
    for(int i=0;i<N;i++)cout<<ans[i]<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'i' was not declared in this scope
    8 |     for(i=0;i<N;i++){
      |         ^
a.cc:10:15: error: 'class std::vector<std::pair<int, int> >' has no member named 'pb'
   10 |         latte.pb(make_pair(a,i));
      |               ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long N;
long long ans[222222];
int main(){
    cin>>N;
    vector<pair<int,int> > latte;
    for(i=0;i<N;i++){
        int a;cin>>a;
        latte.push_back(make_pair(a,i));
    }
    sort(latte.begin(),latte.end());
    for(int i=0;i<latte.size();i++){
        if(i<N/2){
            ans[latte[i].second]=latte[N/2].first;
        }
        else{
            ans[latte[i].second]=latte[N/2-1].first;
        }
    }
    for(i=0;i<N;i++)cout<<ans[i]<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'i' was not declared in this scope
    8 |     for(i=0;i<N;i++){
      |         ^
a.cc:21:9: error: 'i' was not declared in this scope
   21 |     for(i=0;i<N;i++)cout<<ans[i]<<endl;
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long N;
long long ans[222222];
int main(){
    cin>>N;
    vector<pair<int,int> > latte;
    for(i=0;i<N;i++){
        int a;cin>>a;
        latte.pb(make_pair(a,i));
    }
    sort(latte.begin(),latte.end());
    for(int i=0;i<latte.size();i++){
        if(i<N/2){
            ans[latte[i].second]=latte[N/2].first;
        }
        else{
            ans[latte[i].second]=latte[N/2-1].first;
        }
    }
    for(i=0;i<N;i++)cout<<ans[i]<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'i' was not declared in this scope
    8 |     for(i=0;i<N;i++){
      |         ^
a.cc:10:15: error: 'class std::vector<std::pair<int, int> >' has no member named 'pb'
   10 |         latte.pb(make_pair(a,i));
      |               ^~
a.cc:21:9: error: 'i' was not declared in this scope
   21 |     for(i=0;i<N;i++)cout<<ans[i]<<endl;
      |         ^
Language: C++

#include <stdio.h>
static int n;
void middle(int a[n]){
    int i,j,k,x,y,z,p,q,r,flag,flag1,temp;
    x=y=z=flag1=0;
    int b[n-1];
    for(i=0;i<n;i++){
        for(j=0;j<i;j++){
            b[j]=a[j];
        }
        for(j=i+1;j<n;j++){
            b[j-1]=a[j];
        }
        for(x=0;x<n-1;x++){
            for(y=0;y<n-2;y++){
                if(b[y]>b[y+1]){
                    temp=b[y];
                    b[y]=b[y+1];
                    b[y+1]=temp;
                }
            }
        }
        if((n-1)%2==0){
            printf("%d\n",(b[(n-1)/2-1]+b[(n-1)/2])/2);
        }else{
            printf("%d\n",b[(n-2)/2]);
        }
    }
}
int main()
{
    int i,j,k,m,temp,flag;
    scanf("%d",&n);
    int a[n];
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    middle(a);
    return 0;
}


Compiler output:
a.cc:3:19: error: size of array 'a' is not an integral constant-expression
    3 | void middle(int a[n]){
      |                   ^
Language: C++

#include <stdio.h>
int n;
void middle(int a[n]){
    int i,j,k,x,y,z,p,q,r,flag,flag1,temp;
    x=y=z=flag1=0;
    int b[n-1];
    for(i=0;i<n;i++){
        for(j=0;j<i;j++){
            b[j]=a[j];
        }
        for(j=i+1;j<n;j++){
            b[j-1]=a[j];
        }
        for(x=0;x<n-1;x++){
            for(y=0;y<n-2;y++){
                if(b[y]>b[y+1]){
                    temp=b[y];
                    b[y]=b[y+1];
                    b[y+1]=temp;
                }
            }
        }
        if((n-1)%2==0){
            printf("%d\n",(b[(n-1)/2-1]+b[(n-1)/2])/2);
        }else{
            printf("%d\n",b[(n-2)/2]);
        }
    }
}
int main()
{
    int i,j,k,m,temp,flag;
    scanf("%d",&n);
    int a[n];
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    middle(a);
    return 0;
}


Compiler output:
a.cc:3:19: error: size of array 'a' is not an integral constant-expression
    3 | void middle(int a[n]){
      |                   ^
Language: C++

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

int main() {
    int n;
    cin >> n;
    vector<int> data(n);
    for (int i = 0; i < n; i++){
        cin >> data.at(i);
    }

    vector<int> temp = data;
    sort(temp);
    int BLeft = temp.at(n / 2 - 1);
    int BRight = temp.at(n / 2);

    for (int i = 0; i < n; i++){
        if (data.at(i) <= Bleft){
            cout << BRight << endl;
        }
        else{
            cout << BLeft << endl;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: no matching function for call to 'sort(std::vector<int>&)'
   13 |     sort(temp);
      |     ~~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 1 provided
a.cc:18:27: error: 'Bleft' was not declared in this scope; did you mean 'BLeft'?
   18 |         if (data.at(i) <= Bleft){
      |                           ^~~~~
      |                           BLeft
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#include<queue>
#define ll long long
#define itn int
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
using namespace std;

int main(){
  int N;
  cin>>N;
  ll X[N+1],P;
  for(int i=1; i<=N; ++i){
    cin>>X[i];
  }
  P=X[N/2];
  Q=X[N/2+1];
  RREP(i,N){
    if(X[i]<=P) cout<<Q<<endl;
    else cout<<P<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:3: error: 'Q' was not declared in this scope
   29 |   Q=X[N/2+1];
      |   ^
Language: C++

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

const int MAX = 2e5 + 10;
ll a[MAX],b[MAX],ans[MAX];

bool cmp(ll l,ll r){
    return a[l] <= a[r];
}

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


Compiler output:
a.cc:5:1: error: 'll' does not name a type
    5 | ll a[MAX],b[MAX],ans[MAX];
      | ^~
a.cc:7:10: error: 'll' was not declared in this scope
    7 | bool cmp(ll l,ll r){
      |          ^~
a.cc:7:15: error: 'll' was not declared in this scope
    7 | bool cmp(ll l,ll r){
      |               ^~
a.cc:7:19: error: expression list treated as compound expression in initializer [-fpermissive]
    7 | bool cmp(ll l,ll r){
      |                   ^
a.cc: In function 'int main()':
a.cc:14:32: error: 'a' was not declared in this scope
   14 |     for(int i=0;i<n;i++) {cin>>a[i]; b[i]=i;}
      |                                ^
a.cc:14:38: error: 'b' was not declared in this scope
   14 |     for(int i=0;i<n;i++) {cin>>a[i]; b[i]=i;}
      |                                      ^
a.cc:16:10: error: 'b' was not declared in this scope
   16 |     sort(b,b+n,cmp);
      |          ^
a.cc:17:5: error: 'll' was not declared in this scope
   17 |     ll med = n/2 - 1;
      |     ^~
a.cc:20:17: error: 'med' was not declared in this scope
   20 |         if(i <= med) {
      |                 ^~~
a.cc:21:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |             ans[b[i]] = a[b[med+1]];
      |             ^~~
      |             abs
a.cc:21:25: error: 'a' was not declared in this scope
   21 |             ans[b[i]] = a[b[med+1]];
      |                         ^
a.cc:23:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |         else ans[b[i]] = a[b[med]];
      |              ^~~
      |              abs
a.cc:23:26: error: 'a' was not declared in this scope
   23 |         else ans[b[i]] = a[b[med]];
      |                          ^
a.cc:26:32: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |     for(int i=0;i<n;i++) cout<<ans[i]<<endl;
      |                                ^~~
      |                                abs
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
using namespace std;
typedef long long ll;

int main(){
    
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin >> n;
    
    vector<int> x(n),sorted_x(n);
    rep(i,n) cin >> x[i];
    
    rep(i,n){
      mp[sorted_x[i]] = sorted_x[(n-i+1)/2];
    }
    
    for(int i = 0; i < n; i++){
        cout << mp[x[i]] << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:7: error: 'mp' was not declared in this scope
   18 |       mp[sorted_x[i]] = sorted_x[(n-i+1)/2];
      |       ^~
a.cc:22:17: error: 'mp' was not declared in this scope
   22 |         cout << mp[x[i]] << endl;
      |                 ^~
Language: C++

#inlude<iostream>
#inlucde<algorithm>

using namespace std;

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

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlude; did you mean #include?
    1 | #inlude<iostream>
      |  ^~~~~~
      |  include
a.cc:2:2: error: invalid preprocessing directive #inlucde; did you mean #include?
    2 | #inlucde<algorithm>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:11: error: 'cin' was not declared in this scope
    7 |     int N;cin>>N;
      |           ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inlude<iostream>
a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |     sort(a,a+N);
      |     ^~~~
      |     short
a.cc:15:20: error: 'cout' was not declared in this scope
   15 |         if(b[i]>m) cout << a[(N/2)-1] << endl;
      |                    ^~~~
a.cc:15:20: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:42: error: 'endl' was not declared in this scope
   15 |         if(b[i]>m) cout << a[(N/2)-1] << endl;
      |                                          ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inlude<iostream>
a.cc:16:20: error: 'cout' was not declared in this scope
   16 |         if(b[i]<m) cout << a[(N/2)] << endl;
      |                    ^~~~
a.cc:16:20: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:40: error: 'endl' was not declared in this scope
   16 |         if(b[i]<m) cout << a[(N/2)] << endl;
      |                                        ^~~~
a.cc:16:40: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include<iostream>
#include<algorithm>

using namespace std;

int main()
{
	int n;
	cin >> n;
	int x[200003];
	for (int i = 0; i < n; i++) cin >> x[i];
	int c[200003];
	for (int i = 0; i < 200003; i++)c[i] = 0;
	for (int i = 0; i < n; i++)c[i] = x[i];

	sort(x, x + n);
	
	for (int i = 0; i < n; i++) {
		if (c[i] <= x[n / 2 - 1])cout << x[n / 2] << endl;
		if (c[i] => x[n / 2])cout << x[n / 2 - 1] << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:27: error: expected primary-expression before '>' token
   20 |                 if (c[i] => x[n / 2])cout << x[n / 2 - 1] << endl;
      |                           ^
Language: C++

#include<iostream>
#include<algorithm>

using namespace std;

int main()
{
	int n;
	cin >> n;
	int x[200001];
	for (int i = 0; i < n; i++) cin >> x[i];
	int c[200001];
	for (int i = 0; i < 200001; i++)c[i] = 0;
	for (int i = 0; i < n; i++)c[i] = x[i];

	sort(x, x + n);
	
	for (int i = 0; i < n; i++) {
		if (c[i] <= x[n / 2 - 1])cout << x[n / 2] << endl;
		if (c[i] => x[n / 2])cout << x[n / 2 - 1] << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:27: error: expected primary-expression before '>' token
   20 |                 if (c[i] => x[n / 2])cout << x[n / 2 - 1] << endl;
      |                           ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
typedef long long ll;

int main(){
  int n;
  cin >> n;
  vector<int> x(n);
  rep(i,n) cin >> x[i];
  vector<int> r(n);
  r(n)=x(n)
  for(int i=0;i<n;i++){
    x(n)=r(n);
    sort(x.begin(),x.end());
    if(x[i]<=x[n/2]) cout << x[(n/2)+1] << endl;
    else cout << x[n/2] << endl;
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:12:4: error: no match for call to '(std::vector<int>) (int&)'
   12 |   r(n)=x(n)
      |   ~^~~
a.cc:12:9: error: no match for call to '(std::vector<int>) (int&)'
   12 |   r(n)=x(n)
      |        ~^~~
a.cc:13:15: error: 'i' was not declared in this scope
   13 |   for(int i=0;i<n;i++){
      |               ^
Language: C++

#include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <numeric>
#include <sstream>
#include <string>
#include <string.h>
#include <vector>

#define REP(i,x) for(int i{ 0 }; i < (int)(x); i++)
#define REPC(i,x) for(int i{ 0 }; i <= (int)(x); i++)
#define RREP(i,x) for(int i{ (int)(x) - 1 }; i >= 0 ;i--)
#define RREPC(i,x) for(int i{ (int)(x)}; i >= 0; i--)
#define REP1O(i,x) for(int i{ 1 }; i < (int)(x); i++)
#define REP1C(i,x) for(int i{ 1 }; i <= (int)(x); i++)

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()

typedef int64_t ll;

const int dx[4] = { 1, 0, -1,  0 };
const int dy[4] = { 0, 1,  0, -1 };
const int INTMAX = 2147483647;
const ll LLMAX = 9223372036854775807;

template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
void SWAP(ll& a, ll& b) { a ^= b; b ^= a; a ^= b; }
void SWAP(int& a, int& b) { a ^= b; b ^= a; a ^= b; }

using namespace std;


class C {
	int n;
	vector<int> x;
public:
	C()
	{
		cin >> n;
		x.resize(n);
		REP(i, n)
			cin >> x[i];
	}

	void solve()
	{

		REP(i, n / 2)
			cout << x[i / 2] << endl;
		REP(i, n / 2)
			cout << x[i / 2 - 1] << endl;

	}
};


int main()
{
	D solution;
	solution.solve();

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:66:9: error: 'D' was not declared in this scope
   66 |         D solution;
      |         ^
a.cc:67:9: error: 'solution' was not declared in this scope
   67 |         solution.solve();
      |         ^~~~~~~~
Language: C++

from math import ceil
N = int(input())

x = list(map(int,input().split()))
x_sort = sorted(x)
length = len(x)
median = (x_sort[ceil(length/2-1)]+x_sort[ceil(length/2)])/2

for i in range(length):
    if x[i] <= median:
        print(x_sort[ceil(length/2)])
    else:
        print(x_sort[ceil(length/2-1)])


Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from math import ceil
      | ^~~~
Language: C++

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <cassert>
#include <functional>
#include <string>
#include <sstream>
#include <cctype>
#include <queue>
#include <stack>
#include <map>
#include <iomanip>
using namespace std;
typedef long long ll;
#define rep(i, j, n) for (int i = j; i < n; i++)
#define out(ans) cout << ans << endl;

/////////////////////////////////////////////////////////

void Main(){
  int N; cin >> N;
  vector<int> X(N);
  rep(i, 0, N) cin >> X[i];
  vector<int> Y = X;
  sort(Y.begin(), Y.end());
  int mid1 = Y[N / 2 - 1], mid2 = Y[N / 2];
  rep(i, 0, N){
    if(X[i] <= mid1) out(mid2);
    else out(mid1);
  }
}

/////////////////////////////////////////////////////////

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  //cout << std::fixed << std::setprecision(15);

  Main();
}


Compiler output:
a.cc: In function 'void Main()':
a.cc:32:5: error: 'else' without a previous 'if'
   32 |     else out(mid1);
      |     ^~~~
Language: C++

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

#define int long long

signed main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int N;
    vector<pair<int, int>> x(N);
    for (int i = 0; i < N; i++) {
        int A;
        cin >> A;
        x.push_back(i + 1, A);
    }
    sort(x.begin(), x.end(), [](auto a, auto b){return a.second < b.second;});
    for (int i = 0; i < N / 2; i++) {
        if (x[i].first <= N / 2) cout << x[N / 2 + 1].second<< endl;
        else cout << x[N / 2].second << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: no matching function for call to 'std::vector<std::pair<long long int, long long int> >::push_back(long long int, long long int&)'
   13 |         x.push_back(i + 1, A);
      |         ~~~~~~~~~~~^~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; value_type = std::pair<long long int, long long int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<long long int, long long int>; _Alloc = std::allocator<std::pair<long long int, long long int> >; value_type = std::pair<long long int, long long int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 2 provided