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

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

long long n;
Prime pri;

long long solve();

int main() {
  cin >> n;
  cout << solve() << endl;
  return 0;
}

long long solve() {
  long long res = 0, N = n;
  for (long long i = 2; i * i <= N; ++i)
    if (N % i == 0) {
      long long now = 0;
      while (N % i == 0) {
        ++now;
        N /= i;
      }
      long long cnt = 1;
      while (cnt <= now) {
        ++res;
        now -= cnt;
        ++cnt;
      }
    }
  if (N != 1) ++res;
  return res;
}

Compiler output:
a.cc:5:1: error: 'Prime' does not name a type
    5 | Prime pri;
      | ^~~~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	long long int N,A[200200],B[200200];
  	cin>>N;
  	for(long long int i=0;i<N;i++){
     	cin>>A[i]>>B[i]; 
    }
  	sort(A,A+N);
    sort(B,B+N);
    if(N%2==1){
    	cout<<B[i/2]-A[i/2]+1<<endl; 
    }else{
        cout<<(B[i/2]+B[i/2-1])- (A[i/2]+A[i/2-1])+1<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'i' was not declared in this scope
   13 |         cout<<B[i/2]-A[i/2]+1<<endl;
      |                 ^
a.cc:15:18: error: 'i' was not declared in this scope
   15 |         cout<<(B[i/2]+B[i/2-1])- (A[i/2]+A[i/2-1])+1<<endl;
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int64_t MOD=1000000007;
const long long INF = 1LL<<60;

int main() {
  int64_t N; cin>>N;
  vector<int64_t> A(N),B(N);
  rep(i,N) cin>>A[i]>>B[i];
  sort(A.begin(),A.end());
  sort(B.begin(),B.end());
  if(N%2==1){
    cout<<B[(N+1)/2-1]-A[(N+1)/2-1]+1;
  }
  else{
    cout<<(B[N/2-1]+B[N/2])-(A[N/2-1]+A[N/2])+1;
  } 


Compiler output:
a.cc: In function 'int main()':
a.cc:18:4: error: expected '}' at end of input
   18 |   }
      |    ^
a.cc:7:12: note: to match this '{'
    7 | int main() {
      |            ^
Language: C++

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

int main()
{
  int n; cin >> n;
  bool flag = false;
  if (n%2)
  {
    flag = true;
  }
  
  vector<long long> a(n), b(n);
  for (int i = 0; i < n; i++)
  {
    cin >> a[i] >> b[i];
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  if (flag)
  {
    long long a_mean = a[n/2];
    long long b_mean = b[n/2];
    cout <<(long long) (b_mean - a_mean + 1) << endl;
  }
  else
  {
    long double a_mean = (a[n/2]+a[n/2-1])/2.0;
    long double b_mean = (b[n/2]+b[n/2-1])/2.0;
    cout <<(long long ) (2 * (b_mean - a_mean) + 1) << endl;
  }
  
  
  
  
}

Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main()
{
  int n; cin >> n;
  bool flag = false;
  if (n%2)
  {
    flag = true;
  }
  
  vector<long long> a(n), b(n);
  for (int i = 0; i < n; i++)
  {
    cin >> a[i] >> b[i];
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  if (flag)
  {
    long a_mean = a[n/2];
    long b_mean = b[n/2];
    cout << b_mean - a_mean + 1 << endl;
  }
  else
  {
    long double a_mean = (a[n/2]+a[n/2-1])/2.0;
    long double b_mean = (b[n/2]+b[n/2-1])/2.0;
    cout << 2 * (b_mean - a_mean) + 1 << endl;
  }
  
  
  
  
}

Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

//取りうる値の最大値と最小値を考える         



Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

#define REP(i, n) for(int i = 0;i < (int)(n);i++)

double median(int N, vector<double> x) {
  if (N % 2 == 0) {
    return (x[N / 2 - 1] + x[N / 2]) / 2;
  } else {
    return x[(N - 1) / 2];
  }
}

int main() {
  int N;
  cin >> N;
  vector<double> a(N), b(N);
  REP(i, N) {
    cin >> a[i] >> b[i];
  }
  sort(ALL(a));
  sort(ALL(b));
  if (N % 2 == 0) {
    cout << (median(N, b) - median(N, a)) * 2 + 1 << endl;
  } else {
    cout << median(N, b) - median(N, a) + 1 << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:8: error: 'ALL' was not declared in this scope
   21 |   sort(ALL(a));
      |        ^~~
Language: C++

#include<bits/stdc++.h>
#define ll long long int 
using namespace std;
int main()
{
  ll n;
  cin>>n;
  ll a[n],b[n];
  for(ll i=0;i<n;i++)
  {
    cin>>a[i]>>b[i];
  }
  sort(a,a+n);
  sort(b,b+n);
  if(n%2==0)
  {
    cout<<(1LL)((b[n/2-1]+b[n/2])-(a[n/2-1]-a[n/2])+1)<<endl;
  }
  else
  {
    cout<<(1LL)(b[n/2]-a[n/2]+1)<<endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:16: error: expression cannot be used as a function
   17 |     cout<<(1LL)((b[n/2-1]+b[n/2])-(a[n/2-1]-a[n/2])+1)<<endl;
      |           ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:21:16: error: expression cannot be used as a function
   21 |     cout<<(1LL)(b[n/2]-a[n/2]+1)<<endl;
      |           ~~~~~^~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#define ll long long int 
using namespace std;
int main()
{
  ll n;
  cin>>n;
  ll a[n],b[n];
  for(ll i=0;i<n;i++)
  {
    cin>>a[i]>>b[i];
  }
  sort(a,a+n);
  sort(b,b+n);
  if(n%2==0)
  {
    cout<<(LL)((b[n/2-1]+b[n/2])-(a[n/2-1]-a[n/2])+1)<<endl;
  }
  else
  {
    cout<<(LL)(b[n/2]-a[n/2]+1)<<endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: 'LL' was not declared in this scope; did you mean 'll'?
   17 |     cout<<(LL)((b[n/2-1]+b[n/2])-(a[n/2-1]-a[n/2])+1)<<endl;
      |            ^~
      |            ll
a.cc:21:12: error: 'LL' was not declared in this scope; did you mean 'll'?
   21 |     cout<<(LL)(b[n/2]-a[n/2]+1)<<endl;
      |            ^~
      |            ll
Language: C++

#include<bits/stdc++.h>
#define ll long long int 
using namespace std;
int main()
{
  ll n;
  cin>>n;
  ll a[n],b[n];
  for(ll i=0;i<n;i++)
  {
    cin>>a[i]>>b[i];
  }
  sort(a,a+n);
  sort(b,b+n);
  if(n%2==0)
  {
    cout<<(b[n/2-1]+b[n/2])/2-(a[n/2-1]-a[n/2])/2+1<<endl
  }
  else
  {
    cout<<b[n/2]-a[n/2]+1<<endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:58: error: expected ';' before '}' token
   17 |     cout<<(b[n/2-1]+b[n/2])/2-(a[n/2-1]-a[n/2])/2+1<<endl
      |                                                          ^
      |                                                          ;
   18 |   }
      |   ~
Language: C++

#include<bits/stdc++.h>
#define ll long long int 
using namespace std;
int main()
{
  ll n;
  cin>>n;
  ll a[n],b[n];
  for(ll i=0;i<n;i++)
  {
    cin>>a[i]>>b[i];
  }
  sort(a,a+n);
  sort(b,b+n);
  if(n%2==0)
  {
    cout<<(b[n/2-]+b[n/2])/2-(a[n/2-1]-a[n/2])/2+1<<endl
  }
  else
  {
    cout<<b[n/2]-a[n/2]+1<<endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:18: error: expected primary-expression before ']' token
   17 |     cout<<(b[n/2-]+b[n/2])/2-(a[n/2-1]-a[n/2])/2+1<<endl
      |                  ^
Language: C++

#include<bits/stdc++.h>
#define ll long long int 
using namespace std;
int main()
{
  ll n;
  cin>>n;
  ll a[n],b[n];
  rep(i,0,n)
  {
    cin>>a[i]>>b[i];
  }
  sort(a,a+n);
  sort(b,b+n);
  if(n%2==0)
  {
    cout<<(b[n/2-]+b[n/2])/2-(a[n/2-1]-a[n/2])/2+1<<endl
  }
  else
  {
    cout<<b[n/2]-a[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 |   rep(i,0,n)
      |       ^
a.cc:9:3: error: 'rep' was not declared in this scope
    9 |   rep(i,0,n)
      |   ^~~
a.cc:17:18: error: expected primary-expression before ']' token
   17 |     cout<<(b[n/2-]+b[n/2])/2-(a[n/2-1]-a[n/2])/2+1<<endl
      |                  ^
Language: C++

// Winners don't quit and Quitters don't win
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define mod 998244353
#define MAX 100005
int main()
{

	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
    #endif

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

    ll n,x,y,i,limit1,limit2;
    vll a,b;
    cin>>n;
    for(i=0;i<n;++i){
    	cin>>x>>y;
    	a.pb(x);
    	b.pb(y);
    }
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    
    if(n%2){
        limit1 = a[n/2];
        limit2 = b[n/2];
        cout<<(limit2-limit1+1);
    }
    else{
    	x = n/2;
    	double p = (double)(a[x] + a[x-1]) / 2;
    	double q = (double)(b[x] + b[x-1]) / 2;
    	p = (double)(q - p) / 0.5;
    	cout<<ll(p) + 1;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:12: error: expected primary-expression before 'long'
    4 | #define ll long long int
      |            ^~~~
a.cc:47:15: note: in expansion of macro 'll'
   47 |         cout<<ll(p) + 1;
      |               ^~
Language: C++

N, S = map(int,input().split())
A = list(map(int,input().split()))
mod = 998244353
dp = [[0 for j in range(S + 1)] for i in range(N + 1)]
dp[0][0] = 1
for i in range(N) : 
    for j in range(S + 1) : 
        dp[i + 1][j] += 2 * dp[i][j]
        dp[i + 1][j] %= mod 
        if j + A[i] <= S : 
            dp[i + 1][j + A[i]] += dp[i][j]
            dp[i + 1][j + A[i]] %= mod
print(dp[N][S])

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N, S = map(int,input().split())
      | ^
Language: C++

#include <bits/stdc++.h>
typedef long long int ll;

using pair<ll, ll> = P;

using namespace std;

int main()
{

  int N;

  cin >> N;

  vector<ll> A(N);
  vector<ll> B(N);

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

    int a, b;
    cin >> a >> b;

    A[i]=a;
    B[i]=b;
  }

  sort(A.begin(), A.end());
  sort(B.begin(), B.end());


  ll kasu =0;

  if (N % 2 == 0)
  {
    kasu = 2*((B[N / 2 - 1] + B[N / 2])/2 - (A[N / 2 - 1] + A[N / 2])/2);
  }
  else
  {
    kasu = B[(N + 1) / 2 - 1] - A[(N + 1) / 2 - 1] + 1;
  }

  cout << kasu << endl;
  return 0;
}


Compiler output:
a.cc:4:7: error: expected nested-name-specifier before 'pair'
    4 | using pair<ll, ll> = P;
      |       ^~~~
Language: C++

#include <bits/stdc++.h>
typedef long long int ll;

using pair<ll, ll> = P;

using namespace std;

int main()
{

  int N;

  cin >> N;

  vector<ll> A(N);
  vector<ll> B(N);

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

    int a, b;
    cin >> a >> b;

    A[i].push_back(a);
    B[i].push_back(b);
  }

  sort(A.begin(), A.end());
  sort(B.begin(), B.end());


  ll kasu =0;

  if (N % 2 == 0)
  {
    kasu = 2*((B[N / 2 - 1] + B[N / 2])/2 - (A[N / 2 - 1] + A[N / 2])/2);
  }
  else
  {
    kasu = B[(N + 1) / 2 - 1] - A[(N + 1) / 2 - 1] + 1;
  }

  cout << kasu << endl;
  return 0;
}


Compiler output:
a.cc:4:7: error: expected nested-name-specifier before 'pair'
    4 | using pair<ll, ll> = P;
      |       ^~~~
a.cc: In function 'int main()':
a.cc:24:10: error: request for member 'push_back' in 'A.std::vector<long long int>::operator[](((std::vector<long long int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'}
   24 |     A[i].push_back(a);
      |          ^~~~~~~~~
a.cc:25:10: error: request for member 'push_back' in 'B.std::vector<long long int>::operator[](((std::vector<long long int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'}
   25 |     B[i].push_back(b);
      |          ^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
typedef long long int ll;

using pair<ll, ll> = P;

using namespace std;

int main()
{

  int N;

  cin >> N;

  vector<ll> A(N);
  vector<ll> B(N);

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

    int a, b;
    cin >> a >> b;

    A[i].push_back(a);
    B[i].push_back(b);
  }

  sort(A.begin(), A.end());
  sort(B.begin(), B.end());


  ll kasu =0;

  if (N % 2 == 0)
  {
    kasu = 2*((B[N / 2 - 1] + B[N / 2])/2 - (A[N / 2 - 1] + A[N / 2])/2);
  }
  else
  {
    kasu = B[(N + 1) / 2 - 1] - A[(N + 1) / 2 - 1] + 1;
  }

  cout << kasu << endl;
  return 0;


Compiler output:
a.cc:4:7: error: expected nested-name-specifier before 'pair'
    4 | using pair<ll, ll> = P;
      |       ^~~~
a.cc: In function 'int main()':
a.cc:24:10: error: request for member 'push_back' in 'A.std::vector<long long int>::operator[](((std::vector<long long int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'}
   24 |     A[i].push_back(a);
      |          ^~~~~~~~~
a.cc:25:10: error: request for member 'push_back' in 'B.std::vector<long long int>::operator[](((std::vector<long long int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'}
   25 |     B[i].push_back(b);
      |          ^~~~~~~~~
a.cc:44:12: error: expected '}' at end of input
   44 |   return 0;
      |            ^
a.cc:9:1: note: to match this '{'
    9 | {
      | ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <vector>
#include <map>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
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; }
 
int inf=1E9;
 
int main(){
    int N;
    cin>> N;
    vector<int> a(N), b(N);
 
    rep(i,N){
        cin >> a[i] >> b[i];
    }
 
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
 
    if(N%2==1){
        cout << b[(N-1)/2] - a[(N-1)/2] +1 << endl;
    }
    else{
        cout << ((b[N/2]+b[N/2-1]) - (a[N/2]+a[N/2-1])) + 1 << endl;
    }
        
    return 0;
}
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <vector>
#include <map>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
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; }

int inf=1E9;

int main(){
    int N;
    cin>> N;
    vector<int> a(N), b(N);

    rep(i,N){
        cin >> a[i] >> b[i];
    }

    sort(a.begin(),a.end());
    sort(b.begin(),b.end());

    if(N%2==1){
        cout << b[(N-1)/2] - a[(N-1)/2] +1 << endl;
    }
    else{
        cout << ((b[N/2]+b[N/2-1]) - (a[N/2]+a[N/2-1])) + 1 << endl;
    }
        
    return 0;
}

Compiler output:
a.cc:45:23: error: redefinition of 'template<class T> bool chmax(T&, const T&)'
   45 | template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
      |                       ^~~~~
a.cc:10:23: note: 'template<class T> bool chmax(T&, const T&)' previously declared here
   10 | template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
      |                       ^~~~~
a.cc:46:23: error: redefinition of 'template<class T> bool chmin(T&, const T&)'
   46 | template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
      |                       ^~~~~
a.cc:11:23: note: 'template<class T> bool chmin(T&, const T&)' previously declared here
   11 | template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
      |                       ^~~~~
a.cc:48:5: error: redefinition of 'int inf'
   48 | int inf=1E9;
      |     ^~~
a.cc:13:5: note: 'int inf' previously defined here
   13 | int inf=1E9;
      |     ^~~
a.cc:50:5: error: redefinition of 'int main()'
   50 | int main(){
      |     ^~~~
a.cc:15:5: note: 'int main()' previously defined here
   15 | int main(){
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll a[10101010],b[10101010];
main() {
    int n;
    cin >>n;
    for (int i = 0; i < n;i ++)
		cin >>a[i] >>b[i];
    sort(a,a + n);
    sort(b,b + n);
    if (n % 2 == 0) {
        cout <<ll(b[n / 2 - 1] + b[n / 2] - a[n / 2 - 1] - a[n / 2] + 1);
    }
	else {
        cout <<ll(b[n / 2] - a[n / 2] + 1);
    }
}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:2:12: error: expected primary-expression before 'long'
    2 | #define ll long long
      |            ^~~~
a.cc:13:16: note: in expansion of macro 'll'
   13 |         cout <<ll(b[n / 2 - 1] + b[n / 2] - a[n / 2 - 1] - a[n / 2] + 1);
      |                ^~
a.cc:2:12: error: expected primary-expression before 'long'
    2 | #define ll long long
      |            ^~~~
a.cc:16:16: note: in expansion of macro 'll'
   16 |         cout <<ll(b[n / 2] - a[n / 2] + 1);
      |                ^~
Language: C

#include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = 0; i <= (n); i++)
using namespace std;
typedef long long ll;
const int MOD = 1000000007;
const ll INF = 1LL<<60;
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; }
using Graph = vector<vector<int>>;

typedef pair<int, int> P;
typedef priority_queue<int, vector<int>, greater<int>> PQ;

int main(){
    int N; cin >> N;
    vector<int> A(N), B(N);
    rep(i,N) cin >> A[i] >> B[i];
    sort(A.begin(), A.end());
    sort(B.begin(), B.end());

    int ans;
    int min, max;
    if (N % 2 == 1){
        min = A[N/2];
        max = B[N/2];
    }
    else{
        min = A[N/2]*2;
        max = B[N/2]*2;
    }
    ans = max - min + 1;
    cout << ans << endl;
}

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

#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<queue>
#include <cmath>
#define rep(i,n) for (int i=0;i<n;i++)
//#include <bits/stdc++.h>
using namespace std;

int main(){
    int N;
    cin>>N;
    vector<long int> A(N),B(N);
    rep(i,N) cin>>A[i]>>B[i];
    long int ans=0;
    sort(A.begin(),A.end());
    sort(B.begin(),B.end());
    if (N%2==1)  ans=B[N/2]-A[N/2]+1;
    else{
        ans=(B[N/2]+B[N/2-1])-(A[N/2]+A[N/2-1])+1;
    }
    cout<<ans<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   17 |     sort(A.begin(),A.end());
      |     ^~~~
      |     sqrt
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(k,i,n) for(ll i=k;i<n;++i)
int main(void){
    ll n;
    cin>>n;
    vector<ll>a(n),b(n);
    rep(0,i,n)cin>>a[i]>>b[i];
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    if(n%2==1){
        cout<<b[(n-1)/2]-a[(n-1)/2]+1;
    }else{
        cout<<b[(n-1)/2]+b[(n-1)/2+1])-(a[(n-1)/2]+a[n/2-1]))+1;
    }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:38: error: expected ';' before ')' token
   15 |         cout<<b[(n-1)/2]+b[(n-1)/2+1])-(a[(n-1)/2]+a[n/2-1]))+1;
      |                                      ^
      |                                      ;
Language: C++

#include<iostream>
#include<string>
#include <bits/stdc++.h>
#include<vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <math.h>
#include <iomanip>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'll' was not declared in this scope
   16 |   ll a[n+10],b[n+10];
      |   ^~
a.cc:18:12: error: 'a' was not declared in this scope
   18 |     cin >> a[i] >> b[i];
      |            ^
a.cc:18:20: error: 'b' was not declared in this scope
   18 |     cin >> a[i] >> b[i];
      |                    ^
a.cc:20:8: error: 'a' was not declared in this scope
   20 |   sort(a,a+n);
      |        ^
a.cc:21:8: error: 'b' was not declared in this scope
   21 |   sort(b,b+n);
      |        ^
Language: C++

#include <stdlib.h>
#define LL long long int 

/* 値を入れ替える関数 */
void swapLL (LL *x, LL *y) {
  LL temp;    // 値を一時保存する変数

  temp = *x;
  *x = *y;
  *y = temp;
}

/***
* pivotを決め、
* 全データをpivotを境目に振り分け、
* pivotの添え字を返す
***/
int partition (LL *array, int left, int right) {
  int i, j, pivot;
  i = left;
  j = right + 1;
  pivot = left;   // 先頭要素をpivotとする

  do {
    do { i++; } while (array[i] < array[pivot]);
    do { j--; } while (array[pivot] < array[j]);
    // pivotより小さいものを左へ、大きいものを右へ
    if (i < j) {
        swapLL(&array[i], &array[j]);
    }
  } while (i < j);

  swapLL(&array[pivot], &array[j]);   //pivotを更新

  return j;
}

/* クイックソート */
void quick_sort (LL *array, int left, int right) {
  int pivot;

  if (left < right) {
    pivot = partition(array, left, right);
    quick_sort(array, left, pivot-1);   // pivotを境に再帰的にクイックソート
    quick_sort(array, pivot+1, right);
  }
}


int main(void) {

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

    quick_sort(a, 0, n - 1);
    quick_sort(b, 0, n - 1);

    int ret;
    if (n % 2 == 1) {
        ret = b[(n - 1) / 2] - a[(n - 1) / 2] + 1;
    } else {
        ret = (b[n / 2 - 1] + b[n / 2]) - (a[n / 2 - 1] + a[n / 2]) + 1;
    }

    printf("%d", ret);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:5: error: 'scanf' was not declared in this scope
   53 |     scanf("%d", &n);
      |     ^~~~~
a.cc:70:5: error: 'printf' was not declared in this scope
   70 |     printf("%d", ret);
      |     ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    1 | #include <stdlib.h>
  +++ |+#include <cstdio>
    2 | #define LL long long int
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (LL i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for (LL i = m; i < n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define REVE(x) reverse(x.begin(), x.end())
#define all(x) (x).begin(), (x).end()

int main()
{
    long long N;
    vector<long long> a;
    vector<long long> b;
    cin >> N;
    REP(i, N){
        cin >> a[i] >> b[i];
    }
    SORT(A);
    SORT(B);
    if (N % 2 == 0) {
        long long mi = a[N/2-1] + a[N/2];
        long long ma = b[N/2-1] + b[N/2];
        cout << ma - mi + 1 << endl;
    } else {
        long long mi = a[N/2], ma = b[N/2];
        cout << ma - mi + 1 << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:24: error: 'LL' was not declared in this scope
    3 | #define REP(i, n) for (LL i = 0; i < (int)(n); i++)
      |                        ^~
a.cc:15:5: note: in expansion of macro 'REP'
   15 |     REP(i, N){
      |     ^~~
a.cc:15:9: error: 'i' was not declared in this scope
   15 |     REP(i, N){
      |         ^
a.cc:3:34: note: in definition of macro 'REP'
    3 | #define REP(i, n) for (LL i = 0; i < (int)(n); i++)
      |                                  ^
a.cc:18:10: error: 'A' was not declared in this scope
   18 |     SORT(A);
      |          ^
a.cc:5:22: note: in definition of macro 'SORT'
    5 | #define SORT(x) sort(x.begin(), x.end())
      |                      ^
a.cc:19:10: error: 'B' was not declared in this scope
   19 |     SORT(B);
      |          ^
a.cc:5:22: note: in definition of macro 'SORT'
    5 | #define SORT(x) sort(x.begin(), x.end())
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (LL i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for (LL i = m; i < n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define REVE(x) reverse(x.begin(), x.end())
#define all(x) (x).begin(), (x).end()

int main()
{
    long long N;
    vector<long long> a;
    vevtor<long long> b;
    cin >> N;
    REP(i, N){
        cin >> a[i] >> b[i];
    }
    SORT(A);
    SORT(B);
    if (N % 2 == 0) {
        long long mi = a[N/2-1] + a[N/2];
        long long ma = b[N/2-1] + b[N/2];
        cout << ma - mi + 1 << endl;
    } else {
        long long mi = a[N/2], ma = b[N/2];
        cout << ma - mi + 1 << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'vevtor' was not declared in this scope
   13 |     vevtor<long long> b;
      |     ^~~~~~
a.cc:13:12: error: expected primary-expression before 'long'
   13 |     vevtor<long long> b;
      |            ^~~~
a.cc:3:24: error: 'LL' was not declared in this scope
    3 | #define REP(i, n) for (LL i = 0; i < (int)(n); i++)
      |                        ^~
a.cc:15:5: note: in expansion of macro 'REP'
   15 |     REP(i, N){
      |     ^~~
a.cc:15:9: error: 'i' was not declared in this scope
   15 |     REP(i, N){
      |         ^
a.cc:3:34: note: in definition of macro 'REP'
    3 | #define REP(i, n) for (LL i = 0; i < (int)(n); i++)
      |                                  ^
a.cc:16:24: error: 'b' was not declared in this scope
   16 |         cin >> a[i] >> b[i];
      |                        ^
a.cc:18:10: error: 'A' was not declared in this scope
   18 |     SORT(A);
      |          ^
a.cc:5:22: note: in definition of macro 'SORT'
    5 | #define SORT(x) sort(x.begin(), x.end())
      |                      ^
a.cc:19:10: error: 'B' was not declared in this scope
   19 |     SORT(B);
      |          ^
a.cc:5:22: note: in definition of macro 'SORT'
    5 | #define SORT(x) sort(x.begin(), x.end())
      |                      ^
a.cc:22:24: error: 'b' was not declared in this scope
   22 |         long long ma = b[N/2-1] + b[N/2];
      |                        ^
a.cc:25:37: error: 'b' was not declared in this scope
   25 |         long long mi = a[N/2], ma = b[N/2];
      |                                     ^
Language: C++

#include <iostream>
#include <set>
#include <vector>


using namespace std;


int main() {
	int N;

	vector<int> va;
	vector<int> vb;

	cin >> N;
	for (int i = 0; i < N; i++)
	{
		int a, b;
		cin >> a >> b;

		va.push_back(a);
		vb.push_back(b);
		
	}


	if (N % 2 == 1) {//奇数

		sort(va.begin(), va.end());
		int min = va[(N + 1) / 2 -1];


		sort(vb.begin(), vb.end());
		int max = vb[(N + 1) / 2 -1];

		
		cout << max - min + 1;

	}
	else
	{

		sort(va.begin(), va.end());
		int min = va[(N) / 2 - 1];
		int min1 = va[(N) / 2];


		sort(vb.begin(), vb.end());
		int max = vb[(N + 1) / 2 - 1];
		int max1 = vb[(N + 1) / 2];

		set<float> se;
		for (int i = min; i <= max; i++)
		{
			for (int j = min1; j <= max1; j++)
			{
				float f = (i + j) / 2.0f;
				se.insert(f);
			}
		}

		cout << se.size();
	}

	cin >> N;

	return 0;

}

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

//                                               KEEP GRINDING
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 

using namespace std;
using namespace __gnu_pbds; 

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>   new_data_set;

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); 

#define int long long
#define ld long double
#define MOD 1000000007
#define mod 998244353
#define precise(i) fixed << setprecision(10) << i
#define f(i,a,b) for(int i=a;i<b;++i)

#define endl '\n'
#define debug cout<<endl;cout<<"\n========================================\n"<<endl;
#define err1(a) cout<<#a<<" "<<a<<endl;
#define err2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl;
#define err3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl;
#define err4(a,b,c,d) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<" "<<#d<<" "<<d<<endl;

#define all(a) a.begin(),a.end()
#define show(a) for(auto xyz:a)cout<<xyz<<" ";cout<<endl;
#define mx(a) *max_element(a)
#define mn(a) *min_element(a) 
#define LB lower_bound  //THIS GIVES THE ITR TO THE ELEMENT IN RANGE [SI,EI) THAT IS >= OUR VALUE 
#define UB upper_bound  //THIS GIVES THE ITR TO THE ELEMENT IN RANGE [SI,EI) THAT IS > OUR VALUE 

#define fr first
#define sc second

#define MAXN 200050
#define INF 9223372036854775807
signed main(){
    fastio
	int n;
	cin>>n;
	vector<pair<int,int>> a(n)
	f(i,0,n){
	    cin>>a1>>b1;
        a.push_back({a1,b1});
     }
	sort(all(a));
	int x,y;
	if(n%2){
		x=a[ n/2 ].fr;
		y=a[ n/2 ].sc;
	}else{
		x=a[ (n-1)/2 ].fr+ a[ (n-1)/2  + 1].fr;
		y=a[ (n-1)/2 ].sc+ a[ (n-1)/2  + 1].sc;
	}
	cout<<y-x+1;
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: expected ',' or ';' before 'for'
   18 | #define f(i,a,b) for(int i=a;i<b;++i)
      |                  ^~~
a.cc:44:9: note: in expansion of macro 'f'
   44 |         f(i,0,n){
      |         ^
a.cc:44:11: error: 'i' was not declared in this scope
   44 |         f(i,0,n){
      |           ^
a.cc:18:30: note: in definition of macro 'f'
   18 | #define f(i,a,b) for(int i=a;i<b;++i)
      |                              ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb pushback
#define fr(i,n) for(int i=0;i<n;i++)
#define fro(i,j,n) for(int i=j;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)


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


Compiler output:
a.cc: In function 'int main()':
a.cc:24:15: error: no matching function for call to 'max(ll, int)'
   24 |       ans+=max((b[n/2-1]-a[n/2])*2,0);
      |            ~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:24:15: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   24 |       ans+=max((b[n/2-1]-a[n/2])*2,0);
      |            ~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:24:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   24 |       ans+=max((b[n/2-1]-a[n/2])*2,0);
      |            ~~~^~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb pushback
#define fr(i,n) for(int i=0;i<n;i++)
#define fro(i,j,n) for(int i=j;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)


int main() {
    int n;
	cin >> n;
  	int a[n];
    int b[n];
    int ans=0;
    fr(i,n){
      cin >> a[i];
      cin >> b[i];
    }
    sort(a,a+n);
  	sort(b,b+n);
  	if(n%2==0){
      ans+=a[n]-a[n/2-1];
      ans+=max((b[n/2-1]-a[n/2])*2,0);
      ans+=b[n]-b[n/2-1];
      ans+=1
    }else{
      ans=b[n/2]-a[n/2];
    }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:13: error: expected ';' before '}' token
   26 |       ans+=1
      |             ^
      |             ;
   27 |     }else{
      |     ~
Language: C++

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

using ull = unsigned long long;
using ll = long long;

template<class T>           //自定义读入函数
inline void read(T &a) {
    register T x = 0, flag = 1;
    register char ch;
    while (!isdigit(ch = getchar())) if (ch == '-') flag = -1;
    while (x = x * 10 + (ch & 15), isdigit(ch = getchar()));
    a = x * flag;
}

template <class T>        //自定义写入函数
inline void write(T x) {
    if (x < 0)
        putchar('-'), x = -x;
    if(x >= 10) write(x / 10); 
    putchar(x % 10 + '0');
}

template<class T> inline bool Chkmax(T& x, const T& y) { return x < y ? x = y, true : false; }   //自定义比较函数
template<class T> inline bool Chkmin(T& x, const T& y) { return x > y ? x = y, true : false; }   //自定义比较函数

#define For(i, a, b) for (int i = (a); i <= (b); ++i)   //从小到大重复
#define Rep(i, a, b) for (int i = (a); i >= (b); --i)   //从大到小重复
#define For_edge(x) for (int i = head[x]; i; i = net[i])
#define mem0(a) memset(a, 0, sizeof a)                  //内存复制

int main()
{
	priority_queue<int> minMin, minMax;
	priority_queue<int, vector<int>, greater<int> > maxMin, maxMax;
	int N;
	scanf("%d", &N);
	
	for(int i = 0; i < N; i++)
	{
		int min, max;
		scanf("%d %d", &min, &max);
		if(minMin.size() > maxMin.size())
			maxMin.push(min);
		else
			minMin.push(min);
		if(minMax.size() > maxMax.size())
			maxMax.push(max);
		else
			minMax.push(max);
	}
	int result = 0;
	if(N == 1)
		result = minMax.top() - minMin.top() + 1;
	else if(N == 0)
		result = 0		
	else if(N & 1)
	{
		int myMin = min(minMin.top(),maxMin.top()), myMax = min(minMax.top(),maxMax.top());
		result = (myMax - myMin + 1);
	}
	else
		result = (minMax.top() + maxMax.top()) - (minMin.top() + maxMin.top()) + 1;
	cout << result << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void read(T&)':
a.cc:10:16: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   10 |     register T x = 0, flag = 1;
      |                ^
a.cc:10:23: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   10 |     register T x = 0, flag = 1;
      |                       ^~~~
a.cc:11:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   11 |     register char ch;
      |                   ^~
a.cc: In function 'int main()':
a.cc:57:32: error: expected ';' before 'else'
   57 |                 result = 0
      |                           ^     
      |                                ;
   58 |         else if(N & 1)
      |         ~~~~
Language: C++

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

using ll = long long;
using p = pair<ll, ll>;
constexpr ll INF = 1LL << 62;

int main(void) {
  ll N;
  cin >> N;
  vector<ll> A, B;
  for (ll i = 0; i < N; i++) {
    ll a, b;
    cin >> a >> b;
    A.emplace_back(a);
    B.emplace_back(b);
  }

  A.sort();
  B.sort();

  if (N % 2) {
    ll amid = A[A.size() / 2];
    ll bmid = B[B.size() / 2];
    cout << bmid - amid + 1 << endl;
  } else {
    ll amid = A[A.size() / 2] + A[A.size() / 2 - 1];
    ll bmid = B[B.size() / 2] + B[B.size() / 2 - 1];
    cout << bmid - amid + 1 << endl;
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: 'class std::vector<long long int>' has no member named 'sort'
   19 |   A.sort();
      |     ^~~~
a.cc:20:5: error: 'class std::vector<long long int>' has no member named 'sort'
   20 |   B.sort();
      |     ^~~~
Language: C++

// review
#include <iostream>

using namespace std;
typedef long long ll;

const int MAXN = 2 * 1e5 + 10;

int n;
ll A[MAXN], B[MAXN];

void solve() {
  sort(A, A + n);
  sort(B, B + n);

  ll midA = n & 1 ? A[(n-1)/2] : A[n/2] + A[n/2 - 1];
  ll midB = n & 1 ? B[(n-1)/2] : B[n/2] + B[n/2 - 1];
  cout << midB - midA + 1 << endl;
}

int main() {
  cin >> n;
  for (int i=0;i<n;i++) {
    cin >> A[i] >> B[i];
  }
  solve();
}


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

#include <bits/stdc++.h>
typedef long long ll;
#define mod 1000000009
#define MK make_pair
#define EB emplace_back
#define PB push_back
#define F first
#define S second
using namespace std;
void solve()
{
	int n;
	cin>>n;
	vector<int> a(n),b(n);
	for(int i=0;i<n;i++) cin>>a[i]>>b[i];
	sort(all(a));
	sort(all(b));
	ll X, Y; 
    if (n % 2 == 1) {
        X = a[n/2];
        Y = b[n/2];
    } else {
        X = a[n/2 - 1] + a[n/2];
        Y = b[n/2 - 1] + b[n/2];
    }
 
    cout << Y-X+1 <<endl;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t=1;
	cin>>t;
	while(t--)
		solve();
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:16:14: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   16 |         sort(all(a));
      |              ^~~
      |              std::filesystem::perms::all
In file included from /usr/include/c++/14/filesystem:51,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200,
                 from a.cc:1:
/usr/include/c++/14/bits/fs_fwd.h:158:7: note: 'std::filesystem::perms::all' declared here
  158 |       all               =  0777,
      |       ^~~
Language: C++

#include<bits/stdc++.h>
int n,a[1<<18],b[1<<18],i;
int main(){
	std::cin>>n;
	for(i=0;i<n;i++)cin>>a[i]>>b[i];
	sort(a,a+n);sort(b,b+n);
	if(n%2)std::cout<<b[n/2]-a[n/2]+1;
	else std::cout<<(b[n/2-1]+b[n/2])-(a[n/2-1]+a[n/2])+1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:25: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |         for(i=0;i<n;i++)cin>>a[i]>>b[i];
      |                         ^~~
      |                         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
    6 |         sort(a,a+n);sort(b,b+n);
      |         ^~~~
      |         std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C++

//
//  main.cpp
//  ABC_169_E
//
//  Created by Joe Mori on 2020/06/02.
//  Copyright © 2020 Joe Mori. All rights reserved.
//

#include <iostream>
#include<vector>

int main(int argc, const char * argv[]) {
    long long N,count;
    std::cin>>N;
    std::vector<int>a(N),b(N);
    for(int i=0;i<N;i++){
        std::cin>>a[i]>>b[i];
    }
    std::sort(a.begin(),a.end());
    std::sort(b.begin(),b.end());
    if(N%2==0){
        count=2*(b[N/2-1]-a[N/2-1])+1;
    }else{
        count=1+(b[(N-1)/2]-a[(N-1)/2]);
    }
    std::cout<<count<<std::endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:19:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   19 |     std::sort(a.begin(),a.end());
      |          ^~~~
      |          qsort
a.cc:20:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   20 |     std::sort(b.begin(),b.end());
      |          ^~~~
      |          qsort
Language: C++

#ifdef _MSC_VER
#include "stdc++.h"
#endif
#ifdef __GNUC__
#include<bits/stdc++.h>
#endif
using namespace std;

using ll = long long;

//vector
using vi = vector<int>;
using vii = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;

//constant
const double EPS = 1e-10;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, s, e) for (ll i = s; i < e; i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(), (x).rend()

//debug
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define DEBUG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl;

// vector
//template<typename T> vector<vector<T>> vv(ll H, ll W, T v) { return vector<vector<T>> vec(H, vector<T>(W, v)); }

// view vector
template<typename T> void view(T e) { cout << e << endl; }
template<typename T> void view(const vector<T>& v) { for (const auto& e : v) { cout << e << " "; } cout << endl; }
template<typename T> void view(const vector<vector<T> >& vv) { for (const auto& v : vv) { view(v); } }

// DP
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; }




// ***************************************


int N;

ll med(vll A){
    if(N % 2 == 1){
        return A.at((N + 1) / 2 - 1);
    } else{
        return (A.at(N / 2) + A.at(N / 2 - 1)) / 2;
    }
}

int main(){
    cin >> N;

    vll A(N), B(N);
    REP(i, N){
        int a, b;
        cin >> a >> b;
        A[i] = a;
        B[i] = b;
    }
    sort(ALL(A));
    sort(ALL(B));

    auto a = med(A);
    auto b = med(B);

    if (N % 2 == 0){
        cout << (2 * (b - a) + 1 << endl;
    } else{
        cout << b - a + 1 << endl;
    }

    

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:74:34: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   74 |         cout << (2 * (b - a) + 1 << endl;
      |                  ~~~~~~~~~~~~~~~~^~~~~~~
a.cc:74:41: error: expected ')' before ';' token
   74 |         cout << (2 * (b - a) + 1 << endl;
      |                 ~                       ^
      |                                         )
Language: C++

#ifdef _MSC_VER
#include "stdc++.h"
#endif
#ifdef __GNUC__
#include<bits/stdc++.h>
#endif
using namespace std;

using ll = long long;

//vector
using vi = vector<int>;
using vii = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;

//constant
const double EPS = 1e-10;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, s, e) for (ll i = s; i < e; i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(), (x).rend()

//debug
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define DEBUG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl;

// vector
//template<typename T> vector<vector<T>> vv(ll H, ll W, T v) { return vector<vector<T>> vec(H, vector<T>(W, v)); }

// view vector
template<typename T> void view(T e) { cout << e << endl; }
template<typename T> void view(const vector<T>& v) { for (const auto& e : v) { cout << e << " "; } cout << endl; }
template<typename T> void view(const vector<vector<T> >& vv) { for (const auto& v : vv) { view(v); } }

// DP
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; }




// ***************************************


int N;

ll med(vll A){
    if(N % 2 == 1){
        return A.at((N + 1) / 2 - 1);
    } else{
        return (A.at(N / 2) + A.at(N / 2 - 1) / 2;
    }
}

int main(){
    cin >> N;

    vll A(N), B(N);
    REP(i, N){
        int a, b;
        cin >> a >> b;
        A[i] = a;
        B[i] = b;
    }
    sort(ALL(A));
    sort(ALL(B));

    auto a = med(A);
    auto b = med(B);

    if (N % 2 == 0){
        cout << (2 * (b - a) + 1 << endl;
    } else{
        cout << b - a + 1 << endl;
    }

    

    return 0;
}


Compiler output:
a.cc: In function 'll med(vll)':
a.cc:53:50: error: expected ')' before ';' token
   53 |         return (A.at(N / 2) + A.at(N / 2 - 1) / 2;
      |                ~                                 ^
      |                                                  )
a.cc: In function 'int main()':
a.cc:74:34: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   74 |         cout << (2 * (b - a) + 1 << endl;
      |                  ~~~~~~~~~~~~~~~~^~~~~~~
a.cc:74:41: error: expected ')' before ';' token
   74 |         cout << (2 * (b - a) + 1 << endl;
      |                 ~                       ^
      |                                         )
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define mod 1e9+7
#define decimalupto(no,y)     fixed<<setprecision(y)<<no

using namespace std;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
    ll n;
    cin>>n;
    vector<ll> a(n),b(n);
    for(ll i=0; i<n; ++i){
        cin>>a[i]>>b[i];
    }
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    __int64 ans;
    if(n%2==1){
        ans = b[n/2]-a[n/2]+1;
    }
    else {
        ans = b[n/2-1]+b[n/2]-a[n/2-1]+a[n/2]+1;
    }
    printf("%lld\n",ans);
}






Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
   21 |     __int64 ans;
      |     ^~~~~~~
      |     __ynf64
a.cc:23:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |         ans = b[n/2]-a[n/2]+1;
      |         ^~~
      |         abs
a.cc:26:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |         ans = b[n/2-1]+b[n/2]-a[n/2-1]+a[n/2]+1;
      |         ^~~
      |         abs
a.cc:28:21: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |     printf("%lld\n",ans);
      |                     ^~~
      |                     abs
Language: C++

#include <vector>
#include <iostream>
#include <conio.h>
#include <math.h>
#include <algorithm>
 
using namespace std;
#define int long long
#define all(x) x.begin(),x.end()
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define vi vector<int>
#define vstr vector<string>
#define vbool vector<bool>
#define vvi vector<vector<int> >
#define mii map<int,int>
#define pb push_back
#define pii pair<int,int>
#define vpair vector<pii > 
#define mkp make_pair
#define scan(a,n) for(int i =0 ; i<n ; i++) cin>>a[i]
#define print(a,n) for(int i = 0 ; i < n ; i++) {cout<<a[i]<<' ';}cout<<'\n'
#define mem(a,v) memset(a,v,sizeof(a))
#define loop(i,a,b) for (int i = a; i < b; i++)
#define loope(i,a,b) for (int i = a; i <= b; i++)
#define FastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define PRECISION std::cout.unsetf ( std::ios::fixed );std::cout.precision(9)
#define PI 3.14159265
#define S second
#define F first
#define CHECK cout<<"CHEDEDWB"<<endl
#define br '\n'
int mod = 1e9+7;
int inf = 1e18;
int m_inf = INT_MIN;


int32_t main()
{
	FastIO; PRECISION;
	int n;
	cin>>n;
	vi a(n),b(n);
	loop(i,0,n)
		cin>>a[i]>>b[i];
	sort(all(a));
	sort(all(b));
	int x,y;
	if(n%2==0)
	{
		x = a[n/2]+a[n/2-1];
		y = b[n/2]+b[n/2-1];
	}
	else
	{
		x = a[n/2];
		y = b[n/2];
	}
	cout<<y-x+1<<endl;
	return 0;
} 

Compiler output:
a.cc:3:10: fatal error: conio.h: No such file or directory
    3 | #include <conio.h>
      |          ^~~~~~~~~
compilation terminated.