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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  int cnt=0;
  for(int i=0;i<n-2;i++){
    if(a[i]>a[i+1] && a[i+1] > a[i+2]) cnt++;
    else if((a[i]<a[i+1] && a[i+1] < a[i+2]) cnt++;
  }
  
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:45: error: expected ';' before 'cnt'
   13 |     else if((a[i]<a[i+1] && a[i+1] < a[i+2]) cnt++;
      |                                             ^~~~
      |                                             ;
a.cc:14:3: error: expected primary-expression before '}' token
   14 |   }
      |   ^
a.cc:13:52: error: expected ')' before '}' token
   13 |     else if((a[i]<a[i+1] && a[i+1] < a[i+2]) cnt++;
      |            ~                                       ^
      |                                                    )
   14 |   }
      |   ~                                                 
a.cc:14:3: error: expected primary-expression before '}' token
   14 |   }
      |   ^
Language: C

#include<stdio.h>
int main(){
  int a;
  int b[21];
  int c = 0;
  int i;
  scanf("%d",&a);
  scanf("%d",&b);
  for(i = 1; i <= 20){
    if((b[i-1]<b[i]) && (b[i]<b[i+1])){
      c++;
    }else if((b[i-1]>b[i]) && (b[i]>b[i+1])){
      c++;
    }else{
      c += 0;
    }
    i++;
  }
  printf("%d", &c);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:21: error: expected ';' before ')' token
    9 |   for(i = 1; i <= 20){
      |                     ^
      |                     ;
Language: C

#include<stdio.h>
int main(){
  int a;
  int b[21];
  int c, c = 0;
  scanf("%d",&a);
  scanf("%d",&b);
  for(i = 1; i <= 20){
    if((b[i-1]<b[i]) && (b[i]<b[i+1])){
      c++;
    }else if((b[i-1]>b[i]) && (b[i]>b[i+1])){
      c++;
    }else{
      c += 0;
    }
    i++;
  }
  printf("%d", &c);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:10: error: redeclaration of 'c' with no linkage
    5 |   int c, c = 0;
      |          ^
main.c:5:7: note: previous declaration of 'c' with type 'int'
    5 |   int c, c = 0;
      |       ^
main.c:8:7: error: 'i' undeclared (first use in this function)
    8 |   for(i = 1; i <= 20){
      |       ^
main.c:8:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:21: error: expected ';' before ')' token
    8 |   for(i = 1; i <= 20){
      |                     ^
      |                     ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  int cnt=0;
  for(int i=0;i<n-2;i++){
    if(a[i]>a[i+1] && a[i+1] > a[i+2]) cnt++;
  }
  
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:6: error: expected ';' before 'n'
    5 |   cin n;
      |      ^~
      |      ;
Language: C++

#include<bits/stdc++.h>

int main(){
  int n;
  cin n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  int cnt=0;
  for(int i=0;i<n-2;i++){
    if(a[i]>a[i+1] && a[i+1] > a[i+2]) cnt++;
  }
  
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin n;
      |   ^~~
      |   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:3: error: 'vector' was not declared in this scope
    6 |   vector<int> a(n);
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
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:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> a(n);
      |          ^~~
a.cc:8:12: error: 'a' was not declared in this scope
    8 |     cin >> a[i];
      |            ^
a.cc:12:8: error: 'a' was not declared in this scope
   12 |     if(a[i]>a[i+1] && a[i+1] > a[i+2]) cnt++;
      |        ^
a.cc:15:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |   cout << cnt << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |   cout << cnt << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

using namespace std;
int main()
{
    // 標準入力１行目、２行目の数字の数
    int n;
    cin >> n;
    
    // 連続する３つの数を取り出して、それぞれa, b, c とする
  
    int a;
    cin >> a;
    int b;
    cin >> b;
    int c;
    cin >> c;
    
    //条件を満たすPの数カウント用変数を i とする
    int i;
    i = 0 ;
    
    
    /* 繰り返し */
    
    for (int j = 0; j < ( n - 1);) {
    
        // 連続する数の大小判定
        if (a <= b && b<= c){
            i = i + 1;
            a = b;
            b = c;
            cin >> c;
            }
        }
    // 出力
    cout << (i) << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     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:35:5: error: 'cout' was not declared in this scope
   35 |     cout << (i) << endl;
      |     ^~~~
a.cc:35:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:35:20: error: 'endl' was not declared in this scope
   35 |     cout << (i) << 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;
Language: C++

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

int main()
{
	int n;
	int num[21];
	int count = 0;

	scanf("%d", &n);

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

	for (int i = 1; i < n-1; i++)
	{
		
		if (((num[i] > num[i-1]) && (num[i] < num[i + 1]))|| ((num[i] < num[i - 1]) && (num[i] > num[i + 1]))
			count++;
		
	}

	printf("%d", count);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:118: error: expected ';' before 'count'
   20 |                 if (((num[i] > num[i-1]) && (num[i] < num[i + 1]))|| ((num[i] < num[i - 1]) && (num[i] > num[i + 1]))
      |                                                                                                                      ^
      |                                                                                                                      ;
   21 |                         count++;
      |                         ~~~~~                                                                                         
a.cc:23:9: error: expected primary-expression before '}' token
   23 |         }
      |         ^
a.cc:21:33: error: expected ')' before '}' token
   21 |                         count++;
      |                                 ^
      |                                 )
   22 | 
   23 |         }
      |         ~                        
a.cc:20:20: note: to match this '('
   20 |                 if (((num[i] > num[i-1]) && (num[i] < num[i + 1]))|| ((num[i] < num[i - 1]) && (num[i] > num[i + 1]))
      |                    ^
a.cc:23:9: error: expected primary-expression before '}' token
   23 |         }
      |         ^
Language: C++

#include <iostream>
using namespace std ;

int main () {
  int n = 0 ;
  cin >> n ;
  int p[n] ;
  int i = 1 ;
  int counter ;
  while ( i < n ) {
  if ( p[i-1] > p[i] ) {
    if ( p[1] > p[i+1] {
      counter = counter ++ ;
    }
        }
  if ( p[i+1] > p[i] ) {
    if ( p[1] > p[i-1] {
      counter = counter ++ ;
    }
        }
   i = i++ ;
        }
cout << counter << endl;
return 0;
        }
    
      

Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: expected ')' before '{' token
   12 |     if ( p[1] > p[i+1] {
      |        ~              ^~
      |                       )
a.cc:15:9: error: expected primary-expression before '}' token
   15 |         }
      |         ^
a.cc:17:23: error: expected ')' before '{' token
   17 |     if ( p[1] > p[i-1] {
      |        ~              ^~
      |                       )
a.cc:20:9: error: expected primary-expression before '}' token
   20 |         }
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n ;
  cin >>n;
  int A[n+1];
  for(int i = 0;i<n;i++){
    cin >>A[i];
  }
  int res = 0;
  for(int i = 1;i<=n-2;i++){
    if(min{A[i-1],A[i],A[i+1]}!=A[i] && max{A[i-1],A[i],A[i+1]}!=A[i]){
      res+=1;
    }
  }
  cout <<res <<endl;
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: expected ')' before '{' token
   13 |     if(min{A[i-1],A[i],A[i+1]}!=A[i] && max{A[i-1],A[i],A[i+1]}!=A[i]){
      |       ~   ^
      |           )
a.cc:13:70: error: cannot resolve overloaded function 'min' based on conversion to type 'bool'
   13 |     if(min{A[i-1],A[i],A[i+1]}!=A[i] && max{A[i-1],A[i],A[i+1]}!=A[i]){
      |                                                                      ^
Language: Java

import java.util.Scanner;
public class ac132a {
	public static void main(String[] args) {	
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int p[]=new int[n];
		int cnt=0;	
		for(int i=0;i<n;i++) {p[i]=sc.nextInt();}
		for(int i=0;i<n-2;i++) {
			int a=p[i];
			int b=p[i+1];
			int c=p[i+2];
			int mid = -9999;
			if(a > b && a < c || a > c && a < b || a == b || a == c )
			mid = a;
			else if(b > a && b < c || b > c && b < a || b == a || b == c )
			mid = b;
			else
			mid =c ;
			if(b==mid)cnt++;
		}
		System.out.println(cnt);
	}
}

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

#include <iostream>
using namespace std;
int main(){
  int n; cin >> n;
  vector<int> p;
  for(int i=0; i<n; i++){
    int c; cin >> c;
    p.push_back(c);
  }
  int cnt = 0;
  for(int i=1; i<n-1; i++){
    if((p[i-1] < p[i] && p[i] < p[i+1]) || (p[i-1] > p[i] && p[i] > p[i+1])) cnt++;
  }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'vector' was not declared in this scope
    5 |   vector<int> p;
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:5:10: error: expected primary-expression before 'int'
    5 |   vector<int> p;
      |          ^~~
a.cc:8:5: error: 'p' was not declared in this scope
    8 |     p.push_back(c);
      |     ^
a.cc:12:9: error: 'p' was not declared in this scope
   12 |     if((p[i-1] < p[i] && p[i] < p[i+1]) || (p[i-1] > p[i] && p[i] > p[i+1])) cnt++;
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<int> a(n);
  for(int i=0;i<n;i++)cin>>a.at(i);
  sort(a.begin(),a.end());
  int x=a.at(1);
  int count=0;
  for(int i=;i<n;i++){
    if(a.at(i)==x){
      count++;
    }
  }
  cout<<count<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: expected primary-expression before ';' token
   11 |   for(int i=;i<n;i++){
      |             ^
Language: C++

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

using ll=long long;
const int inf=100000000;

int in(){
  int a;
  cin >> a;
  return a;
}//int型関数の受け取り

void forin(int* x,int y){
  for (int i=0;i<y;i++){
    cin >> x[i];
  }
}//(x,y) int型配列x[y]の受け取り

int intpow(int x,int y){
  double a=x,b=y;
  return pow(a,b);
}//(x,y) xをy乗

int intfabs(int x){
  double a=x;
  return fabs(a);
}//(x) xの絶対値

int fact(int x){
  if (x == 1) return 1;
  return x*fact(x-1);
}//(x) x!

int fib(int x){
  if (x <= 2) return x;
  int a[x];
  a[0]=1;
  a[1]=2;
  for (int i=2;i<x;i++){
    a[i]=a[i-1]+a[i-2];
  }
  return a[x-1];
}//(x) フィボナッチ数列のx番目

int div1(ll x){
  return x%1000000007;
}

main(){
    int n=in(),p[n],ans=0;
    forin(p,n);
    for (int i=1;i<n-1;i++) {
        if (min(p[i-1],p[i],p[i+1])!=p[i] && max(p[i-1],p[i],p[i+1])!=p[i]) ans++;
    }
    cout << ans << endl;
}

Compiler output:
a.cc:49:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   49 | main(){
      | ^~~~
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: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:53:16:   required from here
   53 |         if (min(p[i-1],p[i],p[i+1])!=p[i] && max(p[i-1],p[i],p[i+1])!=p[i]) ans++;
      |             ~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:53:49:   required from here
   53 |         if (min(p[i-1],p[i],p[i+1])!=p[i] && max(p[i-1],p[i],p[i+1])!=p[i]) ans++;
      |                                              ~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C

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

int main() {
  string a, b, c, d;
  cin >> a >> b >> c >> d;
  
  if((a == b) || (b == c) || (b == c) || (c == d)){
    cout << "Yes" << endl;
  }else{
    cout << "No" << 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 <string>
#include <algorithm>
using namespace std;

int main(){
    int n;
    cin >> n;
    int p[25];
    for (int i=0;i<n;++i) cin >> p[i];
    
    int ans = 0;
    for (int i=1;i<n-1;++i){
        if (p[i-1] < p[i] && p[i] < p[i+1]) ++ans;
        else if (p[i+1] < p[i] && p[i] < p[i-1]) ++ans
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:55: error: expected ';' before '}' token
   15 |         else if (p[i+1] < p[i] && p[i] < p[i-1]) ++ans
      |                                                       ^
      |                                                       ;
   16 |     }
      |     ~
Language: C++

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

#define REP(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define REPS(i, n) for (int i = (int)(1); i <= (int)(n); ++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 IREP(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define IREPS(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RVISORT(v) sort(v.begin(), v.end(), greater<int>());
#define ALL(v) v.begin(), v.end()

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using ll = long long;

typedef long long ll;

template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }

const ll mod=1e9+7;

int main()
{
    cin.tie( 0 );
    ios::sync_with_stdio( false );
	
	int n;
	cin>>n;
	VI v;
	REP(i,n){
		int p;cin>>p;
		v.push_back(p);
	}

	int ans=0;
	REP(i,n-2){
		if(v[i]<=v[i+1]&&v[i+1]<v[i+2])ans++;
		if(v[i]>v[i+1]&&v[i+1]=>v[i+2])ans++;
	}
	cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:40: error: expected primary-expression before '>' token
   44 |                 if(v[i]>v[i+1]&&v[i+1]=>v[i+2])ans++;
      |                                        ^
Language: C++

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

int n, num[22];
int most, mini, cnt;

int main()
{
  cin >> n;

  for (int i = 0; i < n; i++) cin >> num[i];

  cnt = 0;
  

Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: expected '}' at end of input
   13 |   cnt = 0;
      |           ^
a.cc:8:1: note: to match this '{'
    8 | {
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <tuple>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
using namespace std;



int main() {
	int N;

	cin >> N;
	vector<int> P(N);

	for (int i=0; i<N; i++) cin >> P.at(i);

	int cnt = 0;
	for (int i=0; i<N-2; i++) {
		if(P.at(i) < P.at(i+1) || P.at(i+2) < P.at(i+1)) {
			if(P.at(i+1) < P.at(i) || P.at(i+1) < P.at(i+2)) {
				cnt++
			}
		}
	}
	

	cout << cnt;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:38: error: expected ';' before '}' token
   25 |                                 cnt++
      |                                      ^
      |                                      ;
   26 |                         }
      |                         ~
Language: C++


/*
LANG:C++
PROB:

*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#include <iostream>
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)


using namespace __gnu_pbds;
using namespace std;


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

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;
typedef unsigned long long ui64;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }


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

    // ifstream fin(".in");
    // ofstream fout(".in");
  i64 n;
  vi64 v;
  cin>>n;
  forn(i,n)
  {
    i64 a;
    cin>>a;
    v.pb(a);
    
  }
  i64 c=0;
  for1(i,n-2)
  {
i64 mx=max(a[i-1],max(a[i],a[i+1]));
i64 mn=min(a[i-1],min(a[i],a[i+1]));
if(a[i]>=mn&&a[i]<=mx)
c++;
    }
cout<<c;

    return 0;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:68:12: error: 'a' was not declared in this scope
   68 | i64 mx=max(a[i-1],max(a[i],a[i+1]));
      |            ^
Language: C++

#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <numeric>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define ALL(x) (x).begin(),(x).end()
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)

// ll gcd(ll a,ll b)  {
// 	if (a%b==0)  return(b);
// 	else return(gcd(b,a%b));
// }
//
// ll lcm(ll number1,ll number2){
// 	return number1 * number2 / gcd(number1,number2);
// }



int main(){
	int N; cin >> N;
	vector<int> P;
	rep(i,N){
		int p; cin >> p;
		P.push_back(p);
	}
	int ans = 0;
	// rep(i,N){
	// 	cout << P[i] << ' ';
	// }
	// cout << endl;
	reps(i,N-2){
		if((P[i-1] < P[i])&&(P[i] < P[i+1])){
				// cout << P[i] << endl;
				ans++;
		}
		if((P[i-1] > P[i])&&(P[i] > P[i+1])){

				// cout << P[i] << e
				ndl;
				ans++;
		}
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:56:33: error: 'ndl' was not declared in this scope
   56 |                                 ndl;
      |                                 ^~~
Language: C++

n = int(input())
xs = [int(x) for x in input().split()]

cnt = 0
for i in range(1,n-1):
    if (xs[i-1] < xs[i]) ^ (xs[i] > xs[i+1]):
        cnt += 1

print(cnt)


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

#include<iostream>
#include<stdio.h>
using namespace std;

int a[25];

int main(){
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d",&a[i]);
	int num=0
	for(int i=2;i<=n-1;i++)if((a[i]<a[i-1]&&a[i]>a[i+1])||(a[i]>a[i-1]&&a[i]<a[i+1])num++;
	printf("%d\n",num);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: expected ',' or ';' before 'for'
   12 |         for(int i=2;i<=n-1;i++)if((a[i]<a[i-1]&&a[i]>a[i+1])||(a[i]>a[i-1]&&a[i]<a[i+1])num++;
      |         ^~~
a.cc:12:21: error: 'i' was not declared in this scope
   12 |         for(int i=2;i<=n-1;i++)if((a[i]<a[i-1]&&a[i]>a[i+1])||(a[i]>a[i-1]&&a[i]<a[i+1])num++;
      |                     ^
Language: C

/* tempate
 *
 *
 */

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>

using namespace std;


#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int (i)=(n); (i)>=(0); (i)--)
#define SIZE(x) ((int)(x).size())
#define GCD(a, b) int gcd(int a,int b){return b?gcd(b,a%b):a;}
#define QP(a, b) int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define all(v) (v).begin(),(v).end()


template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
template<typename A, size_t N, typename T>
void FILL(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

typedef vector<int, int> vint;
typedef pair<int,int> pint;
typedef vector<pint>vpint;
typedef long long ll;

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1LL << 60;
const ll MOD = 1000000007LL;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n; cin >> n;
    vector<ll> p(n);
    ll res = 0;
    rep(i, n) cin >> p[i];
    for(ll i = 1; i < n - 1; i++){
        if(p[i - 1] < p[i] && p[i] < p[i + 1] || p[i + 1] < p[i] && p[i] < p[i - 1]) res++;
    }
    cout << res;
    cout << endl;
    return 0;
}


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

#include<bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <functional>
#include<iostream>
#include <string>
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 p[n];
    int ans=0;
    fr(i,n){
      cin >> p[i];
    }
    fr(i,1,n-1){
      if(p[i-1]<p[i]&&p[i]<p[i+1])ans++;
    }
      cout << ans << endl;
}

Compiler output:
a.cc:23:15: error: macro "fr" passed 3 arguments, but takes just 2
   23 |     fr(i,1,n-1){
      |               ^
a.cc:10:9: note: macro "fr" defined here
   10 | #define fr(i,n) for(int i=0;i<n;i++)
      |         ^~
a.cc: In function 'int main()':
a.cc:23:5: error: 'fr' was not declared in this scope
   23 |     fr(i,1,n-1){
      |     ^~
Language: C++

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

int main(){
  int N,ans=0;
  cin>>N;
  int P[N];
  for(int i=0; i<N; ++i) cin>>P[i];
  for(int i=1; i<N-1; ++i){
    if((P[i-1]<P[i]) && P[i]<P[i+1]) ans++;
    else if((P[i-1]>P[i]) && P[i]>P[i+1]) ans++
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:48: error: expected ';' before '}' token
   17 |     else if((P[i-1]>P[i]) && P[i]>P[i+1]) ans++
      |                                                ^
      |                                                ;
   18 |   }
      |   ~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(){
  int n;cin>>n;
  int a[n];
  for(int i = 0; n > i; i++){
    cin>>a[i];
  }
  vector<int> ans;
  for(int i = 0; n-2 > i; i++){
    int sm = 0;
    int mx = 0;
    int mn = 1000
	for(int j = i; i+3 > j; j++){
      sm += a[j];
      mx = max(mx,a[j]);
      mn = min(mn,a[j]);
    }
    bool ok = true;
    for(int j = 0; ans.size() > j; j++){
      if(ans[i] == sm-mx-mn)ok=false;
    }
    if(ok){
      ans.push_back(sm-mx-mn);
    }
  }
  cout << ans.size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: expected ',' or ';' before 'for'
   15 |         for(int j = i; i+3 > j; j++){
      |         ^~~
a.cc:15:30: error: 'j' was not declared in this scope
   15 |         for(int j = i; i+3 > j; j++){
      |                              ^
Language: C++

//#define NDEBUG
#include <cstddef>
#include <cstdint>
#include <vector>

namespace n91 {

using i8 = std::int_fast8_t;
using i32 = std::int_fast32_t;
using i64 = std::int_fast64_t;
using u8 = std::uint_fast8_t;
using u32 = std::uint_fast32_t;
using u64 = std::uint_fast64_t;
using isize = std::ptrdiff_t;
using usize = std::size_t;

constexpr usize operator"" _z(unsigned long long x) noexcept {
  return static_cast<usize>(x);
}

class rep {
  const usize f, l;

public:
  class itr {
    friend rep;
    usize i;
    constexpr itr(const usize x) noexcept : i(x) {}

  public:
    void operator++() noexcept { ++i; }
    constexpr usize operator*() const noexcept { return i; }
    constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
  };
  constexpr rep(const usize first, const usize last) noexcept
      : f(first), l(last) {}
  constexpr itr begin() const noexcept { return itr(f); }
  constexpr itr end() const noexcept { return itr(l); }
};
class revrep {
  const usize f, l;

public:
  class itr {
    friend revrep;
    usize i;
    constexpr itr(usize x) noexcept : i(x) {}

  public:
    void operator++() noexcept { --i; }
    constexpr usize operator*() const noexcept { return i; }
    constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
  };
  constexpr revrep(usize first, usize last) noexcept : f(--first), l(--last) {}
  constexpr itr begin() const noexcept { return itr(l); }
  constexpr itr end() const noexcept { return itr(f); }
};
template <class T> using vec_alias = std::vector<T>;
template <class T> auto md_vec(const usize n, const T &value) {
  return std::vector<T>(n, value);
}
template <class... Args> auto md_vec(const usize n, Args... args) {
  return std::vector<decltype(md_vec(args...))>(n, md_vec(args...));
}
template <class T> constexpr T difference(const T &a, const T &b) {
  return a < b ? b - a : a - b;
}

} // namespace n91

#include <algorithm>
#include <iostream>
#include <string>
#include <utility>

namespace n91 {

void main_() {
  usize n;
  std::cin >> n;
  std::vector<usize> p(n);
  for (auto &e : p) {
    std::cin >> e;
  }
  usize ans = 0_z;
  for (const auto i : rep(1_z, n - 1_z)) {
    std::array<usize, 3_z> a = {p[i - 1_z], p[i], p[i + 1_z]};
    std::sort(a.begin(), a.end());
    if (p[i] == a[1_z]) {
      ++ans;
    }
  }
  std::cout << ans << std::endl;
}

} // namespace n91

int main() {
  n91::main_();
  return 0;
}


Compiler output:
a.cc: In function 'void n91::main_()':
a.cc:87:28: error: variable 'std::array<long unsigned int, 3> a' has initializer but incomplete type
   87 |     std::array<usize, 3_z> a = {p[i - 1_z], p[i], p[i + 1_z]};
      |                            ^
a.cc:75:1: note: 'std::array' is defined in header '<array>'; this is probably fixable by adding '#include <array>'
   74 | #include <utility>
  +++ |+#include <array>
   75 |
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <climits>
#include <cmath>
#include <utility>
#include <string>
#include <cstring>
#include <functional>

using namespace std;

int n, p[22];

int main() {

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	cin >> n;
	for (int i = 0; i < n; ++i)
		cint >> p[i];

	int cnt = 0;
	for (int i = 1; i < n-1; ++i)
		if ((p[i-1] < p[i] && p[i] < p[i+1]) || (p[i-1] > p[i] && p[i] > p[i+1]))
			++cnt;

	cout << cnt << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: 'cint' was not declared in this scope; did you mean 'uint'?
   27 |                 cint >> p[i];
      |                 ^~~~
      |                 uint
Language: C++

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

#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define MOD 1000000007

#define trace1(x)                    cout <<#x<<": "<<x<< endl;
#define trace2(x, y)                 cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)              cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)           cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;

typedef long long ll;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);
    ll i,j,n,m;
    cin>>n;
    ll a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    ll cnt=0;
    for(i=1;<n-1;i++)
    {
        if(max(a[i+1],a[i-1])>a[i] && min(a[i+1],a[i-1])<a[i])
        cnt++;
    }
    cout<<cnt;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:13: error: expected primary-expression before '<' token
   30 |     for(i=1;<n-1;i++)
      |             ^
Language: C++

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

int main(){
 int n,a,b;
  cin >> n;
  
 vector<int> d(n);
  rep(i,n) cin >> d.at(i);
  
 sort(d.begin(),b.end());
  
  a=n/2-1;
  b=n/2;
  
  cout << d.at(b)-d.at(a) << endl;
  
}
  
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: request for member 'end' in 'b', which is of non-class type 'int'
   13 |  sort(d.begin(),b.end());
      |                   ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,i;
  cin >> n;
vector<int> d(n);
  for(i=0;i<n;++i)
  {
  cin >> d.at(i);
  }
  
  sort(d.begin(),d.end());
    
    out << d.at(n/2)-d.at(n/2-1);

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'out' was not declared in this scope
   15 |     out << d.at(n/2)-d.at(n/2-1);
      |     ^~~
Language: C++

#include<bits./stdc++.h>
using namespace std;
int main()
{
int n;
  cin >> n;
vector<int> d(n);
  cin >> d;
  sort(d.begin(),d.end());
    
    out << d.at(n/2)-d.at(n/2-1);

return 0;
}

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

#include<bits./stdc++.h>
using namespace std;
int main()
{
int n;
  cin >> n;
vector<int> d(n);
  sort(d.begin(),d.end());
    
    out << d.at(n/2)-d.at(n/2-1);

return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int arr[n];
for(int i = 0;i<n;i++)
{
    cin >> arr[i];
}
sort(arr,arr+n);
int ans = arr[arr.size()/2]-arr[arr.size()/2-1];
cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: request for member 'size' in 'arr', which is of non-class type 'int [n]'
   12 | int ans = arr[arr.size()/2]-arr[arr.size()/2-1];
      |                   ^~~~
a.cc:12:37: error: request for member 'size' in 'arr', which is of non-class type 'int [n]'
   12 | int ans = arr[arr.size()/2]-arr[arr.size()/2-1];
      |                                     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int arr[n];
for(int i = 0;i<n;i++)
{
    cin >> arr[i];
}
sort(arr.begin(), arr.end());
int ans = arr[arr.size()/2]-arr[arr.size()/2-1];
cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: request for member 'begin' in 'arr', which is of non-class type 'int [n]'
   11 | sort(arr.begin(), arr.end());
      |          ^~~~~
a.cc:11:23: error: request for member 'end' in 'arr', which is of non-class type 'int [n]'
   11 | sort(arr.begin(), arr.end());
      |                       ^~~
a.cc:12:19: error: request for member 'size' in 'arr', which is of non-class type 'int [n]'
   12 | int ans = arr[arr.size()/2]-arr[arr.size()/2-1];
      |                   ^~~~
a.cc:12:37: error: request for member 'size' in 'arr', which is of non-class type 'int [n]'
   12 | int ans = arr[arr.size()/2]-arr[arr.size()/2-1];
      |                                     ^~~~
Language: C++

#include<bits/stdc++.h>
using namesapce std;
int main(){
int n;
cin >> n;
int arr[n];
for(int i = 0;i<n;i++)
{
    cin >> arr[i];
}
sort(arr.begin(), arr.end());
int ans = arr[arr.size()/2]-arr[arr.size()/2-1];
cout << ans << endl;
}


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namesapce'
    2 | using namesapce std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 | cin >> n;
      | ^~~
      | 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:11:10: error: request for member 'begin' in 'arr', which is of non-class type 'int [n]'
   11 | sort(arr.begin(), arr.end());
      |          ^~~~~
a.cc:11:23: error: request for member 'end' in 'arr', which is of non-class type 'int [n]'
   11 | sort(arr.begin(), arr.end());
      |                       ^~~
a.cc:11:1: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   11 | sort(arr.begin(), arr.end());
      | ^~~~
      | 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);
      | ^~~~
a.cc:12:19: error: request for member 'size' in 'arr', which is of non-class type 'int [n]'
   12 | int ans = arr[arr.size()/2]-arr[arr.size()/2-1];
      |                   ^~~~
a.cc:12:37: error: request for member 'size' in 'arr', which is of non-class type 'int [n]'
   12 | int ans = arr[arr.size()/2]-arr[arr.size()/2-1];
      |                                     ^~~~
a.cc:13:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 | cout << ans << endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 | cout << ans << endl;
      |                ^~~~
      |                std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

 #include<bits/stdc++.h>$
   using namesapce std;
   int main(){
   int n;
   cin >> n;
   int arr[n];
   for(int i = 0;i<n;i++)
   {
       cin >> arr[i];
 }
 sort(arr.begin(), arr.end());
 int ans = arr[arr.size()/2]-arr[arr.size()/2-1];
 cout << ans << endl;
  }


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin >> n;
  vector<int> d(n);
  for (int i = 0; i < n; i++)
    cin >> d(i);
  
  sort(d.begin(), d.end());
  cout << d[n/2] - d[n/2-1];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: no match for call to '(std::vector<int>) (int&)'
    9 |     cin >> d(i);
      |            ~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  if(n%2==1){
    cout<<"0\n"
    return 0;
  }
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
sort(a.begin(),a.end());
  cout<<a[n/2]-a[n/2-1]<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: expected ';' before 'return'
    7 |     cout<<"0\n"
      |                ^
      |                ;
    8 |     return 0;
      |     ~~~~~~
Language: C++

# include <bits/stdc++.h>
# define rep(i, n) for(ll i = 0; i < (n); ++i)
# define reps(i, n) for(ll i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(ll i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(ll i=((int)(n)); i>0; --i)
# define ll long long
# 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)
# define P pair<int, int>
# define mp make_pair
# define x first
# define y second
using namespace std;
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 main() {
  int n; cin >> n;
  vector<int> v(n);
  rep(i, n) cin >> v[i];

  sort(ALL(v));
  int ans = d[n/2] - d[n/2 - 1];
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:13: error: 'd' was not declared in this scope
   25 |   int ans = d[n/2] - d[n/2 - 1];
      |             ^
Language: C++

//#pragma GCC optimize "trapv"
//-D_GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define ii pair<int,int>
#define Max 100000+5
#define IO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define f first
#define s second
#define pb push_back
int mod = 1000000007;
int mod1 = 998244353;
vector<int> g[Max];
bool vis[Max];
int d, x, y;
int gcd(int a,int b){
    if(b==0)return a;
    return gcd(b,a%b);
}
void ex(int A, int B) {
    if(B == 0) {
        d = A;
        x = 1;
        y = 0;
    }
    else {
        ex(B, A%B);
        int temp = x;
        x = y;
        y = temp - (A/B)*y;
    }
}


void dfs(int u){

	vis[u]=1;
	for(int i=0;i<g[u].size();i++){
		int v=g[u][i];
		if(vis[v]!=1)
			dfs(v);
	}
}



int power(int a,int b){
    if(b==1)return a;
    if(a>mod)a%=mod;
    int r=1;
    while(b){
        if(b&1)r=r%mod*a%mod;
        a=a%mod*a%mod;
        b/=2;
    }
    return r;
}
class uf{
    vector<int> v;
    vector<int> sz;
    
    
    public :
    uf(int n){
        v.resize(n+1);
        iota(v.begin()+1,v.end(),1);
        sz.resize(n+1,1);
        //1 to sz
    }
    int root(int b){
        while(v[b]!=b){
            b = v[b];
        }   
        return b;
    }
    void u(int a, int b){
        //combine a and b
        
        int ra=root(a);
        int rb=root(b);
        if(ra==rb)return ;
        if(sz[ra]<sz[rb]){
            v[ra] = v[rb];
            sz[rb]+=sz[ra];
        }else{
            v[rb]=v[ra];
            sz[ra]+=sz[rb];
        }
    }
    bool f(int a,int b){
        //same set
        return (root(a)==root(b));
    }
   
    
};
vector<int> matmul(vector<int> a,vector<int> b){
    vector<int> c(4,0);
    c[0] = (a[0]%mod*b[0]%mod + a[1]%mod*b[2]%mod)%mod;
    c[1] = (a[0]%mod*b[1]%mod + a[1]%mod*b[3]%mod)%mod;
    c[2] = (a[2]%mod*b[0]%mod + a[3]%mod*b[2]%mod)%mod;
    c[3] = (a[2]%mod*b[1]%mod + a[3]%mod*b[3]%mod)%mod;
    return c;
}
vector<int> id={1,0,0,1};

int32_t main(){
	IO
	//freopen("input.txt","r",stdin);
    	//freopen("output.txt","w",stdout);
	int n;
  	cin>>n;
  	vector<int> v(n);
  	for(int i=0;i<n;i++)cin>>v[i];
  	sort(all(v));
  	cout<<v[n/2]-v[n/2-];
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:119:28: error: expected primary-expression before ']' token
  119 |         cout<<v[n/2]-v[n/2-];
      |                            ^
Language: C++

    int main(){
      int N;
      cin>>N;
      vector<int>v(N);
      for(int i=0;i<N;++i){
        cin>>v[i];
        }
      sort(v.begin(),v.end());
      int answer=v[v.size()/2]-v[v.size()/2-1];
      cout<<answer<<endl;
      return 0;
     
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:3:7: error: 'cin' was not declared in this scope
    3 |       cin>>N;
      |       ^~~
a.cc:4:7: error: 'vector' was not declared in this scope
    4 |       vector<int>v(N);
      |       ^~~~~~
a.cc:4:14: error: expected primary-expression before 'int'
    4 |       vector<int>v(N);
      |              ^~~
a.cc:6:14: error: 'v' was not declared in this scope
    6 |         cin>>v[i];
      |              ^
a.cc:8:12: error: 'v' was not declared in this scope
    8 |       sort(v.begin(),v.end());
      |            ^
a.cc:8:7: error: 'sort' was not declared in this scope; did you mean 'short'?
    8 |       sort(v.begin(),v.end());
      |       ^~~~
      |       short
a.cc:10:7: error: 'cout' was not declared in this scope
   10 |       cout<<answer<<endl;
      |       ^~~~
a.cc:10:21: error: 'endl' was not declared in this scope
   10 |       cout<<answer<<endl;
      |                     ^~~~
Language: C++

int main(){
  int N;
  cin>>N;
  vector<int>v(N);
  for(int i=0;i<N;++i){
    cin>>v[i];
    }
  sort(v.begin(),v.end());
  int answer=v[v.size()/2]-v[v.size()/2-1];
  cout<<answer<<endl;
  return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin>>N;
      |   ^~~
a.cc:4:3: error: 'vector' was not declared in this scope
    4 |   vector<int>v(N);
      |   ^~~~~~
a.cc:4:10: error: expected primary-expression before 'int'
    4 |   vector<int>v(N);
      |          ^~~
a.cc:6:10: error: 'v' was not declared in this scope
    6 |     cin>>v[i];
      |          ^
a.cc:8:8: error: 'v' was not declared in this scope
    8 |   sort(v.begin(),v.end());
      |        ^
a.cc:8:3: error: 'sort' was not declared in this scope; did you mean 'short'?
    8 |   sort(v.begin(),v.end());
      |   ^~~~
      |   short
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout<<answer<<endl;
      |   ^~~~
a.cc:10:17: error: 'endl' was not declared in this scope
   10 |   cout<<answer<<endl;
      |                 ^~~~
Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int N;
	cin>>N;
    int quiz[N];
	for(int i=0;i<N;i++){
		cin>>quiz[i];
    }
	sort(quiz.begin(), quiz.end());
	int ans=N/2;
	cout<<(quiz[ans]-quiz[ans+1])-1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: request for member 'begin' in 'quiz', which is of non-class type 'int [N]'
   12 |         sort(quiz.begin(), quiz.end());
      |                   ^~~~~
a.cc:12:33: error: request for member 'end' in 'quiz', which is of non-class type 'int [N]'
   12 |         sort(quiz.begin(), quiz.end());
      |                                 ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int N;
	cin>>N;
    int quiz[N];
	for(int i=0;i<N;i++){
		cin>>quiz[i];
    }
	sort(quiz.begin(), quiz.end());
	int ans=N/2;
	cout<<(quiz[ans]-quiz[ans+1])-1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: request for member 'begin' in 'quiz', which is of non-class type 'int [N]'
   11 |         sort(quiz.begin(), quiz.end());
      |                   ^~~~~
a.cc:11:33: error: request for member 'end' in 'quiz', which is of non-class type 'int [N]'
   11 |         sort(quiz.begin(), quiz.end());
      |                                 ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  int ABC=0;
  int ARC=0;
  int de=0;
  int dasu=0;
  cin>>N;
  vector<int>vec(N);
  for(int X=0;X<N;X++){
    cin>>vec.at(X);
    if(de<vec.at(X)){
      de=vec.at(X);
  }
  for(int K=1;K<de;K++){
    ABC=0;
    ARC=0;
    for(int Y=0;Y<N;Y++){
      if(vec.at(Y)>=K){
        ARC++;
      }
      else{
        ABC++;
      }
    }
    if(ARC==ABC){
      dasu++;
    }
  }
    cout<<dasu<<endl;
  }

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

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

int main () {
  int N,K;
  cin >> N;
  vector<int> data(N);
  for (int i=0; <N; i++){
    cin >> data[i];
  }
  sort(data.begin(),data.end());
  K = N/2;
  cout << data[K] - data[K-1] << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: expected primary-expression before '<' token
    8 |   for (int i=0; <N; i++){
      |                 ^