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

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

int main(){
	string s;
  	cin>>s;
  	map<int> mp;
  	for(int i=0;i<s.length();i++){
      mp[s[i]]++;
    }
  	bool flag = true;;
  	for(auto x:mp){
      if(x.second!=f){
        flag = false;
      }
    }
  	if(flag)
      cout<<"YES"<<endl;
  	else
      cout<<"NO"<<endl;
  
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: wrong number of template arguments (1, should be at least 2)
    7 |         map<int> mp;
      |                ^
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:9:9: error: invalid types 'int[__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}]' for array subscript
    9 |       mp[s[i]]++;
      |         ^
a.cc:12:20: error: 'begin' was not declared in this scope
   12 |         for(auto x:mp){
      |                    ^~
a.cc:12:20: 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:12:20: error: 'end' was not declared in this scope
   12 |         for(auto x:mp){
      |                    ^~
a.cc:12:20: 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
      |   ^~~
a.cc:13:20: error: 'f' was not declared in this scope
   13 |       if(x.second!=f){
      |                    ^
Language: C

#include<stdio.h>
int main(){
  char s[5];
  scanf("%s",s);
  int count=0;
  for(int i=0;i<4;i++){
    for(int j=i+1;j<4;j++){
      if(a[i]==a[j])
        count++;
    }
  }
  if(count!=1)
    printf("No");
  else
    printf("Yes");
}

Compiler output:
main.c: In function 'main':
main.c:8:10: error: 'a' undeclared (first use in this function)
    8 |       if(a[i]==a[j])
      |          ^
main.c:8:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

	
	else
	puts("No");
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:9: error: 'else' without a previous 'if'
   10 |         else if(s[0]==s[1]&&s[2]==s[3]){
      |         ^~~~
Language: C++

#include <iostream>

using namespace std;

int main()
{
    string s;
    char a1 , a2;
    cin >> s;
    a1 = s[0];
    if (s[1] == a1){
        if (s[2] == a1){
            cout << "No";
            return 0;
        }else if (s[3] == a1){
            cout << "No";
            return 0;
        }else if (s[2] == s[3]){
            cout << "Yes";
            return 0;
        }else{
            cout << "No";
            return 0;
        }
    }else{
        a2 = s[1];
        if (s[2] == a1){
            if (s[3] == a2]){
                cout << "Yes";
                return 0;
            }else{
                cout << "No";
                return 0;
            }
        }else if (s[2] == a2){
            if (s[3] == a1){
                cout << "Yes";
                return 0;
            }else{
                cout << "No";
                return 0;
            }
        }else{
            cout << "No";
            return 0;
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:27: error: expected ')' before ']' token
   28 |             if (s[3] == a2]){
      |                ~          ^
      |                           )
a.cc:28:27: error: expected primary-expression before ']' token
Language: C++

#include <iostream>

using namespace std;

int main()
{
    string s;
    char a1 , a2;
    int b1 , b2;
    cin >> s;
    s[0] = char a1;
    b1++;
    if (s[1] == a1){
        b1++;
    }else{
        s[1] = char a2;
        b2++;
    }
    if (s[2] == a1){
        b1++;
    }else if (s[2] == a2){
        b2++;
    }else{
        cout << "No";
        return 0;
    }
    if (s[3] == a1){
        b1++;
    }else if (s[3] == a2){
        b2++;
    }else{
        cout << "No";
        return 0;
    }
    if (b1 == 2 && b2 == 2){
        cout << "Yes";
    }else{
        cout << "No";
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: expected primary-expression before 'char'
   11 |     s[0] = char a1;
      |            ^~~~
a.cc:16:16: error: expected primary-expression before 'char'
   16 |         s[1] = char a2;
      |                ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: expected unqualified-id before '(' token
   14 |   else if(A.(0) == A.at(2)) {
      |             ^
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main()
{
  string s;
  cin>>s;
  if(((s[0]==s[1]&&s[2]==s[3])||(s[0]==s[3]&&s[2]==s[1])||(s[0]==s[2]&&s[1]==s[3]))!&(s[0]==s[1]&&s[1]==s[2]&&s[2]==s[3]))
    cout<<"Yes";
  else cout<<"No";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:84: error: expected ')' before '!' token
    8 |   if(((s[0]==s[1]&&s[2]==s[3])||(s[0]==s[3]&&s[2]==s[1])||(s[0]==s[2]&&s[1]==s[3]))!&(s[0]==s[1]&&s[1]==s[2]&&s[2]==s[3]))
      |     ~                                                                              ^
      |                                                                                    )
Language: C++

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
typedef long long ll;

int main(){
  vector<char> s(4);
  rep(i,4) cin >> s.at(i);

  if(s.at(0)==s.at(1)&&s.at(1)==s.at(2)&&s.at(2)==s.at(3)) cout << "No"
  else if(s.at(0)==s.at(1)&&s.at(2)==s.at(3)) cout << "Yes";
  else if(s.at(0)==s.at(2)&&s.at(1)==s.at(3)) cout << "Yes";
  else if(s.at(0)==s.at(3)&&s.at(1)==s.at(2)) cout << "Yes";
  else cout << "No";
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:72: error: expected ';' before 'else'
   12 |   if(s.at(0)==s.at(1)&&s.at(1)==s.at(2)&&s.at(2)==s.at(3)) cout << "No"
      |                                                                        ^
      |                                                                        ;
   13 |   else if(s.at(0)==s.at(1)&&s.at(2)==s.at(3)) cout << "Yes";
      |   ~~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;

int main(){
  string s,a,b,c,d;
  cin >> s;
  s1[0]= a;
  s2[1]= b;
  s3[2]= c;
  s4[3]= d;
  if(a==b||a==c||a==d||b==c||b==d||c==d){
    cout << "Yes";else{
    cout << "No";}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 's1' was not declared in this scope; did you mean 's'?
    8 |   s1[0]= a;
      |   ^~
      |   s
a.cc:9:3: error: 's2' was not declared in this scope; did you mean 's'?
    9 |   s2[1]= b;
      |   ^~
      |   s
a.cc:10:3: error: 's3' was not declared in this scope; did you mean 's'?
   10 |   s3[2]= c;
      |   ^~
      |   s
a.cc:11:3: error: 's4' was not declared in this scope; did you mean 's'?
   11 |   s4[3]= d;
      |   ^~
      |   s
a.cc:13:19: error: expected '}' before 'else'
   13 |     cout << "Yes";else{
      |                   ^~~~
a.cc:12:41: note: to match this '{'
   12 |   if(a==b||a==c||a==d||b==c||b==d||c==d){
      |                                         ^
Language: C++

#include<iostream>
#include<string>
using namespace std;

int main(){
  string s,a,b,c,d;
  cin >> s;
  s1[0]= a;
  s2[1]= b;
  s3[2]= c;
  s4[3]= d;
  if(a==b||a==c||a==d||b==c||b==d||c==d){
    cout << "Yes";else{
    cout << "No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 's1' was not declared in this scope; did you mean 's'?
    8 |   s1[0]= a;
      |   ^~
      |   s
a.cc:9:3: error: 's2' was not declared in this scope; did you mean 's'?
    9 |   s2[1]= b;
      |   ^~
      |   s
a.cc:10:3: error: 's3' was not declared in this scope; did you mean 's'?
   10 |   s3[2]= c;
      |   ^~
      |   s
a.cc:11:3: error: 's4' was not declared in this scope; did you mean 's'?
   11 |   s4[3]= d;
      |   ^~
      |   s
a.cc:13:19: error: expected '}' before 'else'
   13 |     cout << "Yes";else{
      |                   ^~~~
a.cc:12:41: note: to match this '{'
   12 |   if(a==b||a==c||a==d||b==c||b==d||c==d){
      |                                         ^
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<string>
using namespace std;

int main(){
  string s,a,b,c,d;
  cin >> s;
  s1[0]= a;
  s2[1]= b;
  s3[2]= c;
  s4[3]= d;
  if(a==b||a==c||a==d||b==c||b==d||c==d){
    cout << "Yes"}else{
    cout << "No"}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 's1' was not declared in this scope; did you mean 's'?
    8 |   s1[0]= a;
      |   ^~
      |   s
a.cc:9:3: error: 's2' was not declared in this scope; did you mean 's'?
    9 |   s2[1]= b;
      |   ^~
      |   s
a.cc:10:3: error: 's3' was not declared in this scope; did you mean 's'?
   10 |   s3[2]= c;
      |   ^~
      |   s
a.cc:11:3: error: 's4' was not declared in this scope; did you mean 's'?
   11 |   s4[3]= d;
      |   ^~
      |   s
a.cc:13:18: error: expected ';' before '}' token
   13 |     cout << "Yes"}else{
      |                  ^
      |                  ;
a.cc:14:17: error: expected ';' before '}' token
   14 |     cout << "No"}
      |                 ^
      |                 ;
Language: C++

#include<iostream>
using namespace std;
int main(){
  string s;
  cin >> s;
  int a=s[0]-'0',b=s[1]-'0',c=s[2]-'0',d=s[3]-'0';
  if(a==b && c==d && a!=c){
    cout << "Yes" << endl;
  }
  else if(a==c && b==d && a!=b){
    cout << "Yes" << endl;
  }
  else if(a==d && b==c && a!=b){
    cout << "Yes" << endl;
  }

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

 #include<iostream>
using namespace std;
int main(){
 string d;
  cin>>s;
  if hgytfredswaq

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: 's' was not declared in this scope
    5 |   cin>>s;
      |        ^
a.cc:6:6: error: expected '(' before 'hgytfredswaq'
    6 |   if hgytfredswaq
      |      ^~~~~~~~~~~~
      |      (
a.cc:6:18: error: expected '}' at end of input
    6 |   if hgytfredswaq
      |                  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  string a;
  cin >> a;
 if(a1 =="ASSA")
   cout << Yes << endl;
  else{
    cout << No << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'a1' was not declared in this scope; did you mean 'a'?
    6 |  if(a1 =="ASSA")
      |     ^~
      |     a
a.cc:7:12: error: 'Yes' was not declared in this scope
    7 |    cout << Yes << endl;
      |            ^~~
a.cc:9:13: error: 'No' was not declared in this scope
    9 |     cout << No << endl;
      |             ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin>>S;
  map<char,int>mp;
  vector<int>A(0);
  for(int X=0;X<N;X++){
    mp[S[X]]++;
  }
  for(auto p:mp){
    auto V=p.second;
    A.push_back(V);
  }
  if(A.size()==2&&A[0]==2&&A[1]==2){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'N' was not declared in this scope
    8 |   for(int X=0;X<N;X++){
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
signed main(){
  string s;
  cin>>s;
  unordered_map<char,ll> m;
  for(int i=0;i<4;i++){
    m[s[i]]++;
  }
  for(auto p:m){
    if(p.second!=2){
      cout<<"No"<<endl;
      return 0;
    }
  }
  cout<<"Yes"<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:22: error: 'll' was not declared in this scope
    6 |   unordered_map<char,ll> m;
      |                      ^~
a.cc:6:24: error: template argument 2 is invalid
    6 |   unordered_map<char,ll> m;
      |                        ^
a.cc:6:24: error: template argument 5 is invalid
a.cc:8:6: error: invalid types 'int[__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}]' for array subscript
    8 |     m[s[i]]++;
      |      ^
a.cc:10:14: error: 'begin' was not declared in this scope
   10 |   for(auto p:m){
      |              ^
a.cc:10:14: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/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:14: error: 'end' was not declared in this scope
   10 |   for(auto p:m){
      |              ^
a.cc:10:14: 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:
signed main(){
  string s;
  cin>>s;
  unordered_map<string,ll> m;
  for(int i=0;i<4;i++){
    m[s[i]]++;
  }
  for(auto p:m){
    if(p.second!=2){
      cout<<"No"<<endl;
      return 0;
    }
  }
  cout<<"Yes"<<endl;
  return 0;
}

Compiler output:
a.cc:2:20: error: expected ';' before ':' token
    2 | using namespace std:
      |                    ^
      |                    ;
a.cc:2:20: error: expected unqualified-id before ':' token
Language: Java

#include <iostream>

using namespace std;

int main(){
    char name[4];
    cin >> name;
    int count1 = 0;
    int count2 = 0;

    if (name[0] == name[1]){
        count1 = 2;
        if (name[2] == name[3]){
            count2 = 2;
        }
    }
    else{
        if (name[0] == name[2]){
            count1 = 2;
            if (name[1] == name[3]){
                count2 = 2;
            }
        }
        else{
            if (name[0] == name[3]){
                count1 = 2;
                if (name[1] == name[2]){
                    count2 = 2;
                }
            }
        }
    }

    if ((count1 == 2) && (count2 == 2)){
        cout << "Yes" << "\n";
    }
    else{
        cout << "No" << "\n";
    }
    return 0;
}



Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:1: error: class, interface, enum, or record expected
#include <iostream>
         ^
Main.java:7: error: not a statement
    cin >> name;
        ^
Main.java:35: error: not a statement
        cout << "Yes" << "\n";
                      ^
Main.java:38: error: not a statement
        cout << "No" << "\n";
                     ^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
  (use --enable-preview to enable unnamed classes)
Main.java:6: error: ']' expected
    char name[4];
              ^
7 errors
Language: C++

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

int main() {
  string s;
  cin  >> s;
  rep(char i='a'; i<='z'; i++){
    char s=i;
    if(count.(s,i)!=2&&count.(s,i)!=0){
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}


Compiler output:
a.cc:8:30: error: macro "rep" requires 2 arguments, but only 1 given
    8 |   rep(char i='a'; i<='z'; i++){
      |                              ^
a.cc:3:9: note: macro "rep" defined here
    3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'rep' was not declared in this scope
    8 |   rep(char i='a'; i<='z'; i++){
      |   ^~~
Language: C++

#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<cmath>
#include<cstring>
#include<set>
#include<climits>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define sort(a) sort(a.begin(),a.end())
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define size(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*pi*/double pi=acos(-1);
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
/*Fibonacci数列*/ll fib(ll x){ll i,fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
///*二進数割り算*/div2(ll x,ll y){}
llfor;ll ans=0;////////////////////////////////////////////////////////////
int main(){
 char s[5];
 sc(s);
 if((s[0]==s[1]&&s[2]==s[3])||(s[0]==s[2]&&s[1]==s[3])||(s[0]==s[3]&&s[1]==s[2])||)py;
 else pn;
 return 0;
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:83: error: expected primary-expression before ')' token
   55 |  if((s[0]==s[1]&&s[2]==s[3])||(s[0]==s[2]&&s[1]==s[3])||(s[0]==s[3]&&s[1]==s[2])||)py;
      |                                                                                   ^
Language: C++

#include <iostream>
using namespace std;

int main()
{
  string s, res = "No";
  cin >> s;
  for(int i = 0; i < s.size(); i++)
  {
    if(s[0] == s[i])
    {
      switch i
      {
        case 1:
          if(s[2] == s[3]) res = "Yes";
          break;
        case 2:
          if(s[1] == s[3]) res = "Yes";
          break;
        case 3:
          if(s[1] == s[2]) res = "Yes";
          break;
        default:
          break;
      }
      break;
    }
  }
  cout << res << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: expected '(' before 'i'
   12 |       switch i
      |              ^
      |              (
Language: C++

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

int main(){
    string s;
    cin>>s;
    char t=s[0];
    for(int i=1;i<4;i++){
    if(s[1]!=s[0]){
        if(s[2]!=s[0]){
            if(s[3]==s[0]&&s[2]==s[1]){printf("Yes");return 0;}
            else{printf("No");return 0;}
        }
        else{
            if(s[1]==s[3]){printf("Yes");return 0;}
            else{printf("No");return 0;}
        }
    }
    else if(s[2]!=s[0]){
        if(s[2]==s[3]){printf("Yes");return 0;}
        else{printf("No");return 0;}
    }
    else{printf("No");return 0;}

}

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

//Author- VMAX


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_multiset tree<long long , null_type,less_equal<long long >, rb_tree_tag,tree_order_statistics_node_update>
#define ordered_set tree<long long , null_type,less<long long >, rb_tree_tag,tree_order_statistics_node_update>
using namespace std;
#define ll long long int
#define YES cout<<"YES"<<"\n";
#define NO cout<<"NO"<<"\n";
#define ld     long double 
#define yes cout<<"yes"<<"\n";
#define no cout<<"no"<<"\n";
#define No cout<<"No"<<"\n";
#define Yes cout<<"Yes"<<"\n";
#define f(i,a) for(i=0;i<a;i++)
#define fo(i,a) for(i=1;i<=a;i++)
#define fa(i,a) for(auto i:a)
#define r(i,a) for(auto i=a.rbegin();i!=a.rend();i++)
#define en cout<<"\n";
#define ull unsigned long long int
#define o(x) cout<<x<<"\n";
#define o1(x) cout<<x<<" ";
#define pb push_back
#define F first
#define in insert
#define mp make_pair
#define S second
#define pre(n) cout<<fixed<<setprecision(n);
#define      gcd(a,b)    __gcd(a,b)
#define bs            binary_search
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define test ll t;cin>>t;while(t-->0)
const ll Mod = 998244353;
#define mod 1000000007
#define pi 3.14159265358979323846
#define all(x) x.begin(),x.end()
#define re return 0;
// *#######################################################################################*

/*
bool isp(ll n)
{
    ll i;
    for(i=2;i*i<=n;i++)
    {
        if(n%i==0)
        {
            return false;
        }
        
    }
}
  */
  ll powerm(ll x, unsigned ll y, ll p)  
{  
    ll res = 1;    
  
    x = x % p; 
   
    if (x == 0) return 0;
  
    while (y > 0)  
    {  
        if (y & 1)  
            res = (res*x) % p;  
   
        y = y>>1; // y = y/2  
        x = (x*x) % p;  
    }  
    return res;  
}
  long long lcm(long long a, long long b){//最小公倍数を求める
   return a * b / gcd(a, b);
}
//ll ss[2][(1<<22)+10];
       int main()
       
       {
        fast
    
         
        string s;
        cin>>s;
        sort(all(s));
        if(s[0]==s[1]&&s[2]==s[3]&&s[0]!=s[2])
        {
            YES
        }
    else
    {
        NO
    }
    
    
    
    
    
    
    
        
       }
          re
}


Compiler output:
a.cc:41:12: error: expected unqualified-id before 'return'
   41 | #define re return 0;
      |            ^~~~~~
a.cc:106:11: note: in expansion of macro 're'
  106 |           re
      |           ^~
a.cc:107:1: error: expected declaration before '}' token
  107 | }
      | ^
Language: C++

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

int main(){
  string S;
  cin >> S;
  if(S.at(0)==S.at(1)&&S.at(2)==S.at(3){
    cout << "Yes" << endl;
  }
  else if(S.at(0)==S.at(2)&&S.at(3)==S.at(1)){
    cout << "Yes" << endl;
  }
  else if(S.at(0)==S.at(3)&&S.at(2)==S.at(1)){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:40: error: expected ')' before '{' token
    7 |   if(S.at(0)==S.at(1)&&S.at(2)==S.at(3){
      |     ~                                  ^
      |                                        )
a.cc:19:1: error: expected primary-expression before '}' token
   19 | }
      | ^
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String s1[] = s.split("");
    Arrays.sort(s1);
    if (!(s1[0].equals(s1[3])){
      if (s1[0].equals(s1[1]) && s1[2].equals(s1[3])){
        System.out.println("Yes");
      }
    }else{
      System.out.println("No");
    }
  }
}


Compiler output:
Main.java:9: error: ')' expected
    if (!(s1[0].equals(s1[3])){
                              ^
1 error
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    char[] c = str1.toCharArray();
    String s1 = new String(c);
    String ans1 = s1.substring(0, 2);
    String ans2 = s1.substring(s1.length(), -2);
    System.out.println(ans1.equals(ans2) ? "Yes" : "No");
  }
}

Compiler output:
Main.java:7: error: cannot find symbol
    char[] c = str1.toCharArray();
               ^
  symbol:   variable str1
  location: class Main
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  vector<string> vec;
  for(int i=0;i<4;i++){
  	string a;cin>>a[i];
  	vec.push_back(a);
  }
  sort(vec.begin(),vec.end());
  if(a[0]==a[1]&&a[2]==a[3])cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: 'a' was not declared in this scope
   10 |   if(a[0]==a[1]&&a[2]==a[3])cout<<"Yes"<<endl;
      |      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  vector<string> a;
  for(int i=0;i<4;i++){
  	cin>>a[i];
  	vec.push_back(a);
  }
  if(a[0]==a[1]&&a[2]==a[3])cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'vec' was not declared in this scope
    7 |         vec.push_back(a);
      |         ^~~
Language: C

#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
char s[10];
scanf("%s", s);
if(s[0] == s[1] && s[1] != s[2] && s[2] == s[3])printf("Yes\n");
else if(s[0] == s[2] && s[2] != s[1] && s[1] == s[3])printf("Yes\n");
else if(s[0] == s[3] && s[3] != s[1] && s[1] == s[2])printf("Yes\n");
else printf("No\n");
}

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

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

int main(){
  
  string a;
  int b = -4;
  cin >> a;
  
  for(int i;i<4;i++){
    for(int j;j<4;j++){
      
  if(a.at(i) == a.at(j)){
    
    b++;
    
  }
    
  }
  
  if( b/3 == 2 ){
    
    cout << "Yes" << endl;
    
  }
  
  else{
    
    cout << "No" << endl;
    
  }
  
}



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

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

int main(){
  
  string a;
  int b = -4;
  cin >> a;
  
  for(int i;i<4;i++){
    for(int j;j<4;j++){
      
  if(a.at(i) == a.at(j)){
    
    b++;
    
    b = b/3;
    
  }
    
  }
  
  if( b == 2 ){
    
    cout << "Yes" << endl;
    
  }
  
  else{
    
    cout << "No" << endl;
    
  }
  
}



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

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

int main(){
  
  string a;
  int b = -4;
  cin >> a;
  
  for(int i;i<4;i++){
    for(int j;j<4;j++){
      
      a.at(i) == a.at(j);
    
    b++;
    
  }
  
  if( b == 2 ){
    
    cout << "Yes" << endl;
    
  }
  
  else{
    
    cout << "No" << endl;
    
  }
  
}



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

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

int main(){
  
  string a;
  int b == 0;
  cin >> a;
  
  if( a.at(0) == a.at(1) || a.at(1) == a.at(2) || a.at(2) == a.at (3) || a.at(3) == a.at(0) ){
    
    b++;
    
  }
  
  if( b == 2 ){
    
    cout << "Yes" << endl;
    
  }
  
  else{
    
    cout << "No" << endl;
    
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: expected initializer before '==' token
    7 |   int b == 0;
      |         ^~
a.cc:12:5: error: 'b' was not declared in this scope
   12 |     b++;
      |     ^
a.cc:16:7: error: 'b' was not declared in this scope
   16 |   if( b == 2 ){
      |       ^
Language: C++

#include <iostream>
using namespace std;

char S[4];

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: expected ')' before '$$'
    8 |   if(S[0] == S[1] $$ S[2] == S[3]){
      |     ~            ^~~
      |                  )
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  string s;
  cin >> s;
  vector<string> a;
  rep(i,4){
    a.push_back(s.at(i));
  }
  sort(a.begin(),a.end());
  if(a.at(0) == a.at(1) && a.at(2) == a.at(3)) cout << "Yes" << endl;
  else cout << "No" << endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
    9 |     a.push_back(s.at(i));
      |     ~~~~~~~~~~~^~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::vector<std::__cxx11::basic_string<char> >::value_type&' {aka 'const std::__cxx11::basic_string<char>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::vector<std::__cxx11::basic_string<char> >::value_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i, n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int main() {
  IOS;
  string s; cin >> s;
  map<char,int> m;
  for(char c: s) {
    m[c]++;
  }

  int ok = true;
  for(char c: s) if (m[c] != 2) ok=false;
  Yea(ok);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:3: error: 'Yea' was not declared in this scope; did you mean 'Yes'?
   34 |   Yea(ok);
      |   ^~~
      |   Yes
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>;
const int INF = INT32_MAX;
const ll INFL = INT64_MAX;
const int mod = 1e9;

template <typename T>
void print_vec(vector<T> v) {
  for (T i : v) cout << i << " ";
  cout << endl;
}

int main() {
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  if (s[0] == s[1] && s[2] == s[3] && s[0] != s[2])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | =#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: expected unqualified-id before '=' token
    1 | =#include <bits/stdc++.h>
      | ^
a.cc:5:11: error: 'pair' does not name a type
    5 | using P = pair<int, int>;
      |           ^~~~
a.cc:6:17: error: 'INT32_MAX' was not declared in this scope
    6 | const int INF = INT32_MAX;
      |                 ^~~~~~~~~
a.cc:1:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
  +++ |+#include <cstdint>
    1 | =#include <bits/stdc++.h>
a.cc:7:17: error: 'INT64_MAX' was not declared in this scope
    7 | const ll INFL = INT64_MAX;
      |                 ^~~~~~~~~
a.cc:7:17: note: 'INT64_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc:11:6: error: variable or field 'print_vec' declared void
   11 | void print_vec(vector<T> v) {
      |      ^~~~~~~~~
a.cc:11:16: error: 'vector' was not declared in this scope
   11 | void print_vec(vector<T> v) {
      |                ^~~~~~
a.cc:11:24: error: expected primary-expression before '>' token
   11 | void print_vec(vector<T> v) {
      |                        ^
a.cc:11:26: error: 'v' was not declared in this scope
   11 | void print_vec(vector<T> v) {
      |                          ^
a.cc: In function 'int main()':
a.cc:17:3: error: 'string' was not declared in this scope
   17 |   string s;
      |   ^~~~~~
a.cc:18:3: error: 'cin' was not declared in this scope
   18 |   cin >> s;
      |   ^~~
a.cc:18:10: error: 's' was not declared in this scope
   18 |   cin >> s;
      |          ^
a.cc:19:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   19 |   sort(s.begin(), s.end());
      |   ^~~~
      |   short
a.cc:21:5: error: 'cout' was not declared in this scope
   21 |     cout << "Yes" << endl;
      |     ^~~~
a.cc:21:22: error: 'endl' was not declared in this scope
   21 |     cout << "Yes" << endl;
      |                      ^~~~
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout << "No" << endl;
      |     ^~~~
a.cc:23:21: error: 'endl' was not declared in this scope
   23 |     cout << "No" << endl;
      |                     ^~~~
Language: C

#include<stdio.h>
#include<algorithm>
using namespace std;
int main(){
  char s[10];
  scanf("%s",s);
  if(s[0] ==s[1] &&s[1] !=s[2] &&s[2] ==s[3])
    printf("Yes\n");
  else if(s[0] ==s[2] &&s[2] !=s[1] &&s[1] ==s[3])
    printf("Yes\n");
  else if(s[0] ==s[3] &&s[3] !=s[1] &&s[1] ==s[2])
    printf("Yes\n");
  else printf("No\n");
}

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

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

int main(){
	string s;
	cin >> s;

	vector<int> al(27);
	rep(i, s.size()) al.at(s.at(i)-'0')++;
	
	int ans = 0;
	rep(i,27) if(count.at(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:13:28: error: overloaded function with no contextual type information
   13 |         rep(i,27) if(count.at(i) == 2) ans++;
      |                            ^~
Language: C++

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

int main(){
  string s;
  cin >> s;
  map<char,ll> mp;
  for(auto e : s) mp[e]++;
  if(mp.size() == 2 && mp[s[0]] == 2) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: 'll' was not declared in this scope
    7 |   map<char,ll> mp;
      |            ^~
a.cc:7:14: error: template argument 2 is invalid
    7 |   map<char,ll> mp;
      |              ^
a.cc:7:14: error: template argument 4 is invalid
a.cc:8:21: error: invalid types 'int[char]' for array subscript
    8 |   for(auto e : s) mp[e]++;
      |                     ^
a.cc:9:9: error: request for member 'size' in 'mp', which is of non-class type 'int'
    9 |   if(mp.size() == 2 && mp[s[0]] == 2) cout << "Yes" << endl;
      |         ^~~~
a.cc:9:26: error: invalid types 'int[__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}]' for array subscript
    9 |   if(mp.size() == 2 && mp[s[0]] == 2) cout << "Yes" << endl;
      |                          ^
Language: C++

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

int main(){
  string s;
  cin >> s;
  map<char,ll> mp;
  for(auto e : s) mp[e]++;
  if(mp.size() == 2 && mp[s[0]] == 2) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incldue; did you mean #include?
    1 | #incldue <bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string s;
      |   ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | #incldue <bits/stdc++.h>
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> s;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #incldue <bits/stdc++.h>
a.cc:6:10: error: 's' was not declared in this scope
    6 |   cin >> s;
      |          ^
a.cc:7:3: error: 'map' was not declared in this scope
    7 |   map<char,ll> mp;
      |   ^~~
a.cc:1:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
  +++ |+#include <map>
    1 | #incldue <bits/stdc++.h>
a.cc:7:7: error: expected primary-expression before 'char'
    7 |   map<char,ll> mp;
      |       ^~~~
a.cc:8:19: error: 'mp' was not declared in this scope
    8 |   for(auto e : s) mp[e]++;
      |                   ^~
a.cc:9:6: error: 'mp' was not declared in this scope
    9 |   if(mp.size() == 2 && mp[s[0]] == 2) cout << "Yes" << endl;
      |      ^~
a.cc:9:39: error: 'cout' was not declared in this scope
    9 |   if(mp.size() == 2 && mp[s[0]] == 2) cout << "Yes" << endl;
      |                                       ^~~~
a.cc:9:39: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:56: error: 'endl' was not declared in this scope
    9 |   if(mp.size() == 2 && mp[s[0]] == 2) cout << "Yes" << endl;
      |                                                        ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #incldue <bits/stdc++.h>
a.cc:10:8: error: 'cout' was not declared in this scope
   10 |   else cout << "No" << endl;
      |        ^~~~
a.cc:10:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:24: error: 'endl' was not declared in this scope
   10 |   else cout << "No" << endl;
      |                        ^~~~
a.cc:10:24: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:27: error: 'a' was not declared in this scope
    8 |   if((s.at(0)==s.at(1) && a.at(2)==s.at(3) && s.at(0)!=s.at(2)) || (s.at(0)==s.at(2) && a.at(1)==s.at(3) && s.at(0)!=s.at(1)) || (s.at(0)==s.at(3) && a.at(1)==s.at(2) && s.at(0)!=s.at(1))){
      |                           ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'else' without a previous 'if'
    8 |   else if((s.at(0)==s.at(1) && a.at(2)==s.at(3) && s.at(0)!=s.at(2)) || (s.at(0)==s.at(2) && a.at(1)==s.at(3) && s.at(0)!=s.at(1)) || (s.at(0)==s.at(3) && a.at(1)==s.at(2) && s.at(0)!=s.at(1))){
      |   ^~~~
a.cc:8:32: error: 'a' was not declared in this scope
    8 |   else if((s.at(0)==s.at(1) && a.at(2)==s.at(3) && s.at(0)!=s.at(2)) || (s.at(0)==s.at(2) && a.at(1)==s.at(3) && s.at(0)!=s.at(1)) || (s.at(0)==s.at(3) && a.at(1)==s.at(2) && s.at(0)!=s.at(1))){
      |                                ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: no matching function for call to 'sort(std::string&, std::__cxx11::basic_string<char>::size_type)'
    6 |   sort(s, s.length());
      |   ~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   template argument deduction/substitution failed:
a.cc:6:7: note:   deduced conflicting types for parameter '_RAIter' ('std::__cxx11::basic_string<char>' and 'long unsigned int')
    6 |   sort(s, s.length());
      |   ~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: invalid use of non-static member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
    6 |   sort(s, s.length);
      |           ~~^~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1083:7: note: declared here
 1083 |       length() const _GLIBCXX_NOEXCEPT
      |       ^~~~~~
Language: C

#include<stdio.h>

int main(){
    int i;
    char s[5];

    scanf_s("%s", s);
    if(s[0] == s[1] == s[2] == s[3]) puts("No");
    else if((s[0] == s[1] && s[2] == s[3]) || (s[0] == s[2] && s[1] == s[3]) || (s[0] == s[3] && s[1] == s[2]))
        puts("Yes");
    
    else puts("No");

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:5: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |     scanf_s("%s", s);
      |     ^~~~~~~
      |     scanf
Language: C++

#include <iostream>
#include <iomanip>
typedef long long ll;
using namespace std;
const  ll INF = 1e9;
const  ll MOD = 1e9 + 7;
#define repi(i,n,init) for(ll i=init;i<(n);i++)

int main()
{
    string s;
    cin >> s;
    repi(i,s.size(),){
    int a = 0;
        repi(j,s.size(),0){
            if(s[i] == s[j])a++;
        }
        if(a != 2){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:37: error: expected primary-expression before ';' token
    7 | #define repi(i,n,init) for(ll i=init;i<(n);i++)
      |                                     ^
a.cc:13:5: note: in expansion of macro 'repi'
   13 |     repi(i,s.size(),){
      |     ^~~~
Language: C++

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

int main(){
	string s;
	cin >> s;

	map<char, int> mp;
	rep(i, n){
		mp[s.at(i)]++;
	}
	if(mp.size()==2 && mp[s.at(0)] ==2) cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: 'n' was not declared in this scope
   10 |         rep(i, n){
      |                ^
a.cc:3:45: note: in definition of macro 'rep'
    3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                                             ^