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

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++);
using ll=long long;
int  main(){
string S;
cin>>S;
char a=S.at(0);
bool a=false;
if(a==S.at(1)&&S.at(2)!=a&&S.at(3)!=a){
    if(S.at(2)==S.at(3)){
        a=true;
    }
}
 else if(a==S.at(2)&&S.at(1)!=a&&S.at(3)!=a){
    if(S.at(1)==S.at(3)){
        a=true;
    }
}
else if(a==S.at(3)&&S.at(2)!=a&&S.at(1)!=a){
    if(S.at(1)==S.at(2)){
        a=true;
    }
}

if(a==false){
    cout<<"No"<<endl;
}
else
{
    cout<<"Yes"<<endl;
}

 }


Compiler output:
a.cc: In function 'int main()':
a.cc:9:6: error: conflicting declaration 'bool a'
    9 | bool a=false;
      |      ^
a.cc:8:6: note: previous declaration as 'char a'
    8 | char a=S.at(0);
      |      ^
Language: C

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

const string alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main(){
    string s;
    int k=0;
    int count[27]={0};
    cin >> s;
    for (int i=0;i<4;i++){
        for (int j=0;j<26;j++){
            if(s[i]==alpha[j]){
                count[j]++;
            }
        }
    }
    for(int i=0;i<27;i++){
        if(count[i]==2){
            k++;
        }else if(count[i]!=0){
            cout <<"No";
            return 0;
        }
    }
    if(k==2){
        cout << "Yes";
    }else{
        cout <<"No";
    }
    return 0;
}

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

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

int main() {
  string s;
  cin >> s;
  vector<char> = a(4);
  rep(i, 4) a.at(i) = 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:8:16: error: expected unqualified-id before '=' token
    8 |   vector<char> = a(4);
      |                ^
a.cc:9:13: error: 'a' was not declared in this scope
    9 |   rep(i, 4) a.at(i) = s.at(i);
      |             ^
a.cc:10:8: error: 'a' was not declared in this scope
   10 |   sort(a.begin(), a.end());
      |        ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:41: error: expected ')' before '{' token
   13 |     else if(S[0] == S[3] && S[1] == S[2] {
      |            ~                            ^~
      |                                         )
a.cc:19:1: error: expected primary-expression before '}' token
   19 | }
      | ^
Language: C++

/**
*    created: 12.05.2020 00:42:41
**/
#include <bits/stdc++.h>
#define int long long
const int INF = 1e18L + 5;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;

signed main() {

    cin.tie(0);
    ios_base::sync_with_stdio(false);

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


Compiler output:
a.cc: In function 'int main()':
a.cc:19:43: error: 'i' was not declared in this scope
   19 |     if (s[0] == s[1] && s[2] == s[3] && s[i] != s[2]) cout << "Yes" << endl;
      |                                           ^
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) && S.at(0)==S.at(2)){
    cout << "No" << endl;
  }
  else 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(1)==S.at(3)){
    cout << "Yes" << endl;
  }
  else if(S.at(0)==S.at(3) && S.at(1)==S.at(2)){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:21:4: error: expected '}' at end of input
   21 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
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(1)==S.at(3)){
    cout << "Yes" << endl;
  }
  else if(S.at(0)==S.at(3) && S.at(1)==S.at(2)){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
  


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

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

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

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

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

int main(){
  string S;
  cin S;
  vector<string> A;
  int count;
  for(int i=0; i<N; i++){
    if(S.at(i) == 'S'){
      count++;
    }
    else{
      A.push_back(S.at(i));
    }
  }
  
  if(count ==2 && A.at(0) == A.at(1) ){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'S'
    6 |   cin S;
      |      ^~
      |      ;
a.cc:9:18: error: 'N' was not declared in this scope
    9 |   for(int i=0; i<N; i++){
      |                  ^
a.cc:14:18: 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&)'
   14 |       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>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std;

int main() {
  
  int a,b,c,d,x;
  double da,db;
  string s,ss,sss;
  
  int ans = 0;
  string anss = "";
  
  cin >> s;
  
  int ab [] = {0 , 1 , 3 , 1 , 2 , 1 , 2 , 1 , 1 , 2 , 1 , 2 , 1};
  int result3 = std::max({a, b, c});
//--------------------------------------------------------------------------------

  if(s[0] == s[1] && s[1] != s[2] && s[2] == s[3]) anss = "Yes";
  else if(s[1] == s[2] && s[1] != s[0] && s[0] == s[3]) anss = "Yes";
  else if if(s[0] == s[2] && s[1] != s[2] && s[1] == s[3]) anss = "Yes";
  else anss = "No";

  cout << anss << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:11: error: expected '(' before 'if'
   26 |   else if if(s[0] == s[2] && s[1] != s[2] && s[1] == s[3]) anss = "Yes";
      |           ^~
      |           (
a.cc:27:3: error: 'else' without a previous 'if'
   27 |   else anss = "No";
      |   ^~~~
Language: C++

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

int main(){
   string s ;
  cin >> 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]){
    cout << "Yes" << endl;
    else cout << "No" << endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: expected '}' before 'else'
   10 |     else cout << "No" << endl;
      |     ^~~~
a.cc:8:77: note: to match this '{'
    8 |   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]){
      |                                                                             ^
Language: C++

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

int main(){
   srting s ;
  cin >> 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]){
    cout << "Yes" << endl;
    else cout << "No" << endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:5:4: error: 'srting' was not declared in this scope
    5 |    srting s ;
      |    ^~~~~~
a.cc:6:10: error: 's' was not declared in this scope
    6 |   cin >> s ;
      |          ^
a.cc:10:5: error: expected '}' before 'else'
   10 |     else cout << "No" << endl;
      |     ^~~~
a.cc:8:77: note: to match this '{'
    8 |   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]){
      |                                                                             ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: 'striing' was not declared in this scope
    5 | striing s;
      | ^~~~~~~
a.cc:6:10: error: 's' was not declared in this scope
    6 |   cin >> s;
      |          ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:24: error: expected primary-expression before '=' token
    7 |   if(s[0]==s[1]&&s[1]!==s[2]&&s[2]==s[3]){
      |                        ^
a.cc:10:24: error: expected primary-expression before '=' token
   10 |   if(s[0]==s[2]&&s[2]!==s[1]&&s[1]==s[3]){
      |                        ^
a.cc:13:24: error: expected primary-expression before '=' token
   13 |   if(s[0]==s[3]&&s[3]!==s[1]&&s[1]==s[2]){
      |                        ^
Language: Java

import java.util.*;

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


Compiler output:
Main.java:7: error: cannot find symbol
            Array.sort(str);
            ^
  symbol:   variable Array
  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);		
		String s = sc.next();
        String t = "No";
        if(s.charAt(0)==s.charAt(1))
        {if(s.charAt(2)==s.charAt(3) && s.charAt(0)!=s.charAt(2){t = "Yes";}}
		 if(s.charAt(0)==s.charAt(2))
        {if(s.charAt(1)==s.charAt(3) && s.charAt(0)!=s.charAt(1){t = "Yes";}}
         if(s.charAt(0)==s.charAt(3))
        {if(s.charAt(1)==s.charAt(2) && s.charAt(0)!=s.charAt(1){t = "Yes";}}  
            System.out.println(t);
	}
}


Compiler output:
Main.java:8: error: ')' expected
        {if(s.charAt(2)==s.charAt(3) && s.charAt(0)!=s.charAt(2){t = "Yes";}}
                                                                ^
Main.java:10: error: ')' expected
        {if(s.charAt(1)==s.charAt(3) && s.charAt(0)!=s.charAt(1){t = "Yes";}}
                                                                ^
Main.java:12: error: ')' expected
        {if(s.charAt(1)==s.charAt(2) && s.charAt(0)!=s.charAt(1){t = "Yes";}}  
                                                                ^
3 errors
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:5:15: error: expected ';' before 'if'
    5 | scanf("%4s",a)
      |               ^
      |               ;
    6 | 
    7 |   if(a[0]==a[1] && a[2]==a[3]) printf("Yes");
      |   ~~           
main.c:8:3: error: 'else' without a previous 'if'
    8 |   else if(a[0]==a[2] && a[1]==a[3]) printf("Yes");
      |   ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  string s; cin >>s;
  map<char, int> mp;
  for (auto &&a: s){
    if(mp.count(a))mp[a]++;
    else mp[a] = 1;
  }
  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:11:9: error: invalid use of member function 'std::map<_Key, _Tp, _Compare, _Alloc>::size_type std::map<_Key, _Tp, _Compare, _Alloc>::size() const [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; size_type = long unsigned int]' (did you forget the '()' ?)
   11 |   if(mp.size.() == 2 && mp[s.at(0)] == 2)cout << "Yes" << endl;
      |      ~~~^~~~
      |             ()
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  string s; cin >>s;
  map<char, int> mp;
  for (auto &&a: s){
    if(mp.count(a))mp[a]++;
    else mp[a] = 1;
  }
  if(mp.size.() == 2 && mp[mp.begin()] == 2)cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: invalid use of member function 'std::map<_Key, _Tp, _Compare, _Alloc>::size_type std::map<_Key, _Tp, _Compare, _Alloc>::size() const [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; size_type = long unsigned int]' (did you forget the '()' ?)
   11 |   if(mp.size.() == 2 && mp[mp.begin()] == 2)cout << "Yes" << endl;
      |      ~~~^~~~
      |             ()
a.cc:11:27: error: no match for 'operator[]' (operand types are 'std::map<char, int>' and 'std::map<char, int>::iterator' {aka 'std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::iterator'})
   11 |   if(mp.size.() == 2 && mp[mp.begin()] == 2)cout << "Yes" << endl;
      |                           ^
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:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'std::map<char, int>::iterator' {aka 'std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::iterator'} to 'const std::map<char, int>::key_type&' {aka 'const char&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'std::map<char, int>::iterator' {aka 'std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::iterator'} to 'std::map<char, int>::key_type&&' {aka 'char&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected unqualified-id before '.' token
    8 |     if(map.count(a))mp[a]++;
      |           ^
a.cc:11:9: error: invalid use of member function 'std::map<_Key, _Tp, _Compare, _Alloc>::size_type std::map<_Key, _Tp, _Compare, _Alloc>::size() const [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; size_type = long unsigned int]' (did you forget the '()' ?)
   11 |   if(mp.size.() == 2 && mp[mp.begin()] == 2)cout << "Yes" << endl;
      |      ~~~^~~~
      |             ()
a.cc:11:27: error: no match for 'operator[]' (operand types are 'std::map<char, int>' and 'std::map<char, int>::iterator' {aka 'std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::iterator'})
   11 |   if(mp.size.() == 2 && mp[mp.begin()] == 2)cout << "Yes" << endl;
      |                           ^
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:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'std::map<char, int>::iterator' {aka 'std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::iterator'} to 'const std::map<char, int>::key_type&' {aka 'const char&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'std::map<char, int>::iterator' {aka 'std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int> >, std::less<char>, std::allocator<std::pair<const char, int> > >::iterator'} to 'std::map<char, int>::key_type&&' {aka 'char&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
Language: C++

#include <iostream>
#include <math.h>
#include <limits>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <stdio.h>
#include <map>
#include <utility>
using namespace std;
#define rep(i, n) for (int i =0; i < (int)(n); i++)
typedef pair<int, string> P;




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

    sort(s.begin(), s.end());
    if (s.at(0) == s.at(1) && s.at(2) == s.at(3)&& s.at(1) != s.at(2))cout << "Yes" << endl;
    else cout << "No" << endl;
}
#include <iostream>
#include <math.h>
#include <limits>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <stdio.h>
#include <map>
#include <utility>
using namespace std;
#define rep(i, n) for (int i =0; i < (int)(n); i++)
typedef pair<int, string> P;




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

    sort(s.begin(), s.end());
    if (s.at(0) == s.at(1) && s.at(2) == s.at(3)&& s.at(1) != s.at(2))cout << "Yes" << endl;
    else cout << "No" << endl;
}


Compiler output:
a.cc:41:5: error: redefinition of 'int main()'
   41 | int main() {
      |     ^~~~
a.cc:17:5: note: 'int main()' previously defined here
   17 | int main() {
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  string s;
  map<string,int> m;
  for(int i=0;i<4;i++){
    m[s[i]]++;
  }
  if(m.size()==2 && m[0]==m[1]){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'map' was not declared in this scope
    6 |   map<string,int> m;
      |   ^~~
a.cc:2:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    1 | #include <iostream>
  +++ |+#include <map>
    2 | using namespace std;
a.cc:6:13: error: expected primary-expression before ',' token
    6 |   map<string,int> m;
      |             ^
a.cc:6:14: error: expected primary-expression before 'int'
    6 |   map<string,int> m;
      |              ^~~
a.cc:8:5: error: 'm' was not declared in this scope
    8 |     m[s[i]]++;
      |     ^
a.cc:10:6: error: 'm' was not declared in this scope
   10 |   if(m.size()==2 && m[0]==m[1]){
      |      ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:31:4: 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 s;
  cin>>s;
  int t=0;
  if(s.at(0)=s.at(1)){
    t++;
  }
  if(s.at(0)=s.at(2)){
    t++;
  }
  if(s.at(0)=s.at(3)){
    t++;
  }
  if(s.at(1)=s.at(2)){
    t++;
  }
  if(s.at(1)=s.at(3)){
    t++;
  }
  if(s.at(2)=s.at(3)){
    t++;
  }
  if(t==2){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
  

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

#include <iostream>
using namespace std;
int main(){
  string s;
  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[1]=s[2]){
    cout << "Yes";
  }else{
    cout << "No";
  }
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: lvalue required as left operand of assignment
    6 |   if(s[0] =s[1] && s[2]=s[3]){
a.cc:8:23: error: lvalue required as left operand of assignment
    8 |   } else if(s[0]=s[2] && s[1]=s[3]){
a.cc:10:22: error: lvalue required as left operand of assignment
   10 |   }else if(s[0]=s[3] && s[1]=s[2]){
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:31: error: expected primary-expression before '%' token
    7 |   if(S[0]==S[1] &&S[2]!=S[1] %%S[2]==S[3]){
      |                               ^
a.cc:10:36: error: expected primary-expression before '%' token
   10 |   else if(S[0]==S[3] &&S[2]!=S[3] %%S[2]==S[1]){
      |                                    ^
a.cc:13:36: error: expected primary-expression before '%' token
   13 |   else if(S[0]==S[2] &&S[2]!=S[1] %%S[1]==S[3]){
      |                                    ^
Language: C++

#include<iostream>
using namesace std;
int main(void){
  string s;
  cin>>s;
  bool t_f=false;
  if(s[0]==s[1] && s[2]==s[3] && s[0]!=s[2]){
    t_f=true;
  }
  if(s[0]==s[2] && s[1]==s[3] && s[0]!=s[1]){
    t_f=true;
  }
  if(s[0]==s[3] && s[1]==s[2] && s[0]!=s[1]){
    t_f=true;
  }
  if(t_f){
    printf("Yes\n");
  }else{
    printf("No\n");
  }
  return 0;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namesace'
    2 | using namesace std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   string s;
      |   ^~~~~~
a.cc:4:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>s;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:5:8: error: 's' was not declared in this scope
    5 |   cin>>s;
      |        ^
Language: C++

s=list(input())
s.sort()
if s[0]==s[1] and s[2]==s[3]:
    print('Yes')
else:
    print('No')

Compiler output:
a.cc:4:11: warning: multi-character character constant [-Wmultichar]
    4 |     print('Yes')
      |           ^~~~~
a.cc:6:11: warning: multi-character character constant [-Wmultichar]
    6 |     print('No')
      |           ^~~~
a.cc:1:1: error: 's' does not name a type
    1 | s=list(input())
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define dl double long
const int INF=0x3fffffff;
const ll MOD=1000000007;
const ll MODD=998244353;
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
template<typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool chmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
template <int MOD>
struct ModInt {
    using lint = long long;
    int val;
 
    // constructor
    ModInt(lint v = 0) : val(v % MOD) {
        if (val < 0) val += MOD;
    };
 
    // unary operator
    ModInt operator+() const { return ModInt(val); }
    ModInt operator-() const { return ModInt(MOD - val); }
    ModInt inv() const { return this->pow(MOD - 2); }
 
    // arithmetic
    ModInt operator+(const ModInt& x) const { return ModInt(*this) += x; }
    ModInt operator-(const ModInt& x) const { return ModInt(*this) -= x; }
    ModInt operator*(const ModInt& x) const { return ModInt(*this) *= x; }
    ModInt operator/(const ModInt& x) const { return ModInt(*this) /= x; }
    ModInt pow(lint n) const {
        auto x = ModInt(1);
        auto b = *this;
        while (n > 0) {
            if (n & 1) x *= b;
            n >>= 1;
            b *= b;
        }
        return x;
    }
 
    // compound assignment
    ModInt& operator+=(const ModInt& x) {
        if ((val += x.val) >= MOD) val -= MOD;
        return *this;
    }
    ModInt& operator-=(const ModInt& x) {
        if ((val -= x.val) < 0) val += MOD;
        return *this;
    }
    ModInt& operator*=(const ModInt& x) {
        val = lint(val) * x.val % MOD;
        return *this;
    }
    ModInt& operator/=(const ModInt& x) { return *this *= x.inv(); }
 
    // compare
    bool operator==(const ModInt& b) const { return val == b.val; }
    bool operator!=(const ModInt& b) const { return val != b.val; }
 
    // I/O
    friend std::istream& operator>>(std::istream& is, ModInt& x) noexcept { return is >> x.val; }
    friend std::ostream& operator<<(std::ostream& os, const ModInt& x) noexcept { return os << x.val; }
};

int main() {
  	string S;
    cin >> S;
	if(S[0] == S[1] && S[2] == S[3] && S[0] != S[2]||
       S[0] == S[2] && S[1] == S[3] && S[0] != S[1]||
       S[0] == S[3] && S[1] == S[2] && S[0] != S[1]){
      cout << "Yes" << "\n";
      return;
    }

    cout << "No" << "\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:76:7: error: return-statement with no value, in function returning 'int' [-fpermissive]
   76 |       return;
      |       ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define dl double long
const int INF=0x3fffffff;
const ll MOD=1000000007;
const ll MODD=998244353;
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
template<typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool chmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
template <int MOD>
struct ModInt {
    using lint = long long;
    int val;
 
    // constructor
    ModInt(lint v = 0) : val(v % MOD) {
        if (val < 0) val += MOD;
    };
 
    // unary operator
    ModInt operator+() const { return ModInt(val); }
    ModInt operator-() const { return ModInt(MOD - val); }
    ModInt inv() const { return this->pow(MOD - 2); }
 
    // arithmetic
    ModInt operator+(const ModInt& x) const { return ModInt(*this) += x; }
    ModInt operator-(const ModInt& x) const { return ModInt(*this) -= x; }
    ModInt operator*(const ModInt& x) const { return ModInt(*this) *= x; }
    ModInt operator/(const ModInt& x) const { return ModInt(*this) /= x; }
    ModInt pow(lint n) const {
        auto x = ModInt(1);
        auto b = *this;
        while (n > 0) {
            if (n & 1) x *= b;
            n >>= 1;
            b *= b;
        }
        return x;
    }
 
    // compound assignment
    ModInt& operator+=(const ModInt& x) {
        if ((val += x.val) >= MOD) val -= MOD;
        return *this;
    }
    ModInt& operator-=(const ModInt& x) {
        if ((val -= x.val) < 0) val += MOD;
        return *this;
    }
    ModInt& operator*=(const ModInt& x) {
        val = lint(val) * x.val % MOD;
        return *this;
    }
    ModInt& operator/=(const ModInt& x) { return *this *= x.inv(); }
 
    // compare
    bool operator==(const ModInt& b) const { return val == b.val; }
    bool operator!=(const ModInt& b) const { return val != b.val; }
 
    // I/O
    friend std::istream& operator>>(std::istream& is, ModInt& x) noexcept { return is >> x.val; }
    friend std::ostream& operator<<(std::ostream& os, const ModInt& x) noexcept { return os << x.val; }
};

int main() {
  	string S;
    cin >> 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]){
      cout << "Yes" << "\n";
      return;
    }

    cout << "No" << "\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:76:7: error: return-statement with no value, in function returning 'int' [-fpermissive]
   76 |       return;
      |       ^~~~~~
Language: C++

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:11:45: error: expected primary-expression before '||' token
   11 |   }else if ( s[0] == s[1] && s[2] == s[3] ) ||
      |                                             ^~
Language: C++

#include <bits/stdc++.h>
#include <cmath>
#include <iostream>

using namespace std;

int main() {
  string S;
  cin>>S;
  sort(S.begin(),end());
  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:10:21: error: no matching function for call to 'end()'
   10 |   sort(S.begin(),end());
      |                  ~~~^~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 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/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1249:5: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
 1249 |     end(valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1249:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/valarray:1265:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1265:5: note:   candidate expects 1 argument, 0 provided
Language: C++

#include<bits/stdc++.h>
using namespace std;
template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
typedef vector<string> vstring;
#define _GLIBCXX_DEBUG
#define vpush(a,x) a.push_back(x);
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
const int INF = 1 << 30;
const int dx[] = {1,0,-1,0,1,1,-1,-1};
const int dy[] = {0,-1,0,1,1,-1,-1,1};
#define stp(x)  setprecision(x)
int main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  string s;
  cin>>s;
  int si=s.size();
  set<char> S;
  rep(i,si){
    S.insert(s[i]));
  }
  if(si==4){
    si=S.size();
    if(si==2){
      cout<<"Yes"<<'\n';
      
    }
    else{
      cout<<"No"<<'\n';
      
    }
  }
  else{
    cout<<"Yes"<<'\n';
  }
  return(0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:19: error: expected ';' before ')' token
   27 |     S.insert(s[i]));
      |                   ^
      |                   ;
Language: C++

s = input()

if len(set(s)) == 2:
    print('Yes')
else:
    print('No')

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

S = str(input())

a = S[0]
b = S[1]
c = S[2]
d = S[3]

acount = 0
bcount = 0
ccount = 0
dcount = 0

if S.count(a) == 2 and S.count(c) == 2 and S.count(b) == 2 and S.count(d) == 2:
    print("Yes")
else:
    print("No")


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

#include<bits/stdc++.h>
#define ff first
#define ss second
#define len(x) (int)(x.size())
#define all(x) x.begin(), x.end();
using namespace std;
using ll = long long;
using ii = pair<int, int>;

int main(){
	ios::sync_with_stdio(0);
	string st;
	cin >> st;
	set<char> s;
	for(auto c:st)
		s.insert(c);
	if(len(c)==2)
		cout << "Yes\n";
	else
		cout << "No\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:16: error: 'c' was not declared in this scope
   17 |         if(len(c)==2)
      |                ^
a.cc:4:22: note: in definition of macro 'len'
    4 | #define len(x) (int)(x.size())
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
string S;
  cin>>S;
  string ans="No";
  if(S.at(0)==S.at(1)v&&vS.at(2)==S.at(3) && S.at(0)!=S.at(2))
    ans="Yes";
  if(S.at(0)==S.at(2)v&&vS.at(1)==S.at(3) && S.at(0)!=S.at(1))
    ans="Yes";
  if(S.at(0)==S.at(3)v&&vS.at(2)==S.at(1) && S.at(0)!=S.at(2))
    ans="Yes";
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: error: expected ')' before 'v'
    7 |   if(S.at(0)==S.at(1)v&&vS.at(2)==S.at(3) && S.at(0)!=S.at(2))
      |     ~                ^
      |                      )
a.cc:9:22: error: expected ')' before 'v'
    9 |   if(S.at(0)==S.at(2)v&&vS.at(1)==S.at(3) && S.at(0)!=S.at(1))
      |     ~                ^
      |                      )
a.cc:11:22: error: expected ')' before 'v'
   11 |   if(S.at(0)==S.at(3)v&&vS.at(2)==S.at(1) && S.at(0)!=S.at(2))
      |     ~                ^
      |                      )
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 ss[] = new String[4];
    for(int i = 0;i<4;i++){
      ss[i] = s.substring(i,i+1);
    }

    String sa = s.replace(s[0],"");
    if(sa.length() == 0){
      System.out.println("No");
      return;
    }

    int target = 0;
    for(int i = 1;i<4;i++){
      if(ss[i].equals(ss[0])){
        target = i;
        break;
      }
      if(i == 3){
        System.out.println("No");
        return;
      }
    }
    if(target == 1){
      if(ss[2].equals(ss[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      }
    }else if(target == 2){
      if(ss[1].equals(ss[3])){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      }
    }else{
      if(ss[1].equals(ss[2])){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      }
    }
  }
}


Compiler output:
Main.java:11: error: array required, but String found
    String sa = s.replace(s[0],"");
                           ^
1 error
Language: C++

int main() {
  string s;
  cin >> s;
  if(s.at(0) == s.at(1) && s.at(1) == s.at(2)) {
    cout << "No" <<endl;
  }
  else 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(1) == s.at(3)) {
    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:2:3: error: 'string' was not declared in this scope
    2 |   string s;
      |   ^~~~~~
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> s;
      |   ^~~
a.cc:3:10: error: 's' was not declared in this scope
    3 |   cin >> s;
      |          ^
a.cc:5:5: error: 'cout' was not declared in this scope
    5 |     cout << "No" <<endl;
      |     ^~~~
a.cc:5:20: error: 'endl' was not declared in this scope
    5 |     cout << "No" <<endl;
      |                    ^~~~
a.cc:8:5: error: 'cout' was not declared in this scope
    8 |     cout << "Yes" <<endl;
      |     ^~~~
a.cc:8:21: error: 'endl' was not declared in this scope
    8 |     cout << "Yes" <<endl;
      |                     ^~~~
a.cc:11:5: error: 'cout' was not declared in this scope
   11 |     cout << "Yes" <<endl;
      |     ^~~~
a.cc:11:21: error: 'endl' was not declared in this scope
   11 |     cout << "Yes" <<endl;
      |                     ^~~~
a.cc:14:5: error: 'cout' was not declared in this scope
   14 |     cout << "Yes" <<endl;
      |     ^~~~
a.cc:14:21: error: 'endl' was not declared in this scope
   14 |     cout << "Yes" <<endl;
      |                     ^~~~
a.cc:17:5: error: 'cout' was not declared in this scope
   17 |     cout << "No" <<endl;
      |     ^~~~
a.cc:17:20: error: 'endl' was not declared in this scope
   17 |     cout << "No" <<endl;
      |                    ^~~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: expected ')' before '$$s'
   12 |         if(s[2]==s[3]$$s[0]!=s[2]){
      |           ~          ^~~
      |                      )
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: expected ')' before '$$s'
   12 |         if(s[2]==s[3]$$s[0]!=a[2]){
      |           ~          ^~~
      |                      )
Language: C++

s = input()

s = sorted(s)
s = ''.join(s)

if s[0] == s[1] and s[2] == s[3] and s[2] != s[1]:
    print("Yes")
else:
    print("No")


Compiler output:
a.cc:4:5: error: empty character constant
    4 | s = ''.join(s)
      |     ^~
a.cc:1:1: error: 's' does not name a type
    1 | s = input()
      | ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: expected ';' before '}' token
    9 |     ans = "No"
      |               ^
      |               ;
   10 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
string S;
  cin>>S;
  
  if(S.at(0)==S.at(3)&&S.at(1)==S.at(2)){
  cout<<"Yes"<<endl;
  }
  else 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(1)==S.at(3)){
  cout<<"Yes"<<endl;
  }
  else{
  cout<<"No"<<endl;
  }
}


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:4:1: error: 'stirng' was not declared in this scope
    4 | stirng S;
      | ^~~~~~
a.cc:5:8: error: 'S' was not declared in this scope
    5 |   cin>>S;
      |        ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:1: error: 'stirng' was not declared in this scope
    4 | stirng S;
      | ^~~~~~
a.cc:5:8: error: 'S' was not declared in this scope
    5 |   cin>>S;
      |        ^