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

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >>s;
  char a, b;
  a = s.at(0);
  
  if(s.at(1) == a){
    if(s.at(2) == s.at(3)) cout << "Yes" <<endl;return 0;
    else cout << "No" <<endl; return 0;
  }
  
  else{
    b = s.at(1);
    if(s.at(2) == a){
      if(s.at(3) == b) cout << "Yes" <<endl;return 0;
      else cout << "No" <<endl;return 0;
    }
    if(s.at(2) == b){
      if(s.at(3) == a) cout << "Yes" <<endl;return 0;
      else cout <<"No"<<endl;return 0;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected '}' before 'else'
   11 |     else cout << "No" <<endl; return 0;
      |     ^~~~
a.cc:9:19: note: to match this '{'
    9 |   if(s.at(1) == a){
      |                   ^
a.cc: At global scope:
a.cc:14:3: error: expected unqualified-id before 'else'
   14 |   else{
      |   ^~~~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C

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

int main(){
    char s[4];
    
    for(int i = 0; i < 4; i++){
        cin >> s[i];
    }

    if(s[0] == s[1]){
        if(s[2] == s[3]) cout << "Yes\n";
        else cout << "No\n";
    }
    else if (s[0] == s[2]){
        if(s[1] == s[3]) cout << "Yes\n";
        else cout << "No\n";
    }
    else if (s[0] == s[3]){
        if(s[1] == s[2]) cout << "Yes\n";
        else cout << "No\n";
    }
    else cout << "No\n";

    return 0;
}


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

S = input()
s1 = S[0]
s2 = S[1]
s3 = S[2]
s4 = S[3]
SL = [s1, s2, s3, s4]
SL.sort()
if SL[0] == SL[1] and SL[2] == SL[3] and SL[0] != SL[2]:
    print("Yes")
else:
    print("No")


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

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

int main()
{
    IO;
    string s;
    cin >> s;
    int ans = 0;
    set<char> st;
    for(int i = 0; i < s.size(); i++)
    {
        st.insert(s[i];)
    }
    if(st.size() == 2)
        cout << "YES";
    else
        cout << "NO";

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:23: error: expected ')' before ';' token
   18 |         st.insert(s[i];)
      |                  ~    ^
      |                       )
a.cc:18:24: error: expected primary-expression before ')' token
   18 |         st.insert(s[i];)
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  	string s;
  	cin>>s;
  	if(s[0]==s[1])
    {
      	if(s[2]==s[3])
        {
          	p=1;
        }
    }
  	else if(s[0]==s[2])
    {
      	if(s[1]==s[3])
        {
          	p=1;
        }
    }
  	else if(s[0]==s[3])
    {
      	if(s[1]==s[2])
        {
          	p=1;
        }
    }
  	if(p==1)
    {
      	cout<<"Yes\n";
    }
  	else
    {
      	cout<<"No\n";
    }
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'p' was not declared in this scope
   11 |                 p=1;
      |                 ^
a.cc:18:17: error: 'p' was not declared in this scope
   18 |                 p=1;
      |                 ^
a.cc:25:17: error: 'p' was not declared in this scope
   25 |                 p=1;
      |                 ^
a.cc:28:12: error: 'p' was not declared in this scope
   28 |         if(p==1)
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;typedef long long ll;typedef string str;
typedef vector<str> vst;typedef vector<ll> vll;
ll mod = 1000000007, INF = 10000000000000000;
ll gcd(ll a, ll b){if(b==0){return a;}return gcd(b, a%b);}
// for (ll i = 0; i < n; i++) {
// sort(.begin(),.end());

int main(){
  string s;
  cin>>s;
  
  if((s[0]==s[3]&&s[1]==s[2])||(s[0]==s[1]&&s[2]==s[3])||(s[0]==s[2]&&s[1]==s[3])){
    cout<<"Yes"<<endl;
  }else{
	cout<<"No"<<endl;
  }
    

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

s = input()
  
if s[0] == s[1]:
    if s[2] == s[3]:
        print('Yes')
    else:
        print('No')
elif s[0] == s[2]:
    if s[1] == s[3]:
        print('Yes')
    else:
        print('No')
elif s[0] == s[3]:
    if s[1] == s[2]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Compiler output:
a.cc:5:15: warning: multi-character character constant [-Wmultichar]
    5 |         print('Yes')
      |               ^~~~~
a.cc:7:15: warning: multi-character character constant [-Wmultichar]
    7 |         print('No')
      |               ^~~~
a.cc:10:15: warning: multi-character character constant [-Wmultichar]
   10 |         print('Yes')
      |               ^~~~~
a.cc:12:15: warning: multi-character character constant [-Wmultichar]
   12 |         print('No')
      |               ^~~~
a.cc:15:15: warning: multi-character character constant [-Wmultichar]
   15 |         print('Yes')
      |               ^~~~~
a.cc:17:15: warning: multi-character character constant [-Wmultichar]
   17 |         print('No')
      |               ^~~~
a.cc:19:11: warning: multi-character character constant [-Wmultichar]
   19 |     print('No')
      |           ^~~~
a.cc:1:1: error: 's' does not name a type
    1 | s = input()
      | ^
Language: C++

a=input()
a=[i for i in a]
c=a.count(a[0])
x=0
for i in a:
    if i!=a[0]:
        x=i
c2=a.count(x)
if c==2 and c2==2:
    print("Yes")
else:
    print("No")



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

package main

import "fmt"

func main() {
	var S string
	fmt.Scan(&S)
	for i := 0; i < 4; i++ {
		c := S[i]
		n := 0
		for j := 0; j < 4; j++ {
			if i == j {
				continue
			}
			if c == S[j] {
				n++
			}
		}
		if n != 1 {
			fmt.Println("No")
			return
		}
	}
	fmt.Println("Yes")
	return
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  map<char> p;
  for(int i = 0; i < 4; i++) p[s[i]]++;
  vector<int> a;
  if(p.size() == 2) {
    for(auto i : p) {
      a.push_back(i.second);
    }
    if(a[0] == a[1]) cout << "Yes";
    else cout << "No";
  }
  else cout << "No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: wrong number of template arguments (1, should be at least 2)
    6 |   map<char> p;
      |           ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:7:31: error: invalid types 'int[__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}]' for array subscript
    7 |   for(int i = 0; i < 4; i++) p[s[i]]++;
      |                               ^
a.cc:9:8: error: request for member 'size' in 'p', which is of non-class type 'int'
    9 |   if(p.size() == 2) {
      |        ^~~~
a.cc:10:18: error: 'begin' was not declared in this scope
   10 |     for(auto i : p) {
      |                  ^
a.cc:10:18: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:10:18: error: 'end' was not declared in this scope
   10 |     for(auto i : p) {
      |                  ^
a.cc:10:18: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int ans=0;
    map<char,int>m;
    string s;cin>>s;STOP
    for(int i=0;i<s.size();i++)
    {
        m[s[i]]++;
        if(m[s[i]]==2)ans++;
    }
    if(ans==2)cout<<"Yes";
    else cout<<"No";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: 'STOP' was not declared in this scope
    7 |     string s;cin>>s;STOP
      |                     ^~~~
a.cc:8:17: error: 'i' was not declared in this scope
    8 |     for(int i=0;i<s.size();i++)
      |                 ^
Language: C++

def A(s):
    for i in s:
        if s.count(i)!=2:
            break
    else :
        return 'Yes'
    return 'No'


if __name__ == '__main__':
    s = input()
    print(A(s))

Compiler output:
a.cc:6:16: warning: multi-character character constant [-Wmultichar]
    6 |         return 'Yes'
      |                ^~~~~
a.cc:7:12: warning: multi-character character constant [-Wmultichar]
    7 |     return 'No'
      |            ^~~~
a.cc:10:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   10 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def A(s):
      | ^~~
Language: C++

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


int main() {
	string S;

	cin >> S;
	bool en = true;
	for(int i=0; i<S.size(); i++) {
		int cnt = 0;
		for(int j=i+1; j<S.size(); j++){
			if (S[i] == S[j]) cnt++
		}
		if(cnt != 2) {
			en = false;
			break
		}
	}

	if (en) cout << "Yes";
	else    cout << "No";


}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:48: error: expected ';' before '}' token
   20 |                         if (S[i] == S[j]) cnt++
      |                                                ^
      |                                                ;
   21 |                 }
      |                 ~                               
a.cc:24:30: error: expected ';' before '}' token
   24 |                         break
      |                              ^
      |                              ;
   25 |                 }
      |                 ~
Language: C++

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

map<char,int> ma;
char c;
int main(){
	for(int i = 0; i < 4; i++){
	cin >> c;
	ma[c]++;
	}
	for(auto u : ma){
		issa
			f(u.second != 2){cout << "No\n"; return 0;}
	}
	cout << "Yes\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'issa' was not declared in this scope
   12 |                 issa
      |                 ^~~~
Language: C++

'use strict'

const INF = 900719925474099;
function mapint(temp){
    return temp.split(' ').map((v)=>parseInt(v));
}

function lower_bound(d,a,b,e){
    for(var c;1<b-a;)
        d[c=0|(a+b)/2]<e ? a=c : b=c;
    return d[a]<e?b:a
};

const MOD = 1000000007;

function Main(input){
    let s = input.trim();
    let f = false;

    if(s[0]==s[1]) if(s[2]==s[3]) f=true;
    if(s[0]==s[2]) if(s[1]==s[3]) f=true;
    if(s[0]==s[3]) if(s[1]==s[2]) f=true;

    if(f) console.log('Yes');
    else console.log('No');

}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));



Compiler output:
a.cc:1:1: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
    1 | 'use strict'
      | ^~~~~~~~~~~~
a.cc:24:23: warning: multi-character character constant [-Wmultichar]
   24 |     if(f) console.log('Yes');
      |                       ^~~~~
a.cc:25:22: warning: multi-character character constant [-Wmultichar]
   25 |     else console.log('No');
      |                      ^~~~
a.cc:1:1: error: expected unqualified-id before '\x72696374'
    1 | 'use strict'
      | ^~~~~~~~~~~~
a.cc:4:1: error: 'function' does not name a type; did you mean 'union'?
    4 | function mapint(temp){
      | ^~~~~~~~
      | union
a.cc:8:1: error: 'function' does not name a type; did you mean 'union'?
    8 | function lower_bound(d,a,b,e){
      | ^~~~~~~~
      | union
a.cc:14:7: error: 'MOD' does not name a type
   14 | const MOD = 1000000007;
      |       ^~~
a.cc:16:1: error: 'function' does not name a type; did you mean 'union'?
   16 | function Main(input){
      | ^~~~~~~~
      | union
a.cc:29:5: error: expected constructor, destructor, or type conversion before '(' token
   29 | Main(require("fs").readFileSync("/dev/stdin", "utf8"));
      |     ^
Language: Java

import java.util.*;
public class Beginner132A {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String x = sc.nextLine();
		char c [] =x.toCharArray();
		Arrays.parallelSort(c);
		if(c[0]== c[1] && c[2] == c[3] && c[2]!=c[1])
			System.out.println("Yes");
		else 
			System.out.println("No");

	}

}


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

#include<stdio.h>
int main(void){
  char s[4];
  scanf("%s",s);
  if(s[0]==s[1]&&s[2]==s[3]){
    printf("Yes");
  }
  else if(s[0]==s[3]&&s[2]==s[1]){
    printf("Yes");
  }
  else if(s[0]==s[2]&&s[1]==s[3]){
    printf("Yes");
  }
  else{
    printf("No"):
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: expected ';' before ':' token
   15 |     printf("No"):
      |                 ^
      |                 ;
Language: C++

s = input() # 文字列を変数に格納

if s[0] == s[1]:
    if s[2] == s[3]:
        print('Yes')
    else:
        print('No')
elif s[0] == s[2]:
    if s[1] == s[3]:
        print('Yes')
    else:
        print('No')
elif s[0] == s[3]:
    if s[1] == s[2]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Compiler output:
a.cc:1:13: error: stray '#' in program
    1 | s = input() # 文字列を変数に格納
      |             ^
a.cc:5:15: warning: multi-character character constant [-Wmultichar]
    5 |         print('Yes')
      |               ^~~~~
a.cc:7:15: warning: multi-character character constant [-Wmultichar]
    7 |         print('No')
      |               ^~~~
a.cc:10:15: warning: multi-character character constant [-Wmultichar]
   10 |         print('Yes')
      |               ^~~~~
a.cc:12:15: warning: multi-character character constant [-Wmultichar]
   12 |         print('No')
      |               ^~~~
a.cc:15:15: warning: multi-character character constant [-Wmultichar]
   15 |         print('Yes')
      |               ^~~~~
a.cc:17:15: warning: multi-character character constant [-Wmultichar]
   17 |         print('No')
      |               ^~~~
a.cc:19:11: warning: multi-character character constant [-Wmultichar]
   19 |     print('No')
      |           ^~~~
a.cc:1:1: error: 's' does not name a type
    1 | s = input() # 文字列を変数に格納
      | ^
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);
    string s; cin >> s;
    bool f = false;
    if(s[0] == s[1]){
        if(s[2] == s[3] && s[2] != s[0]) f = true;
    }
    if(s[0] == s[2]){
        if(s[1] == s[3] && s[1] != s[0]) f = true;
    }
    if(s[0] == s[3]){
        if(s[1] == s[2] && s[1] != s[0]) f = true;
    }
    if(f) cout << "Yes";
    else cout << "No";
    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 <iostream>
#include <climits>
#include <set>
#include <string>
#include <algorithm>
#include <vector>
#define MAX 1000000007


using namespace std;
#define ll long long
#define dbg if(0)
#define ISRANGE(val,lo,hi) ((lo<=val)&&(val<hi))



int main(){
    ll ans=0;
    int l[26];
    for(int i=0;i<26;i++){
        l[i]=0;
    }
    for(int i=0;i<4;i++){
        char a;
        cin >>a;
        l[a-'A']++;
    }
    ans=0
    for(int i=0;i<26;i++){
        if(l[i]==2)ans++;
    }
    
        if(ans==2)cout <<"Yes"<<endl;
        else cout <<"No"<<endl;


    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:10: error: expected ';' before 'for'
   28 |     ans=0
      |          ^
      |          ;
   29 |     for(int i=0;i<26;i++){
      |     ~~~   
a.cc:29:17: error: 'i' was not declared in this scope
   29 |     for(int i=0;i<26;i++){
      |                 ^
Language: Java

import java.util.Scanner;

public class A {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		char[] ch = scn.nextLine().toCharArray();
		boolean how = (ch[0]==ch[1] && ch[2]==ch[3])||(ch[0] == ch[2]&&ch[1]==ch[3])||(ch[0]==ch[3]&&ch[1]==ch[2]);
		System.out.println(how?"Yes":"No");
	}

}

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

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

int main(){
    char x; int k;
    vector<int> ans(130);
    

    cin >> x;
    int k = x
    ans[k]++;

    cin >> x;
    int k = x
    ans[k]++;

    cin >> x;
    int k = x
    ans[k]++;

    cin >> x;
    int k = x
    ans[k]++;

    for( int a : ans){
        if( a == 0 || a == 2 ){
            continue;
        } else {
            cout << "No" << endl;
            return 0;
        }
    }


    cout << "Yes" << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: redeclaration of 'int k'
   10 |     int k = x
      |         ^
a.cc:5:17: note: 'int k' previously declared here
    5 |     char x; int k;
      |                 ^
a.cc:14:9: error: redeclaration of 'int k'
   14 |     int k = x
      |         ^
a.cc:5:17: note: 'int k' previously declared here
    5 |     char x; int k;
      |                 ^
a.cc:18:9: error: redeclaration of 'int k'
   18 |     int k = x
      |         ^
a.cc:5:17: note: 'int k' previously declared here
    5 |     char x; int k;
      |                 ^
a.cc:22:9: error: redeclaration of 'int k'
   22 |     int k = x
      |         ^
a.cc:5:17: note: 'int k' previously declared here
    5 |     char x; int k;
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std ;
#define ll long long int 
#define pb push_back 
#define mp make_pair 
#define pii pair <int , int > 
#define pll pair < ll , ll >
int main(){
	ios_base::sync_with_stdio(false) ;
	cin.tie(NULL) ;
	srting s ;
  	cin >> s ;
  sort(s , s+4);
  if(s[0] == s[1] && s[2] == s[3] && s[1] != s[2]) cout << "Yes" ;
  else cout << "No" ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'srting' was not declared in this scope
   11 |         srting s ;
      |         ^~~~~~
a.cc:12:16: error: 's' was not declared in this scope
   12 |         cin >> s ;
      |                ^
Language: C++

#pragma once
#include <stdio.h>
#include <sstream>
#include <string>
#include <string.h>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <limits>
#include <iomanip>
#include "BinaryIndexedTree1.h"
#define _USE_MATH_DEFINES
#include <math.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define bit(x,v) ((ll)x << v)

const ll INF = 1000000007;
const int MAX = 210000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
int pr[100010];
void uini(int n) {
	for (size_t i = 0; i <= n; i++)
	{
		pr[i] = i;
	}
}

int parent(int x) {
	if (x == pr[x]) return x;
	return pr[x] = parent(pr[x]);
}

bool unit(int x, int y) {
	int px = parent(x);
	int py = parent(y);

	if (px == py) return false;
	if (px < py) {
		pr[py] = px;
	}
	else {
		pr[px] = py;
	}
	return true;
}

// res[i][c] := i 文字目以降で最初に文字 c が登場する index (存在しないときは n)
vector<vector<int> > calcNext(const string& S) {
	int n = (int)S.size();
	vector<vector<int> > res(n + 1, vector<int>(26, n));
	for (int i = n - 1; i >= 0; --i) {
		for (int j = 0; j < 26; ++j) res[i][j] = res[i + 1][j];
		res[i][S[i] - 'a'] = i;
	}
	return res;
}

void solv() {
	string s;
	cin >> s;
	int c[30];
	memset(c, 0, sizeof(c));
	for (size_t i = 0; i < s.size(); i++)
	{
		c[s[i] - 'A']++;
	}

	for (size_t i = 0; i < 30; i++)
	{
		if (c[i] == 0) continue;
		if (c[i] != 2) {
			cout << "No" << endl;
			return;
		}
	}
	cout << "Yes" << endl;
}

int main() {
	//	COMinit();
	solv();

	return 0;
}
 

Compiler output:
a.cc:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
a.cc:21:10: fatal error: BinaryIndexedTree1.h: No such file or directory
   21 | #include "BinaryIndexedTree1.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define fi first
#define endl "\n"
#define se second
#define ll long long
//priority_queue<int, vector<int>, greater<int> > pq;
#define _CRT_SECURE_NO_DEPRECATE
const int N = 30030;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
const ll mod =  1e9+7;

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  string s;
  cin>>s;
  set<char> st;
  rep(i,0,4)
  {
  	st.insert(s[i]);
  }
  if(st.size()==2)
  {
  	cout<<"yes";
  	else
  	cout<<"No";
  }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: expected '}' before 'else'
   26 |         else
      |         ^~~~
a.cc:24:3: note: to match this '{'
   24 |   {
      |   ^
a.cc: At global scope:
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

#include <bits/stdc++.h>
//#include <ext/numeric>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define oo 0x3f3f3f3f
#define OO 0x3f3f3f3f3f3f3f3f
#define popcount(n) __builtin_popcount(n)
#define popcountll(n) __builtin_popcountll(n)

using namespace std;
//using namespace __gnu_cxx;
using namespace __gnu_pbds;
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const double PI = acos(-1.0), EPS = 1e-6;
const long long inf = 2e12 + 12;
const int MAXN = 100005, MAXM = 1003, Mod = 1000000007 , MAXLog = 20;



int main() {
#ifndef ONLINE_JUDGE
//    freopen("input.txt", "rt", stdin);
//    freopen("output.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0), cout.precision(9), cout << fixed;

    string s;
    cin >> s;
    set<char> st;
    for (int i = 0; i < s.size(); ++i)
        st.insert(st[i]);

    if (st.size() == 2) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:21: error: no match for 'operator[]' (operand types are 'std::set<char>' and 'int')
   33 |         st.insert(st[i]);
      |                     ^
Language: C++

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

#define int long long
#define pb emplace_back
#define f(i,n) for(int i=0 ; i<n ; i++)
#define F first
#define S second
#define fast ios:: sync_with_stdio(false),cin.tie(0);

int32_t main(){
	fast;
	string s;
	soer(s.begin() , s.end());
	if(s[0]==s[1] && s[2]==s[3])    cout << "YES";
	else    cout << "NO";
}







Compiler output:
a.cc: In function 'int32_t main()':
a.cc:14:9: error: 'soer' was not declared in this scope
   14 |         soer(s.begin() , s.end());
      |         ^~~~
Language: C++

#include<bits/stdc++.h>

#define INF 1000010000
#define nl '\n'
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define fi first
#define se second
#define pii pair<int,int>
#define pdd pair<double,double>
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))
#define sz(c) (c).size()
#define rep(i,n) for( int i = 0; i < n; ++i )
#define repi(i,n) for( int i = 1 ; i <= n; ++i )
#define repn(i,n) for( int i = n - 1 ; i >= 0 ; --i )
#define repf(j,i,n) for( int j = i ; j < n ; ++j )
#define die(s) {std::cout << s << nl;}
#define dier(s) {std::cout << s; return 0;}
#define dbg(var) {std::cout << #var << "  = " << var << nl;}
#define vi vector<int>
typedef long long ll;

using namespace std;


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

	string s;
	cin >> s;
	SORT(s)
	
	cout << (s[0] == s[1] && s[1] != s[2] && s[2] == s[3] ? "Yes" : "No") << nl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:9: error: expected ';' before 'cout'
   37 |         cout << (s[0] == s[1] && s[1] != s[2] && s[2] == s[3] ? "Yes" : "No") << nl;
      |         ^~~~
Language: C

#include<stdio.h>
int main()
{
int ara[ ] = {p1, p2,.....pn};
p1 = 1;
p2 = 2;
pn = n;

int i, pi, n;
if( 1<i<n) {
if (3<=n<=20) {
for (i > 1; 3<=n<=20; i<n) {
printf ("%d", pi);
}
}
}
return 0; 
}

Compiler output:
main.c: In function 'main':
main.c:4:15: error: 'p1' undeclared (first use in this function)
    4 | int ara[ ] = {p1, p2,.....pn};
      |               ^~
main.c:4:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:4:19: error: 'p2' undeclared (first use in this function)
    4 | int ara[ ] = {p1, p2,.....pn};
      |                   ^~
main.c:4:22: error: expected expression before '...' token
    4 | int ara[ ] = {p1, p2,.....pn};
      |                      ^~~
main.c:7:1: error: 'pn' undeclared (first use in this function)
    7 | pn = n;
      | ^~
main.c:7:6: error: 'n' undeclared (first use in this function)
    7 | pn = n;
      |      ^
Language: C++

#include <stdio.h>
int main()
{
  int r,count=0;
  scanf("%d",&r);
  int ar[r];
  for(int i=0;i<r;i++)
  {
    scanf("%d",&ar[i]);
  }
  for(int i=1;i<r-1;i++)
  {
    if((ar[i-1]<ar[i])&&(ar[i]<ar[i+1]))
    {
      count++;
    }
  else((ar[i-1]>ar[i])&&(ar[i]>ar[i+1]))
  {
    count++;
  }
  
  }
  printf("%d\n",count);
  return 0;
  }
  
    
   

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

#include <stdio.h>
int main()
{
  int r,count=0;
  scanf("%d",&r);
  int ar[r];
  for(int i=0;i<n;i++)
  {
    scanf("%d",&ar[i]);
  }
  for(int i=1;i<n-1;i++)
  {
    if((ar[i-1]<ar[i])&&(ar[i]<ar[i+1]))
    {
      count++;
    }
  else((ar[i-1]>ar[i])&&(ar[i]>ar[i+1]))
  {
    count++;
  }
  
  }
  printf("%d\n",count);
  return 0;
  }
  
    
   
 

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'n' was not declared in this scope
    7 |   for(int i=0;i<n;i++)
      |                 ^
a.cc:11:17: error: 'n' was not declared in this scope
   11 |   for(int i=1;i<n-1;i++)
      |                 ^
a.cc:17:41: error: expected ';' before '{' token
   17 |   else((ar[i-1]>ar[i])&&(ar[i]>ar[i+1]))
      |                                         ^
      |                                         ;
   18 |   {
      |   ~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: conflicting declaration 'int a [(a + 15)]'
    6 |     int a[a+15],i,count=0;
      |         ^
a.cc:4:9: note: previous declaration as 'int a'
    4 |     int a;
      |         ^
a.cc:9:22: error: invalid types 'int[int]' for array subscript
    9 |         scanf("%d",&a[i]);
      |                      ^
a.cc:13:12: error: invalid types 'int[int]' for array subscript
   13 |        if(a[i]>a[i-1])
      |            ^
a.cc:13:17: error: invalid types 'int[int]' for array subscript
   13 |        if(a[i]>a[i-1])
      |                 ^
a.cc:15:16: error: invalid types 'int[int]' for array subscript
   15 |            if(a[i]<a[i+1])count++;
      |                ^
a.cc:15:21: error: invalid types 'int[int]' for array subscript
   15 |            if(a[i]<a[i+1])count++;
      |                     ^
a.cc:17:17: error: invalid types 'int[int]' for array subscript
   17 |        else if(a[i]<a[i-1])
      |                 ^
a.cc:17:22: error: invalid types 'int[int]' for array subscript
   17 |        else if(a[i]<a[i-1])
      |                      ^
a.cc:19:16: error: invalid types 'int[int]' for array subscript
   19 |            if(a[i]>a[i+1])count++;
      |                ^
a.cc:19:21: error: invalid types 'int[int]' for array subscript
   19 |            if(a[i]>a[i+1])count++;
      |                     ^
Language: C


#include<stdio.h>
int main()
{
    int n,i,j=0;
    int ar[n];
    for(i = 0;i<n;i++)
    {
        scanf("%d",&ar[i]);
    }
    for(i = 1;i<n-1;i++)
    {
        if(ar[i-1] < ar[i] || ar[i] < ar[i+1])
        {
            j++;
        }
        else if(ar[i-1] > ar[i] || ar[i] > ar[i+1])
        {
            j++;
        }
        printf("%d\n",j)
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:21:25: error: expected ';' before '}' token
   21 |         printf("%d\n",j)
      |                         ^
      |                         ;
   22 |     }
      |     ~
Language: C

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


}

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

#include<stdio.h>
int main()
{
int n,i,j,k,m=0;
scanf("%d",&n);
int str[n+5];
for(i=0;i<n;i++)
{
scanf("%d",&str[i]);
}
for(i=1;i<n-1;i++)
{
if(str[i-1]<str[i])
{
if(str[i]<str[i+1])
c++;
}
else if(str[i-1]>str[i])
{ 
if(str[i]>str[i+1])
c++;
}
}
printf("%d\n",c);
}

Compiler output:
main.c: In function 'main':
main.c:16:1: error: 'c' undeclared (first use in this function)
   16 | c++;
      | ^
main.c:16:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>//cout<<right で右揃え
#include <iomanip>//cout<<setw(数字) で空白による桁揃え
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <algorithm>
#include <cstdlib>//abs()で整数絶対値
#include <cmath>//abs()かfabs()で少数絶対値
#include <functional>//sort第三引数greater<型名>()で降順
#include <map>

using namespace std;
using ll = long long int;

int main(){
    int n;cin>>n;
    int ans = 0;
    vector<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])||(p[i-1]>p[i]&&p[i])>p[i+1]) ans++;    
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:43: error: expected ')' before ']' token
   21 |     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]) ans++;
      |                               ~           ^
      |                                           )
a.cc:21:93: error: expected ')' before ';' token
   21 |     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]) ans++;
      |                              ~                                                              ^
      |                                                                                             )
Language: C++

#include <iostream>//cout<<right で右揃え
#include <iomanip>//cout<<setw(数字) で空白による桁揃え
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <algorithm>
#include <cstdlib>//abs()で整数絶対値
#include <cmath>//abs()かfabs()で少数絶対値
#include <functional>//sort第三引数greater<型名>()で降順
#include <map>

using namespace std;
using ll = long long int;

int main(){
    int n;cin>>n;
    int ans = 0;
    vector<int> p(n);
    for(int i=0;i<n;i++) cin >> p[n];
    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]) ans++;    
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:43: error: expected ')' before ']' token
   21 |     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]) ans++;
      |                               ~           ^
      |                                           )
a.cc:21:93: error: expected ')' before ';' token
   21 |     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]) ans++;
      |                              ~                                                              ^
      |                                                                                             )
Language: C++

/*
      author  : nishi5451
      created : 15.08.2020 11:04:08
*/

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


int main(){
    int n;
    cin >> n;
    vector<int> p(n);
    rep(i,n) cin >> p[i];
    int ans = 0;
    for(int i=1; i<n-1){
        if( (p[i]<p[i+1] && p[i-1]<p[i]) || (p[i+1]<p[i] && p[i]<p[i-1]) ) 
            ans++;
    }
    cout << ans << endl;
    return 0;
}

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

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


int main() {
  int n ; 
  cin >> n ; 
  vector<int> p(n) ; 
  int cnt = 0 ; 
  
  for(int i = 0 ; i<n ; i++){
    cin >> p.at(i) ; 
  }
  
  for(int i = 1 ;   i < n-1 ; i++){
    if( p.at(i-1) < p.at(i) && p.at(i) < p.at(i+1)){
      cnt++ ; 
    }
    else( p.at(i-1)> p.at(i) && p.at(i) > p.at(i+1)){
      cnt++ ; 
    }
  }
  
  cout << cnt << endl ; 
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:53: error: expected ';' before '{' token
   19 |     else( p.at(i-1)> p.at(i) && p.at(i) > p.at(i+1)){
      |                                                     ^
      |                                                     ;
Language: C++

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


int main() {
  int n ; 
  cin >> n ; 
  vector<int> p(n) ; 
  int cnt = 0 ; 
  
  for(int i = 0 ; i<n ; i++){
    cin >> p.at(i) ; 
  }
  
  for(int i = 1 ;   i < n-1 ; i++){
    if( p.at(i-1) < p.at(i) && p.at(i) < p.at(i+1)){
      cnt++ ; 
    }
    else( p.at(i-1)> p.at(i) && p.at(i) > p.at(i+1))
      cnt++ ; 
  }
  
  cout << cnt << endl ; 
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:53: error: expected ';' before 'cnt'
   19 |     else( p.at(i-1)> p.at(i) && p.at(i) > p.at(i+1))
      |                                                     ^
      |                                                     ;
   20 |       cnt++ ;
      |       ~~~
Language: C++

#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define int long long
#define double long long
using namespace std;
signed main() {
	int n;
	cin >> n;
	int A = 0;
	int B = 0;
	vector<int>p(n);
	for (int i = 0; i < n; i++) {
		cin >> p.at(i);
    }
  for(int i=0;i<n;++i){
		if ( p.at(i + 1)- p.at(i)==1 &&  p.at(i + 2)- p.at(i + 1)==1) {

			A++;
		}
		else if(p.at(i) - p.at(i + 1)==1 && p.at(i + 1) - p.at(i + 3)==1) {
			B++;
		}
	}
}
	cout << A+B << endl;
}


Compiler output:
a.cc:57:9: error: 'cout' does not name a type
   57 |         cout << A+B << endl;
      |         ^~~~
a.cc:58:1: error: expected declaration before '}' token
   58 | }
      | ^
Language: C++

#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define int long long
#define double long long
using namespace std;
signed main() {
	int n;
	cin >> n;
	int A = 0;
	int B = 0;
	vector<int>p(n);
	for (int i = 0; i < n; i++) {
		cin >> p.at(i);
    }
		if ( p.at(i + 1)- p.at(i)==1 &&  p.at(i + 2)- p.at(i + 1)==1) {

			A++;
		}
		else if(p.at(i) - p.at(i + 1)==1 && p.at(i + 1) - p.at(i + 3)==1) {
			B++;
		}
	}
	cout << A+B << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:27: error: 'i' was not declared in this scope
   47 |                 if ( p.at(i + 1)- p.at(i)==1 &&  p.at(i + 2)- p.at(i + 1)==1) {
      |                           ^
a.cc: At global scope:
a.cc:55:9: error: 'cout' does not name a type
   55 |         cout << A+B << endl;
      |         ^~~~
a.cc:56:1: error: expected declaration before '}' token
   56 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

int main() {
 int n;
 cin >> n;
 vector<int> p(n);
 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;
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:2: error: 'vector' was not declared in this scope
    7 |  vector<int> p(n);
      |  ^~~~~~
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:7:9: error: expected primary-expression before 'int'
    7 |  vector<int> p(n);
      |         ^~~
a.cc:8:36: error: 'p' was not declared in this scope
    8 |  for(int i = 0; i < n; i++) cin >> p[i];
      |                                    ^
a.cc:11:6: error: 'p' was not declared in this scope
   11 |  if((p[i - 1] < p[i]) && (p[i] < p[i + 1])) ans++;
      |      ^
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();    	
      	int[] p = new int[n];
      	int mid = 0;
      	int count = 1;
        for(int i = 0; i < a.length; ++i){
          p[i] = sc.nextInt();
        } 
        for(int i = 0; i <(n-2); i++){
            mid = p[(i+1)];
            if(mid > p[i] && mid < p[(i+2)]){
            count += 1; 
            }if(mid < p[i] && mid > p[(i+2)]){
            count += 1; 
            }
        }
       
      System.out.println(count);
    }
}


Compiler output:
Main.java:9: error: cannot find symbol
        for(int i = 0; i < a.length; ++i){
                           ^
  symbol:   variable a
  location: class Main
1 error
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();    	
      	int[] p = new int[n];
      	int mid = 0;
      	int count = 1;
        for(int i = 0; i < a.length; ++i){
          p[i] = sc.nextInt();
        } 
        for(int i = 0; i <(n-1); i++){
            mid = p[(i+1)];
            if(mid > p[i] && mid < p[(i+2)]){
            count += 1; 
            }if(mid < p[i] && mid > p[(i+2)]){
            count += 1; 
            }
        }
       
      System.out.println(count);
    }
}


Compiler output:
Main.java:9: error: cannot find symbol
        for(int i = 0; i < a.length; ++i){
                           ^
  symbol:   variable a
  location: class Main
1 error
Language: Java

public class Main {
	public static void main(String[] args){
       Scanner sc = new Scanner(System.in);
      
      // 値の取得
	  int n = sc.nextInt();
      int[] p = new int[n];
      for(int i=0;i<n;i++){
        p[i] = sc.nextInt();
      }
      int count = 0;
      
      for(int i=1;i<n-1;i++){
        if(p[i-1]<p[i] && p[i]<p[i+1]){
        count++;
        }
      }
      System.out.println(count);
    }
}

Compiler output:
Main.java:3: error: cannot find symbol
       Scanner sc = new Scanner(System.in);
       ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
       Scanner sc = new Scanner(System.in);
                        ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

public class Main {
    public static void main(String[] args) throws Exception {
        //値を取得
        Scanner sc = new Scanner(System.in);
       int n = sc.nextInt();
       int[] p = new int[n];
       for (int i = 0; i < n; ++i){
           p[i] = sc.nextInt();
       }
       
       int count = 0;   //カウント用の変数
       //条件を満たすものをカウント
       for (int i = 0; i < (n-2); ++i){ //要素数がn個の配列に対し、n-2回調べる
           if (p[i] < p[i+1] && p[i+1] < p[i+2] || p[i] > p[i+1] && p[i+1] > p[i+2]){
               ++count;
           }
       }
       
        //出力
        System.out.println(count);
    }
}

Compiler output:
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
 
int main() {
    int n;
    cin >> n;
    vector<int> p(n);
    rep(i,n) cin >> p.at(i);
    int count=0;
    rep(i,n-2){
        if((p.at(i)-p.at(i+1))*(p.at(i+2)-p.at(i+1)<0)count++;
    }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:55: error: expected ';' before 'count'
   15 |         if((p.at(i)-p.at(i+1))*(p.at(i+2)-p.at(i+1)<0)count++;
      |                                                       ^~~~~
      |                                                       ;
a.cc:16:5: error: expected primary-expression before '}' token
   16 |     }
      |     ^
a.cc:15:63: error: expected ')' before '}' token
   15 |         if((p.at(i)-p.at(i+1))*(p.at(i+2)-p.at(i+1)<0)count++;
      |           ~                                                   ^
      |                                                               )
   16 |     }
      |     ~                                                          
a.cc:16:5: error: expected primary-expression before '}' token
   16 |     }
      |     ^
Language: Java

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

public class Main{
  
  public static void main (String [] args){
    
    Scanner scanner = new Scanner(System.in);     
    //数値を入力できるように設定
    
    int num1 = scanner.nextInt();
    //数値を入力するための箱を作成
    
    int a [ ] = new int [num1];
    //入力した数値の値分の要素数を持つ配列aを準備
    
    for(int i = 1; i < a.length - 1; i++) {
      //配列の要素数の分だけループを繰り返す
      
      a[i]=scanner.nextInt();
      //指定した型を読み込むための設定
      int t = 0;
      //該当するpiの数を蓄積するための箱を用意する
      
      if((a[i-1] < a[i]) && (a[i] < a[i + 1])){
        t++;  //該当するpiをサーチする工程
      } else if ((a[i - 1] > a[i]) && (a[i] > a[i+1])) {
        t++;  //該当するpiをサーチする工程
      } else if ((a[i - 1] > a[i]) || (a[i] > a[i+1])) {
        break;  //該当するpiをサーチする工程
      } else if ((a[i - 1] < a[i]) || (a[i] < a[i+1])){
        break;  //該当するpiをサーチする工程
      }
    }
    
    System.out.println(Arrays.toString(a));
    //これは何の処理？
    
    System.out.println(t);
    //該当するpiの表示処理
 
    scanner.close();
    
  }
  
}

Compiler output:
Main.java:40: error: cannot find symbol
    System.out.println(t);
                       ^
  symbol:   variable t
  location: class Main
1 error
Language: C

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,p[30],m=0;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>p[i];
	}
	for(int i=1;i<n-1;i++)
	{
		if(((p[i]>p[i-1])&&(p[i]<p[i+1]))||((p[i]>p[i+1])&&(p[i]<p[i-1])))
		{
			m++;
		}
	}
	cout<<m<<endl;
}

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