criyle/codenet-compile-errors huggingface dataset:
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(3)) ||
          (S.at(0) == S.at(2) && S.at(1) == S.at(3) && S.at(0) == S.at(3)) ||
          (S.at(0) == S.at(3) && S.at(1) == S.at(2) && S.at(0) == S.at(2)) ||
      ) {
          cout << "Yes" << endl;
      }
      else {
          cout << "No" << endl;
      }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: expected primary-expression before ')' token
   10 |       ) {
      |       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define  rep(i, n) for(int i = 0; i < n; i++) 
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  INF 1LL << 60
typedef long long int LL;
const int MOD = 1000000007;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }
//sort(all(x))とするとソートできるよ
// 10^x は pow(10,(x)) 
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

int main(){
    string S;cin >> S;
    sort(all(S));
    bool ans = false;
    if(S[0] == S[1])if(S[1] != S[2])if(S[2] == S[3])ans = true;
    cout << ans ? "Yes":"No" << endl;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:30: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   20 |     cout << ans ? "Yes":"No" << endl;
      |                         ~~~~~^~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
   char a, b, c, d;
   cin >> a >> b >> c >> d;
   if (a == b && c == b && 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;
   else {
     cout << "NO" << endl;
  return 0;
   }

Compiler output:
a.cc: In function 'int main()':
a.cc:9:4: error: expected '}' before 'else'
    9 |    else if (a == c && b == d && a != b){
      |    ^~~~
a.cc:7:35: note: to match this '{'
    7 |    if (a == b && c == b && a != c){
      |                                   ^
a.cc:11:4: error: expected '}' before 'else'
   11 |    else if (a == d && b == c && a != b){
      |    ^~~~
a.cc:9:40: note: to match this '{'
    9 |    else if (a == c && b == d && a != b){
      |                                        ^
a.cc:13:4: error: expected '}' before 'else'
   13 |    else {
      |    ^~~~
a.cc:11:40: note: to match this '{'
   11 |    else if (a == d && b == c && a != b){
      |                                        ^
a.cc:16:5: error: expected '}' at end of input
   16 |    }
      |     ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C

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

int main() {
  //入力
  char s[4];
  scanf("%s", s);

  //計算・出力
  if(s[0] == s[1] && s[2] == s[3] && s[0] != s[2]){
    printf("YES\n");
  }else if(s[0] == s[2] && s[1] == s[3] && s[0] != s[1]){
    printf("YES\n");
  }else if(s[0] == s[3] && s[1] == s[2] && s[0] != s[1]){
    printf("YES\n");
  }else{
    printf("NO\n");
  }
  return 0;
}


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

#include<stdio.h>
#include<algorithm>

int main() {
  //入力
  char s[4];
  scanf("%s", s);
  
  //計算・出力
  if(s[0] == s[1] && s[2] == s[3] && s[0] != s[2]){
    printf("YES");
  }else if(s[0] == s[2] && s[1] == s[3] && s[0] != s[1]){
    printf("YES");
  }else if(s[0] == s[3] && s[1] == s[2] && s[0] != s[1]){
    printf("YES");
  }else{
  	printf("NO");
  }
  return 0;
}

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

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

int main() {
  //入力
  char s[4];
  scanf("%s", s);
  
  //計算・出力
  if(s[0] == s[1] && s[2] == s[3] && s[0] != s[2]){
    printf("YES");
  }else if(s[0] == s[2] && s[1] == s[3] && s[0] != s[1]){
    printf("YES");
  }else if(s[0] == s[3] && s[1] == s[2] && s[0] != s[1]){
    printf("YES");
  }else{
  	printf("NO");
  }
  return 0;
}

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

#include<iostream>
using namespace std;

int main() {
  //入力
  string str;
  string ans = "NO";
  cin >> str;
  char s[4];
  for(int i=0; i<4; i++){
  	s[i] = str.at(i)
  }

  //計算・出力
  if(s[0] == s[1] && s[2] == s[3] && s[0] != s[2]){
    cout << "YES";
  }else if(s[0] == s[2] && s[1] == s[3] && s[0] != s[1]){
    cout << "YES";
  }else if(s[0] == s[3] && s[1] == s[2] && s[0] != s[1]){
    cout << "YES";
  }else{
  	cout << "NO";
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: expected ';' before '}' token
   11 |         s[i] = str.at(i)
      |                         ^
      |                         ;
   12 |   }
      |   ~
Language: C++

#include <iostream.h>
using namespace std;

int main() {
  //入力
  string str;
  string ans = "NO";
  cin >> str;

  //計算
  if(str.at(0) == str.at(1)){
    if(str.at(2) == str.at(3)){
      ans = "YES";
    }
  }else if(str.at(0) == str.at(2)){
    if(str.at(1) == str.at(3)){
      ans = "YES";
    }
  }else if(str.at(0) == str.at(3)){
    if(str.at(1) == str.at(2)){
      ans = "YES";
    }
  }

  //出力
  cout << ans;
  return 0;
}

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

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

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

int main() {
    string s; cin >> s;
    bool flag = false;
    if(s[0] == s[1] && s[2] == s[3]) flag = true;
    if(s[0] == s[2] && s[1] == s[3]) flag = true;
    if(s[0] == s[3] && s[1] == s[2]) flag = true;
    cout << (flag ? "Yes", "No") << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:32: error: expected ':' before ')' token
   12 |     cout << (flag ? "Yes", "No") << endl;
      |                                ^
      |                                :
a.cc:12:32: error: expected primary-expression before ')' token
Language: C

#include <stdio.h>
int main(void)
{
	char s[4];
	
	scanf("%s", 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]){
	   	printf("yes");
	}else{
		printf("no");
	}
	
	return 0;#include <stdio.h>
int main(void)
{
	char s[4];
	
	scanf("%s", 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])){
	   	printf("yes");
	}else{
		printf("no");
	}
	
	return 0;
}
}

Compiler output:
main.c: In function 'main':
main.c:16:18: error: stray '#' in program
   16 |         return 0;#include <stdio.h>
      |                  ^
main.c:16:19: error: 'include' undeclared (first use in this function)
   16 |         return 0;#include <stdio.h>
      |                   ^~~~~~~
main.c:16:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:28: error: 'stdio' undeclared (first use in this function); did you mean 'stdin'?
   16 |         return 0;#include <stdio.h>
      |                            ^~~~~
      |                            stdin
main.c:17:1: error: expected expression before 'int'
   17 | int main(void)
      | ^~~
Language: C++

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

Compiler output:
a.cc:4:15: warning: multi-character character constant [-Wmultichar]
    4 |         print('Yes')
      |               ^~~~~
a.cc:6:15: 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++

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

int choose(int n, int r);

int main()
{
#ifdef LOCAL
    // 以降 cin の入力元が 'xxx.txt' になる
    std::ifstream in("d.txt");
    std::cin.rdbuf(in.rdbuf());
#endif

    int n, k;
    cin >> n >> k;

    rep (i, k)
    {
        cout << choose(k-1, i) * choose(n-k+1, i+1) << endl;
    }

    return 0;
}

// nCr 動的計画法.
// https://nantonaku-shiawase.hatenablog.com/entry/2017/06/28/232056
// パスカルの三角形
//    1
//   1 1
//  1 2 1
// 1 3 3 1
// とすると上からn段目、左からr番目が n-1Cr-1 となる
// DPで解くと、格子は
//     r
//     0 1 2 3
// n 0 1 0 0 0    n=0 r>0 はありえないので0
//   1 1
//   2 1
//   3 1
//
//     r=0の場合は1
//  ここからスタートして、順々にc[i][[j]を求めていく
// find C(n,r)
// Standard recursive formula for computing C(n,r)
// C(n,r) = C(n-1,r-1) + C(n-1,r)
// where C(n,0) = C(n,n) = 1
int choose(int n, int r) {
   if(r == 0 || r == n)
      return 1;
   // store C(n,r) in a matrix
   int c[n+1][r+1];
   int i,j;
   for(i=0;i<=n;i++) {
      // C(i,0) = 1 for i = 0...n
      c[i][0] = 1;
   }
   for(j=0;j<=r;j++) {
      // if n = 0, C(n,r) = 0 for all 'r'
      c[0][j] = 0;
   }
   for(i=1;i<=n;i++) {
      for(j=1;j<=r;j++) {
         if (i == j) {
            // C(n,n) = 1
            c[i][j] = 1;
         }
         else if (j > i) {
            // case when r > n in C(n,r)
            c[i][j] = 0;
         }
         else {
            // apply the standard recursive formula
            c[i][j] = c[i-1][j-1] + c[i-1][j];
         }
      }
   }
   return c[n][r];
}



Compiler output:
a.cc:3:10: fatal error: my_lib.h: No such file or directory
    3 | #include "my_lib.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

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

int main(){
  int S[4];
  for(i,4) cin >> S[i];
  
  sort(S);
  if(S[0]==S[1]&&S[2]==S[3]){
    ans = "Yes";
  }else{
    ans = "No";
  }
  
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   for(i,4) cin >> S[i];
      |       ^
a.cc:9:7: error: no matching function for call to 'sort(int [4])'
    9 |   sort(S);
      |   ~~~~^~~
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:   candidate expects 2 arguments, 1 provided
/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, 1 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, 1 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, 1 provided
a.cc:10:3: error: expected primary-expression before 'if'
   10 |   if(S[0]==S[1]&&S[2]==S[3]){
      |   ^~
a.cc:9:11: error: expected ')' before 'if'
    9 |   sort(S);
      |           ^
      |           )
   10 |   if(S[0]==S[1]&&S[2]==S[3]){
      |   ~~       
a.cc:7:6: note: to match this '('
    7 |   for(i,4) cin >> S[i];
      |      ^
a.cc:11:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |     ans = "Yes";
      |     ^~~
      |     abs
a.cc:13:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |     ans = "No";
      |     ^~~
      |     abs
a.cc:16:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C

#include <stdio.h>
int main(void)
{
	char s[5];
	s[4] = '0'
	
	scanf("%s", s);
	
	if(s[4] != 0){
	if(s[0] == s[1] && s[2] == s[3]){
		printf("yes");
	}else if(s[0] == s[2] && s[1] == s[3]){
		printf("yes");
	}else if(s[0] == s[3] && s[1] == s[2]){
		printf("yes");
	}else{
		printf("no");
	}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:19: error: expected ';' before 'scanf'
    5 |         s[4] = '0'
      |                   ^
      |                   ;
    6 | 
    7 |         scanf("%s", s);
      |         ~~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: 'end' was not declared in this scope; did you mean 'std::end'?
    9 |   std::sort(s.begin(), s,end());
      |                          ^~~
      |                          std::end
In file included from /usr/include/c++/14/string:53,
                 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,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:116:37: note: 'std::end' declared here
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
Language: C++

function isAlphabetNumeric(argValue)
{
if (argValue.match(/[^A-Z]/g) && )
{
return false;
}
else
{
return true;
}
}

Compiler output:
a.cc:1:1: error: 'function' does not name a type; did you mean 'union'?
    1 | function isAlphabetNumeric(argValue)
      | ^~~~~~~~
      | union
Language: C++

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

int N = 4;
string S;

int main(){
  cin >> S;
  //char a0,a1,a2,a3;
  if(s[0] == s[1]){
    if(s[0] != s[2] && s[2] == s[3]) cout << "Yes" << endl;
    else cout << "No" << endl;
  }else{
    if((s[0]==s[2] && s[1]==s[3]) || (s[0]==s[3] && s[1]==s[2])) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  //for(int i = 0; i<N; i++){}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: 's' was not declared in this scope
   10 |   if(s[0] == s[1]){
      |      ^
Language: C

#include <stdio.h>
int main(void)
{
	char a[4];
	int b, c = 0, d[3], e = 0;
	
	for(b = 0; b <= 3; b++){
		scanf("%s", a[b]);
	}
	
	for(b = 1; b <= 3; b++){
		if(a[0] == a[b]){
			c = c + 1;
		}else{
			d[e] = a[b];
			e = e + 1;
		}
	    
		if(c == 1){
			if(d[0] == d[1]){
				printf("yes");
			}else{
				printf("no");
			}
		}
		return 0;
	}

Compiler output:
main.c: In function 'main':
main.c:27:9: error: expected declaration or statement at end of input
   27 |         }
      |         ^
Language: C++

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

int main() {
  vector<char> A(4);
  for (int i = 0; i < 4; i++) {
    cin >> A.at(i);
  }
  
  if (((A.at(0) == A.at(1)) &&(A.at(2) == A.at(3)) ||((A.at(0) == A.at(2)) &&(A.at(1) == A.at(3)) ||((A.at(0) == A.at(1)) &&(A.at(2) == A.at(3)) ||((A.at(0) == A.at(3)) &&(A.at(1) == A.at(2))||((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:10:240: error: expected ')' before '{' token
   10 |   if (((A.at(0) == A.at(1)) &&(A.at(2) == A.at(3)) ||((A.at(0) == A.at(2)) &&(A.at(1) == A.at(3)) ||((A.at(0) == A.at(1)) &&(A.at(2) == A.at(3)) ||((A.at(0) == A.at(3)) &&(A.at(1) == A.at(2))||((A.at(0) == A.at(1)) &&(A.at(2) == A.at(3)))){
      |                                                                                                     ~                                                                                                                                          ^
      |                                                                                                                                                                                                                                                )
a.cc:13:4: error: expected ')' before 'else'
   13 |   }
      |    ^
      |    )
   14 |   else {
      |   ~~~~
a.cc:10:54: note: to match this '('
   10 |   if (((A.at(0) == A.at(1)) &&(A.at(2) == A.at(3)) ||((A.at(0) == A.at(2)) &&(A.at(1) == A.at(3)) ||((A.at(0) == A.at(1)) &&(A.at(2) == A.at(3)) ||((A.at(0) == A.at(3)) &&(A.at(1) == A.at(2))||((A.at(0) == A.at(1)) &&(A.at(2) == A.at(3)))){
      |                                                      ^
a.cc:16:4: error: expected ')' before '}' token
   16 |   }
      |    ^
      |    )
   17 | }
      | ~   
a.cc:10:7: note: to match this '('
   10 |   if (((A.at(0) == A.at(1)) &&(A.at(2) == A.at(3)) ||((A.at(0) == A.at(2)) &&(A.at(1) == A.at(3)) ||((A.at(0) == A.at(1)) &&(A.at(2) == A.at(3)) ||((A.at(0) == A.at(3)) &&(A.at(1) == A.at(2))||((A.at(0) == A.at(1)) &&(A.at(2) == A.at(3)))){
      |       ^
a.cc:16:4: error: expected ')' before '}' token
   16 |   }
      |    ^
      |    )
   17 | }
      | ~   
a.cc:10:6: note: to match this '('
   10 |   if (((A.at(0) == A.at(1)) &&(A.at(2) == A.at(3)) ||((A.at(0) == A.at(2)) &&(A.at(1) == A.at(3)) ||((A.at(0) == A.at(1)) &&(A.at(2) == A.at(3)) ||((A.at(0) == A.at(3)) &&(A.at(1) == A.at(2))||((A.at(0) == A.at(1)) &&(A.at(2) == A.at(3)))){
      |      ^
a.cc:17:1: error: expected primary-expression before '}' token
   17 | }
      | ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: expected unqualified-id before '>>' token
    6 |   int >> s;
      |       ^~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: expected ';' at end of input
   12 |     else cout<<"No"
      |                    ^
      |                    ;
a.cc:12:20: error: expected '}' at end of input
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

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

int main(){
  string s;
  cin >> s;
  bool ans=fales;
  if(s[0]==s[1]&&s[2]==s[3]&&s[0]!=s[2]) ans=true;
  if(s[0]==s[2]&&s[1]==s[3]&&s[0]!=s[1]) ans=true;
  if(s[0]==s[3]&&s[1]==s[2]&&s[0]!=s[1]) ans=true;
  if(ans) puts("Yes");
  else puts("No");
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: 'fales' was not declared in this scope
    7 |   bool ans=fales;
      |            ^~~~~
Language: C++

#include<cmath>
using namespace std;   
#include<cmath>
using namespace std;
 
int main(){
   char g[6];
    cin >> g;
   
if(g[0]==g[1]||g[2]==g[3]){
  cout <<"No";
}else if(g[1]==g[2]&&g[0]==g[3]){
  cout <<"Yes";
}else if(g[0]==g[3]&&g[1]==g[2]){
  cout <<"Yes";
}else cout <<"No";
}if(g[0]==g[1]&&g[2]==g[3]){
  cout <<"Yes";
}else if(g[1]==g[2]&&g[0]==g[3]){
  cout <<"Yes";
}else if(g[0]==g[3]&&g[1]==g[2]){
  cout <<"Yes";
}else cout <<"No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     cin >> g;
      |     ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<cmath>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:11:3: error: 'cout' was not declared in this scope
   11 |   cout <<"No";
      |   ^~~~
a.cc:11:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:3: error: 'cout' was not declared in this scope
   13 |   cout <<"Yes";
      |   ^~~~
a.cc:13:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:3: error: 'cout' was not declared in this scope
   15 |   cout <<"Yes";
      |   ^~~~
a.cc:15:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:7: error: 'cout' was not declared in this scope
   16 | }else cout <<"No";
      |       ^~~~
a.cc:16:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc: At global scope:
a.cc:17:2: error: expected unqualified-id before 'if'
   17 | }if(g[0]==g[1]&&g[2]==g[3]){
      |  ^~
a.cc:19:2: error: expected unqualified-id before 'else'
   19 | }else if(g[1]==g[2]&&g[0]==g[3]){
      |  ^~~~
a.cc:21:2: error: expected unqualified-id before 'else'
   21 | }else if(g[0]==g[3]&&g[1]==g[2]){
      |  ^~~~
a.cc:23:2: error: expected unqualified-id before 'else'
   23 | }else cout <<"No";
      |  ^~~~
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#include<cmath>
using namespace std;
 
int main(){
   char g[6];
    cin >> g;
   
#include<cmath>
using namespace std;
 
int main(){
   char g[6];
    cin >> g;
   
if(g[0]==g[1]||g[2]==g[3]){
  cout <<"No";
}else if(g[1]==g[2]&&g[0]==g[3]){
  cout <<"Yes";
}else if(g[0]==g[3]&&g[1]==g[2]){
  cout <<"Yes";
}else cout <<"No";
}if(g[0]==g[1]&&g[2]==g[3]){
  cout <<"Yes";
}else if(g[1]==g[2]&&g[0]==g[3]){
  cout <<"Yes";
}else if(g[0]==g[3]&&g[1]==g[2]){
  cout <<"Yes";
}else cout <<"No";
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> g;
      |     ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<cmath>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:11:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   11 | int main(){
      |         ^~
a.cc:11:9: note: remove parentheses to default-initialize a variable
   11 | int main(){
      |         ^~
      |         --
a.cc:11:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:11:11: error: a function-definition is not allowed here before '{' token
   11 | int main(){
      |           ^
a.cc:23:3: error: 'cout' was not declared in this scope
   23 |   cout <<"Yes";
      |   ^~~~
a.cc:23:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:3: error: 'cout' was not declared in this scope
   25 |   cout <<"Yes";
      |   ^~~~
a.cc:25:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:3: error: 'cout' was not declared in this scope
   27 |   cout <<"Yes";
      |   ^~~~
a.cc:27:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:28:7: error: 'cout' was not declared in this scope
   28 | }else cout <<"No";
      |       ^~~~
a.cc:28:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc: At global scope:
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

#include<cmath>
using namespace std;
 
int main(){
   char g[6];
    cin >> g;
   
#include<cmath>
using namespace std;
 
int main(){
   char g[6];
    cin >> g;
   
if(g[0]==g[1]||g[2]==g[3]){
  cout <<"No";
}else if(g[1]==g[2]&&g[0]==g[3]){
  cout <<"Yes";
}else if(g[0]==g[3]&&g[1]==g[2]){
  cout <<"Yes";
}else cout <<"No";
}if(g[0]==g[1]&&g[2]==g[3]){
  cout <<"Yes";
}else if(g[1]==g[2]&&g[0]==g[3]){
  cout <<"Yes";
}else if(g[0]==g[3]&&g[1]==g[2]){
  cout <<"Yes";
}else cout <<"No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> g;
      |     ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<cmath>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:11:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   11 | int main(){
      |         ^~
a.cc:11:9: note: remove parentheses to default-initialize a variable
   11 | int main(){
      |         ^~
      |         --
a.cc:11:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:11:11: error: a function-definition is not allowed here before '{' token
   11 | int main(){
      |           ^
a.cc:23:3: error: 'cout' was not declared in this scope
   23 |   cout <<"Yes";
      |   ^~~~
a.cc:23:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:3: error: 'cout' was not declared in this scope
   25 |   cout <<"Yes";
      |   ^~~~
a.cc:25:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:3: error: 'cout' was not declared in this scope
   27 |   cout <<"Yes";
      |   ^~~~
a.cc:27:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:28:7: error: 'cout' was not declared in this scope
   28 | }else cout <<"No";
      |       ^~~~
a.cc:28:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

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

    vector<int> a(4);
    for (int i = 0; i < 4; i++) {
        a[i] = int(s[i]);
    }
    sort(a.begin(), a.end());


    if ((a[1] != a[2]) && (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:14:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |     sort(a.begin(), a.end());
      |     ^~~~
      |     short
Language: C++

#include <iostream>
#include <cstdlib>
#include <vector>
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)){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
}

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

#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const int INF = 1 << 30;
const ll INFll = 1ll << 60;
 
int main() {
    string s;
    cin >> s;

    bool f;
    if(s[0] == s[1] && s[0] != s[2] && s[2] = s[3]){ cout << "Yes" << endl; return 0;}
    if(s[0] != s[1] && s[0] == s[2] && s[1] == s[3]){ cout << "Yes" << endl; return 0;}
    if(s[0] != s[1] && s[1] == s[2] && s[0] == s[3]){ cout << "Yes" << endl; return 0;}

    cout << "No" << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:37: error: lvalue required as left operand of assignment
   14 |     if(s[0] == s[1] && s[0] != s[2] && s[2] = s[3]){ cout << "Yes" << endl; return 0;}
Language: C++

#include<iostream>
using namespace std;

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;
        return 0;
    }

    cout << "No" << endl;
    return 0;
}

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

#include<iostream>
using namespace std;

int main(){
    string s; cin >> s;
    sort(s.begin(), s.end());

    if (s[0] == s[1] && s[2] == s[3]){
        cout << "Yes" << endl;
        return 0;
    }

    cout << "No" << endl;
    return 0;
}

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

#include<stdio.h>

int main(){
    char b[4];
    scanf("%d",&b);
    char first,second = '\0';
    first = b[0];
    if(first != b[1]){
        second = b[1];
    }
    if(first != b[2] && second == '\0'){/*三つめが違う */
        second = b[2];
    }else if(b[2] == first || b[2] == second){break;
    }else{printf("No");
    }
    if(b[0] == b[1] && b[2] == b[3]){
        printf("Yes");
    }else if(b[0] == b[2] && b[1] == b[3] ){
        printf("Yes");
    }
    else if(b[0] == b[3] && b[1] == b[2]){
        printf("Yes");
    }else{
        printf("No");
    }
}

Compiler output:
main.c: In function 'main':
main.c:13:47: error: break statement not within loop or switch
   13 |     }else if(b[2] == first || b[2] == second){break;
      |                                               ^~~~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#define rep(i,n) for(int i = 0; i < (long int)n; i++)
typedef long long ll;
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: expected primary-expression before ']' token
   16 |    or S[]){
      |         ^
Language: C++

#include<bits/stdc++.h.
using namespace std;
int main()
{
  int S;
  cin>>S;
  int a,b,c,d;
  if(a==b or a==c or a==d)
    if(b==c or b==d)
      if(c==d)
        cout<<"Yes";
  		 else
           cout<<"NO";
  	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  sting 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] ){
    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:5:3: error: 'sting' was not declared in this scope
    5 |   sting 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(){
  sting 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] ){
    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:1:10: fatal error: bits;stdc++.h: No such file or directory
    1 | #include <bits;stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main(){
  sting 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] ){
    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:1:10: fatal error: bits;stdc++h.: No such file or directory
    1 | #include <bits;stdc++h.>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

main(){
  char S[10];
  scanf("%s",S);
  
  sort(S,S+4);
  printf((S[0]==S[1] && S[1]!=S[2] && S[2]==S[3]) ? "Yes\n" : "No\n")
} 

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:10:70: error: expected ';' before '}' token
   10 |   printf((S[0]==S[1] && S[1]!=S[2] && S[2]==S[3]) ? "Yes\n" : "No\n")
      |                                                                      ^
      |                                                                      ;
   11 | }
      | ~
Language: C++

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

main(){
  char S[10];
  scanf("%s",S);
  
  sort(S,S+4);
  printf((s[0]==s[1] && S[1]!=S[2] && S[2]==S[3]) ? "Yes\n" : "No\n")
} 

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:10:11: error: 's' was not declared in this scope
   10 |   printf((s[0]==s[1] && S[1]!=S[2] && S[2]==S[3]) ? "Yes\n" : "No\n")
      |           ^
Language: C++

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

main(){
  char S[10];
  scanf("%s",S);
  
  sort(s,s+4);
  printf((s[0]==s[1] && S[1]!=S[2] && S[2]==S[3]) ? "Yes\n" : "No\n")
} 

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:8: error: 's' was not declared in this scope
    9 |   sort(s,s+4);
      |        ^
Language: C++

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

main(){
  char S[10];
  scanf("%s",s);
  
  sort(s,s+4);
  printf((s[0]==s[1] && S[1]!=S[2] && S[2]==S[3]) ? "Yes\n" : "No\n")
} 

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:14: error: 's' was not declared in this scope
    7 |   scanf("%s",s);
      |              ^
Language: C++

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

main(){
  char S[10];
  scanf("%s",s);
  
  sort(s,s+4);
  printf((s[0]==s[1] && S[1]!=S[2] && S[2]==S[3]) ? "Yes\n" : "No\n")
} 

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

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

main(){
  char S[10];
  scanf("%s",s);
  
  sort(s,s+4);
  printf((s[0]==s[1] && S[1]!=S[2] && S[2]==S[3]) ? "Yes\n" : "No\n")
}
  
  
          
      
  
  
  

Compiler output:
a.cc:2:9: fatal error: algorythm: No such file or directory
    2 | #include<algorythm>
      |         ^~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;

class Main{
	
    public static void main(String[] args){

	Scanner sc = new Scanner(System.in);

	String S = sc.nextLine();

	if(S[0]==S[1]&& S[1]!=S[2]&& S[2]==S[3]){

	System.out.println("Yes");

   }
	
	else if(S[0]==S[2]&& S[2]!=S[1] &&S[1]==S[3]){
	
	System.out.println("Yes");

   }	

	else if(S[0]==S[3] && S[3]!=S[1] && S[1]==S[2]){

	System.out.println("Yes");

   }

	else{

	System.out.println("No");

   }
  }
 }

Compiler output:
Main.java:11: error: array required, but String found
	if(S[0]==S[1]&& S[1]!=S[2]&& S[2]==S[3]){
	    ^
Main.java:11: error: array required, but String found
	if(S[0]==S[1]&& S[1]!=S[2]&& S[2]==S[3]){
	          ^
Main.java:11: error: array required, but String found
	if(S[0]==S[1]&& S[1]!=S[2]&& S[2]==S[3]){
	                 ^
Main.java:11: error: array required, but String found
	if(S[0]==S[1]&& S[1]!=S[2]&& S[2]==S[3]){
	                       ^
Main.java:11: error: array required, but String found
	if(S[0]==S[1]&& S[1]!=S[2]&& S[2]==S[3]){
	                              ^
Main.java:11: error: array required, but String found
	if(S[0]==S[1]&& S[1]!=S[2]&& S[2]==S[3]){
	                                    ^
Main.java:17: error: array required, but String found
	else if(S[0]==S[2]&& S[2]!=S[1] &&S[1]==S[3]){
	         ^
Main.java:17: error: array required, but String found
	else if(S[0]==S[2]&& S[2]!=S[1] &&S[1]==S[3]){
	               ^
Main.java:17: error: array required, but String found
	else if(S[0]==S[2]&& S[2]!=S[1] &&S[1]==S[3]){
	                      ^
Main.java:17: error: array required, but String found
	else if(S[0]==S[2]&& S[2]!=S[1] &&S[1]==S[3]){
	                            ^
Main.java:17: error: array required, but String found
	else if(S[0]==S[2]&& S[2]!=S[1] &&S[1]==S[3]){
	                                   ^
Main.java:17: error: array required, but String found
	else if(S[0]==S[2]&& S[2]!=S[1] &&S[1]==S[3]){
	                                         ^
Main.java:23: error: array required, but String found
	else if(S[0]==S[3] && S[3]!=S[1] && S[1]==S[2]){
	         ^
Main.java:23: error: array required, but String found
	else if(S[0]==S[3] && S[3]!=S[1] && S[1]==S[2]){
	               ^
Main.java:23: error: array required, but String found
	else if(S[0]==S[3] && S[3]!=S[1] && S[1]==S[2]){
	                       ^
Main.java:23: error: array required, but String found
	else if(S[0]==S[3] && S[3]!=S[1] && S[1]==S[2]){
	                             ^
Main.java:23: error: array required, but String found
	else if(S[0]==S[3] && S[3]!=S[1] && S[1]==S[2]){
	                                     ^
Main.java:23: error: array required, but String found
	else if(S[0]==S[3] && S[3]!=S[1] && S[1]==S[2]){
	                                           ^
18 errors
Language: C++

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

int main(){
char s[4]; int ans=0;
scanf("%s",s);
    if(s[0]==s[1]){
        if((s[2]==s[3]) && (s[0]!=s[2])){
            ans++;
        }
    }else if((s[0]==s[2]) && (s[1]==s[3]) && (a[0] != s[1])){
        ans++;
    }else if((s[0]==s[3]) && (s[1]==s[2]) && s[0] != s[1]){
        ans++;
    }
    if(!ans){
        cout << "No" << endl;
        }else{
            cout << "Yes" << endl;
        }

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:47: error: 'a' was not declared in this scope
   12 |     }else if((s[0]==s[2]) && (s[1]==s[3]) && (a[0] != s[1])){
      |                                               ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
int main(){
	std::string s;
	std::cin  >> s;
	std::vector<int> v(100,0);
	
	for(auto i:s){
		v[i] += 1; 
	}

	int count = 0;
	for(auto i: v){
		if(i == 2){
			count++;
		}
	}

	if(count == 2){
		std::cout << "YES";
	}else{
		std::cout << "NO";
	}
}#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
int main(){
	std::string s;
	std::cin  >> s;
	std::vector<int> v(100,0);
	
	for(auto i:s){
		v[i] += 1; 
	}

	int count = 0;
	for(auto i: v){
		if(i == 2){
			count++;
		}
	}

	if(count == 2){
		std::cout << "YES";
	}else{
		std::cout << "NO";
	}
}

Compiler output:
a.cc:27:2: error: stray '#' in program
   27 | }#include<iostream>
      |  ^
a.cc:27:3: error: 'include' does not name a type
   27 | }#include<iostream>
      |   ^~~~~~~
Language: C++

#include <bits/stdc++.h>
#define int long long
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define pb push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
typedef long long ll;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

signed main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  map<char,int> m;
  REP(i, 4) {
    if(m.find(S[i]) == m.end()) {
      m.insert({S[i],1});
    } else {
      m.find(S[i])->second++;
    }
  }
  if (m.size() == 2 && m.begin()->second == 2 && (m.begin()++).second == 2) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:64: error: 'std::_Rb_tree_iterator<std::pair<const char, long long int> >::_Self' has no member named 'second'
   26 |   if (m.size() == 2 && m.begin()->second == 2 && (m.begin()++).second == 2) cout << "Yes" << endl;
      |                                                                ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define int long long
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define pb push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
typedef long long ll;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

signed main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  vector<pair<char,int>> v;
  REP(i, 4) {
    if(m.find(S[i]) == m.end()) {
      m.insert({S[i],1});
    } else {
      m.find(S[i])->second++;
    }
  }
  if (m.size() == 2 && m.begin()->second == 2 && (m.begin()++).second == 2) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:8: error: 'm' was not declared in this scope
   20 |     if(m.find(S[i]) == m.end()) {
      |        ^
a.cc:26:7: error: 'm' was not declared in this scope
   26 |   if (m.size() == 2 && m.begin()->second == 2 && (m.begin()++).second == 2) cout << "Yes" << endl;
      |       ^
Language: C++

#include <bits/stdc++.h>
#define int long long
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define pb push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
typedef long long ll;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

signed main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  map<char,int> m;
  REP(i, 4) {
    if(m.find(S[i]) == m.end()) {
      m.insert({S[i],1});
    } else {
      m.find(S[i])->second++;
    }
  }
  if (m.size() == 2 && m[0].second == 2 && m[1].second == 2) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:29: error: request for member 'second' in 'm.std::map<char, long long int>::operator[](0)', which is of non-class type 'std::map<char, long long int>::mapped_type' {aka 'long long int'}
   26 |   if (m.size() == 2 && m[0].second == 2 && m[1].second == 2) cout << "Yes" << endl;
      |                             ^~~~~~
a.cc:26:49: error: request for member 'second' in 'm.std::map<char, long long int>::operator[](1)', which is of non-class type 'std::map<char, long long int>::mapped_type' {aka 'long long int'}
   26 |   if (m.size() == 2 && m[0].second == 2 && m[1].second == 2) cout << "Yes" << endl;
      |                                                 ^~~~~~
Language: C++

#include<stdio.h>
#include<string.h>
int main()
{
  char s[3];
  gets(s);


if((s[0] == s[1] && s[1] != s[3] && s[2] == s[3]) ||
       (s[0] == s[2] && s[1] == s[3] && s[0] != s[3]) ||
       (s[0] == s[3] && s[1] == s[2] && s[3] != s[1]))
{


    printf("Yes");
}

else 

    printf("No");


return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |   gets(s);
      |   ^~~~
      |   getw
Language: C++

#include<stdio.h>
#include<string.h>
int main()
{
  char s[3];
  gets(s);


if((s[0] == s[1] && s[1] != s[3] && s[2] == s[3]) ||
       (s[0] == s[2] && s[1] == s[3] && s[0] != s[3]) ||
       (s[0] == s[3] && s[1] == s[2] && s[3] != s[1]))
{


    printf("Yes");
}

else {

    printf("No");

}
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |   gets(s);
      |   ^~~~
      |   getw
Language: C++

#include "pch.h"
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main() {
	string s;
	cin >> s;
	sort(s.begin(), s.end()); //文字列の最初から最後の範囲でソート

	if (s[0] == s[1] && s[2] == s[3] && s[1] != s[2]) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}


Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<algorithm>
#include<String>
using namespace std;

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


Compiler output:
a.cc:3:9: fatal error: String: No such file or directory
    3 | #include<String>
      |         ^~~~~~~~
compilation terminated.
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'String' was not declared in this scope
    6 |   String S;
      |   ^~~~~~
a.cc:7:10: error: 'S' was not declared in this scope
    7 |   cin >> S;
      |          ^
a.cc:12:13: error: 'Yes' was not declared in this scope
   12 |     cout << Yes << endl;
      |             ^~~
a.cc:14:13: error: 'No' was not declared in this scope
   14 |     cout << No << endl;
      |             ^~