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

#include <iostream>
#include <string>

using namespace std;

int main(){
    string S;
    //Sを定義
    char A;
    //Aを定義
    char B;
    //Bを定義
    bool isgood = true;
    if (S[A] == S[B]) isgood = false;
    if (S[B] == S[A]) isgood = false;
    bool duplicategooda = true;
    if (S[A] == S[A]) duplicategood = false;
    bool duplicategoodb = true;
    if (S[B] == S[B]) duplicategood = false;

    if (isgood && isgood){
        cout << "Yes" << endl;
    } else if(duplicategooda && duplicategoodb){
        cout << "Yes" << endl;
    } else if(duplicategoodb && duplicategooda){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:23: error: 'duplicategood' was not declared in this scope; did you mean 'duplicategooda'?
   17 |     if (S[A] == S[A]) duplicategood = false;
      |                       ^~~~~~~~~~~~~
      |                       duplicategooda
a.cc:19:23: error: 'duplicategood' was not declared in this scope; did you mean 'duplicategoodb'?
   19 |     if (S[B] == S[B]) duplicategood = false;
      |                       ^~~~~~~~~~~~~
      |                       duplicategoodb
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
    string S;
    //Sを定義
    char A;
    //Aを定義
    char B;
    //Bを定義
    bool isgood = true;
    if (S[A] == S[B]) isgood = false;
    if (S[B] == S[A]) isgood = false;
    bool duplicategood true;
    if (S[A] == S[A]) duplicategood = false;
    if (S[A] == S[A]) duplicategood = false;

    if (isgood && isgood){
        cout << "Yes" << endl;
    } else if(duplicategood && duplicategood){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:24: error: expected initializer before 'true'
   16 |     bool duplicategood true;
      |                        ^~~~
a.cc:17:23: error: 'duplicategood' was not declared in this scope
   17 |     if (S[A] == S[A]) duplicategood = false;
      |                       ^~~~~~~~~~~~~
a.cc:18:23: error: 'duplicategood' was not declared in this scope
   18 |     if (S[A] == S[A]) duplicategood = false;
      |                       ^~~~~~~~~~~~~
a.cc:22:15: error: 'duplicategood' was not declared in this scope
   22 |     } else if(duplicategood && duplicategood){
      |               ^~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
    string S;
    //Sを定義
    char A;
    //Aを定義
    char B;
    //Bを定義
    bool isgood = true;
    if (S[A] == S[B]) isgood = false;
    if (S[B] == S[A]) isgood = false;
    bool duplicategood true;
    if (S[A] == S[A]) duplicategood = false;
    if (S[A] == S[A]) duplicategood = false;

    if (isgood && isgood){
        cout << "Yes" << endl;
    } else (duplicategood && duplicategood){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:24: error: expected initializer before 'true'
   16 |     bool duplicategood true;
      |                        ^~~~
a.cc:17:23: error: 'duplicategood' was not declared in this scope
   17 |     if (S[A] == S[A]) duplicategood = false;
      |                       ^~~~~~~~~~~~~
a.cc:18:23: error: 'duplicategood' was not declared in this scope
   18 |     if (S[A] == S[A]) duplicategood = false;
      |                       ^~~~~~~~~~~~~
a.cc:22:13: error: 'duplicategood' was not declared in this scope
   22 |     } else (duplicategood && duplicategood){
      |             ^~~~~~~~~~~~~
a.cc:24:7: error: 'else' without a previous 'if'
   24 |     } else {
      |       ^~~~
Language: C

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

using namespace std;
int main()
{
 
    char s[4];
    scanf("%s", s);

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

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;

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


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

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

int main() {
    string str;
    cin >> str;
    bool flag = false;
    int i = 1;

    sort(str.begin, str.end());
    if (str[0] == str[1] && str[2] == str[3]) flag = true;

    if (flag) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: no matching function for call to 'sort(<unresolved overloaded function type>, std::__cxx11::basic_string<char>::iterator)'
   10 |     sort(str.begin, str.end());
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~
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: 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >]'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:32: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |          ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int cnt = 0
    vector<char> a(4);
    cin >> a;

    for(int i = 0; i < 3; i++){
        for(int j = i + 1; i < 4; j++){
            if(a.at(i) == a.at(j)){
                cnt++;
                break;
            }
        }
    }
    if(cnt == 2){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected ',' or ';' before 'vector'
    6 |     vector<char> a(4);
      |     ^~~~~~
a.cc:7:12: error: 'a' was not declared in this scope
    7 |     cin >> a;
      |            ^
Language: Java

package com.company;

import java.util.Collections;
import java.util.List;
import java.util.Scanner;
import java.util.ArrayList;

public class Main {

    public static void main(String[] args) {
        List<Integer> l = new ArrayList<>();
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        for (int i = 1; i < s.length(); i++) {
            int x = s[i];
            l.add(x);
        }
        Collections.sort(l);
        if (l[0] == l[1] && l[2] == l[3]) {
            System.out.println("Yes");
        }
        else {
            System.out.println("No");
        }
    }
}


Compiler output:
Main.java:15: error: array required, but String found
            int x = s[i];
                     ^
Main.java:19: error: array required, but List<Integer> found
        if (l[0] == l[1] && l[2] == l[3]) {
             ^
Main.java:19: error: array required, but List<Integer> found
        if (l[0] == l[1] && l[2] == l[3]) {
                     ^
Main.java:19: error: array required, but List<Integer> found
        if (l[0] == l[1] && l[2] == l[3]) {
                             ^
Main.java:19: error: array required, but List<Integer> found
        if (l[0] == l[1] && l[2] == l[3]) {
                                     ^
5 errors
Language: C

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

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

#include <stdio.h>
int main()
{
  char moji[4];
  
  printf("文字列を入力して下さい。");
  scanf("%s",moji);
  
  if(moji[0]==moji[1]&&moji[2]==moji[3]&&moji[0]!=moji[2])
  {
    printf("YES");
  }
  else if(moji[0]==moji[2]&&moji[1]==moji[3]&&moji[0]!=moji[1])
  {
    printf("YES");
  }
  else(moji[0]==moji[3]&&moji[1]==moji[2]&&moji[0]!=moji[1])
  {
    printf("YES");
  }
  
  
  return 0;
  
}

Compiler output:
main.c: In function 'main':
main.c:17:61: error: expected ';' before '{' token
   17 |   else(moji[0]==moji[3]&&moji[1]==moji[2]&&moji[0]!=moji[1])
      |                                                             ^
      |                                                             ;
   18 |   {
      |   ~
Language: C++


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


int main(){
   string s;
   cin >> s;
   for(int i=0; i<3 i++){
     if(i==0){
       if(s.substr(i,1)==s.substr(i+1,1) || s.substr(i,1)==s.substr(i+2,1) || s.substr(i,1)==s.substr(i+3,1) ){
           continue;
        }else{
            cout << “No”;
            return 0;
        }
     }
     if(i==1){
       if(s.substr(i,1)==s.substr(i-1,1) || s.substr(i,1)==s.substr(i+1,1) || s.substr(i,1)==s.substr(i+2,1) ){
           continue;
        }else{
            cout << “No”;
            return 0;
        }
     }
     if(i==2){
       if(s.substr(i,1)==s.substr(i-1,1) || s.substr(i,1)==s.substr(i-2,1) || s.substr(i,1)==s.substr(i+1,1) ){
           continue;
        }else{
            cout << “No”;
            return 0;
        }
     }
   }
   cout << “Yes”;
  
}





Compiler output:
a.cc:17:21: error: extended character “ is not valid in an identifier
   17 |             cout << “No”;
      |                     ^
a.cc:17:21: error: extended character ” is not valid in an identifier
a.cc:25:21: error: extended character “ is not valid in an identifier
   25 |             cout << “No”;
      |                     ^
a.cc:25:21: error: extended character ” is not valid in an identifier
a.cc:33:21: error: extended character “ is not valid in an identifier
   33 |             cout << “No”;
      |                     ^
a.cc:33:21: error: extended character ” is not valid in an identifier
a.cc:38:12: error: extended character “ is not valid in an identifier
   38 |    cout << “Yes”;
      |            ^
a.cc:38:12: error: extended character ” is not valid in an identifier
a.cc: In function 'int main()':
a.cc:12:20: error: expected ';' before 'i'
   12 |    for(int i=0; i<3 i++){
      |                    ^~
      |                    ;
a.cc:17:21: error: '\U0000201cNo\U0000201d' was not declared in this scope
   17 |             cout << “No”;
      |                     ^~~~
a.cc:25:21: error: '\U0000201cNo\U0000201d' was not declared in this scope
   25 |             cout << “No”;
      |                     ^~~~
a.cc:33:21: error: '\U0000201cNo\U0000201d' was not declared in this scope
   33 |             cout << “No”;
      |                     ^~~~
a.cc:38:12: error: '\U0000201cYes\U0000201d' was not declared in this scope
   38 |    cout << “Yes”;
      |            ^~~~~
Language: C++

#include<bits/c++std.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";
	else cout<<"No";
}

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

#include <iostream>

using namespace std;
string s;
int main()
{
    cin >> s;
    for(int i = 0; i < 4; i++){
        for(int j = i + 1; j < 4; j++){
            if(s[i] == s[j]){
                cnt++;
            }
        }
        if(cnt == 1){
            cout << "Yes";
            break;
        }else{
            cout << "No";
            break;
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
   11 |                 cnt++;
      |                 ^~~
      |                 int
a.cc:14:12: error: 'cnt' was not declared in this scope; did you mean 'int'?
   14 |         if(cnt == 1){
      |            ^~~
      |            int
Language: C++

#include<bits/stdc++.h>
using namespace std;
char s[4];
int i,j,k,c;
cin>> s[4];
int main(void){
  
for(i = 0; i < 4; i++){
  for(j = i+1; j < 4; j++){
  if(s[i] == s[j]){
    c++;
    break;
  }else{
    k = j;
    break;
  }
  }
}
 
 
  for(j = i+1; j < 4; j++){
  if(s[k] == s[j]){
    c++;
    break;
  }
  }
 
if (k == 2){
  cout<<"YES"<<endl;
}else{
  cout<<"NO"<<endl;
}
 
return 0;
}


Compiler output:
a.cc:5:1: error: 'cin' does not name a type
    5 | cin>> s[4];
      | ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
char s[4];
int i,j,k,c;
sin>> s;
int main(void){
  
for(i = 0; i < 4; i++){
  for(j = i+1; j < 4; j++){
  if(s[i] == s[j]){
    c++;
    break;
  }else{
    k = j;
    break;
  }
  }
}
 
 
  for(j = i+1; j < 4; j++){
  if(s[k] == s[j]){
    c++;
    break;
  }
  }
 
if (k == 2){
  cout<<YES<<endl;
}else{
  cout<<NO<<endl;
}
 
return 0;
}

Compiler output:
a.cc:5:1: error: 'sin' does not name a type
    5 | sin>> s;
      | ^~~
a.cc: In function 'int main()':
a.cc:29:9: error: 'YES' was not declared in this scope
   29 |   cout<<YES<<endl;
      |         ^~~
a.cc:31:9: error: 'NO' was not declared in this scope
   31 |   cout<<NO<<endl;
      |         ^~
Language: C++

#include<bits/stdc++.h>
using namespace std
char s[4];
cin >> s;
int main(void){
  
for(i = 0; i < 4; i++){
  for(j = i+1; j < 4; j++){
  if(s[i] == s[j]){
    c++;
    break;
  }else{
    k = j;
    break;
  }
  }
}


  for(j = i+1; j < 4; j++){
  if(s[k] == s[j]){
    c++;
    break;
  }
  }

if (k == 2){
  cout<<YES<<endl;
}else{
  cout<<NO<<endl;
}

return 0;
}
    


Compiler output:
a.cc:2:20: error: expected ';' before 'char'
    2 | using namespace std
      |                    ^
      |                    ;
    3 | char s[4];
      | ~~~~                
a.cc:4:1: error: 'cin' does not name a type
    4 | cin >> s;
      | ^~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'i' was not declared in this scope
    7 | for(i = 0; i < 4; i++){
      |     ^
a.cc:8:7: error: 'j' was not declared in this scope
    8 |   for(j = i+1; j < 4; j++){
      |       ^
a.cc:10:5: error: 'c' was not declared in this scope
   10 |     c++;
      |     ^
a.cc:13:5: error: 'k' was not declared in this scope
   13 |     k = j;
      |     ^
a.cc:20:7: error: 'j' was not declared in this scope
   20 |   for(j = i+1; j < 4; j++){
      |       ^
a.cc:20:11: error: 'i' was not declared in this scope
   20 |   for(j = i+1; j < 4; j++){
      |           ^
a.cc:21:8: error: 'k' was not declared in this scope
   21 |   if(s[k] == s[j]){
      |        ^
a.cc:22:5: error: 'c' was not declared in this scope
   22 |     c++;
      |     ^
a.cc:27:5: error: 'k' was not declared in this scope
   27 | if (k == 2){
      |     ^
a.cc:28:9: error: 'YES' was not declared in this scope
   28 |   cout<<YES<<endl;
      |         ^~~
a.cc:30:9: error: 'NO' was not declared in this scope
   30 |   cout<<NO<<endl;
      |         ^~
Language: C

#include<stdio.h>
int juge(char *a,int c){
  int cnt1=0;
  int cnt2=0;
  for(int i=0;a[i]=='\0';i++){
    if(a[0]==a[i])
      cnt1++;
    if(a[c]==a[i])
      cnt2++;
  }
  if cnt1 == 2 && cnt2 == 2
    return 1;
  else 
    return 0
}

int main(){
  char a[5];
  int c;
  scanf("%s",a);

  for(c=0;a[c]!='\0' && a[0]==a[c];c++);
  
  if(c==5)
    printf("No");
  else 
    if(juge(a,c))
      printf("Yes");
    else 
      printf("No");
   
  return 0;
}

Compiler output:
main.c: In function 'juge':
main.c:11:6: error: expected '(' before 'cnt1'
   11 |   if cnt1 == 2 && cnt2 == 2
      |      ^~~~
      |      (
main.c:14:13: error: expected ';' before '}' token
   14 |     return 0
      |             ^
      |             ;
   15 | }
      | ~
Language: C++

#include <iostream>
using namespace std;

void MS(int a[], int l, int r, int N){
    int tmp[N];
    if(l >= r)return;
    int m, i, j, k;
    m = (l+r)/2;
    MS(a,l,m, N);
    MS(a,m+1,r, N);
    k = 0;
    for(i = l; i <= m; i++){
        tmp[k] = a[i];
        k++;
    }
    for(j = r; j>=m+1; j--){
        tmp[k] = a[j];
        k++;
    }
    i = 0;
    j = r-l;
    for(k = l; k <= r; k++){
        if(tmp[i] >= tmp[j]){
            a[k] = tmp[i];
            i++;
        }
        else{
            a[k] = tmp[j];
            j--;
        }
    }
}


int main(){
    int N;
    cin>>N;
    int d[N];
    int c = 0;
    int i = 0, l;
    while(i < N && cin>>l){
        d[i] = l;
        i++;
    }

    MS(d,0,N-1,N);

    int arc, abc;
    for(int K = d[N*3/4)]; K <= d[N/4]; K++){
        arc=0, abc =0;
        for(i = 0; i < N; i++){
            if(d[i] < K){
                abc++;
            }
            else{
                arc++;
            }
        }
        if(arc == abc)
            c++;
    }

    cout<<c<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:24: error: expected ']' before ')' token
   49 |     for(int K = d[N*3/4)]; K <= d[N/4]; K++){
      |                        ^
      |                        ]
a.cc:49:24: error: expected ';' before ')' token
   49 |     for(int K = d[N*3/4)]; K <= d[N/4]; K++){
      |                        ^
      |                        ;
a.cc:49:24: error: expected primary-expression before ')' token
a.cc:49:24: error: expected ';' before ')' token
   49 |     for(int K = d[N*3/4)]; K <= d[N/4]; K++){
      |                        ^
      |                        ;
a.cc:49:25: error: expected primary-expression before ']' token
   49 |     for(int K = d[N*3/4)]; K <= d[N/4]; K++){
      |                         ^
a.cc:49:28: error: 'K' was not declared in this scope
   49 |     for(int K = d[N*3/4)]; K <= d[N/4]; K++){
      |                            ^
Language: C++

#include<stdio.h>
#include<math.h>
#include<string.h>

int main(){
	char a[100];
	int b[26]={0};
	gets(a);
	int i,k=0;
	for(i=0;i<strlen(a);i++){
		b[a[i]-65]++;
	}
	for(i=0;i<26;i++){
		if(b[i]!=0)k++;
	}
	if(k==2){
		printf("Yes\n");
	}else{
		printf("No\n");
	}
}

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

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

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

Compiler output:
a.cc:8:13: warning: multi-character character constant [-Wmultichar]
    8 |     cout << 'No' << endl;
      |             ^~~~
a.cc: In function 'int main()':
a.cc:7:76: error: expected ')' before '{' token
    7 |   if( (s.at(0) == s.at(1)) && (s.at(1) == s.at(2)) && (s.at(2) == s.at(3) ){
      |     ~                                                                      ^
      |                                                                            )
a.cc:18:1: error: expected primary-expression before '}' token
   18 | }
      | ^
Language: C++

import atexit
import io
import sys

buff = io.BytesIO()
sys.stdout = buff


@atexit.register
def write():
    sys.__stdout__.write(buff.getvalue())


def nCk(n, k):
	if n < k or k < 0 or n < 0:
		return 0
	a = n-k
	num = fac[n]
	den = (inv[a]*inv[k])%mod
	return (num*den)%mod

mod = int(1e9) + 7
fac = [1, 1]
inv = []
for i in xrange(2, 2001):
	fac.append((fac[i-1]*i)%mod)
for i in xrange(0, 2001):
	inv.append(pow(fac[i], mod-2, mod))

n,k = map(int, raw_input().split())

for i in xrange(1,k+1):
	x = nCk(k-1,i-1)
	y = (nCk(n-k-1, i) + nCk(n-k-1, i-2))%mod + 2*nCk(n-k-1, i-1)
	y %= mod
	print (x*y)%mod 

Compiler output:
a.cc:9:1: error: stray '@' in program
    9 | @atexit.register
      | ^
a.cc:1:1: error: 'import' does not name a type
    1 | import atexit
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: request for member 'begin' in 'd', which is of non-class type 'long long int [n]'
   11 |   sort(d.begin(),d.end());
      |          ^~~~~
a.cc:11:20: error: request for member 'end' in 'd', which is of non-class type 'long long int [n]'
   11 |   sort(d.begin(),d.end());
      |                    ^~~
Language: Java

class FiftyFifty{
    public String check(String S) {
	char chr1 = S.charAt(0);
	char chr2;
	
	if (S.charAt(1) == chr1) {
	    if (chr1 != S.charAt(2) && S.charAt(2) == S.charAt(3)) {
		return "Yes";
	    } else {
		return "No";
	    }
	} else {
	    chr2 = S.charAt(1);
	}

	if (S.charAt(2) == chr1) {
	    if (S.charAt(3) == chr2) {
		return "Yes";
	    } else {
		return "No";
	    }
	} else if (S.charAt(2) == chr2) {
	    if (S.charAt(3) == chr1) {
		return "True";
	    } else {
		return "No";
	    }
	} else {
	    return "No";
	}
}

Compiler output:
Main.java:31: error: reached end of file while parsing
}
 ^
1 error
Language: C++

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

int main(){
    string S;

    cin >> S;

    char str = S[0];
    int  ans = count(S.begin(), S.end(), str);
    if(ans == 2) cout << "Yes";
    else         cout << "No";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: 'count' was not declared in this scope
   11 |     int  ans = count(S.begin(), S.end(), str);
      |                ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main(){
  vector<char> s(4);
  string str;
  cin>>str;
  for(int i=0;i<4;i++)
    s[i]=str[i];
  
  
  sort(s.begin(),s.end());
  if((s[0]==s[1])&&(s[1]!=s[2])&&(s[2]==s[3])){
    cout<<"Yes"<<endl;
    return 0;
  }
  cout<<"No"<<endl;
  return 0;
}

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

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

int main(){
    string S;

    cin >> S;

    char str = S[0];
    if(count(S.begin(), S.end(), str) == 2) cout << "Yes";
    else                                    cout << "No";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 'count' was not declared in this scope
   11 |     if(count(S.begin(), S.end(), str) == 2) cout << "Yes";
      |        ^~~~~
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		Integer n = sc.next();
        Integer arr_then = sc.next();
        Integer[] arr = arr_then.split(" ",0);
        Integer count =0;

        for(int i=1; i<arr.lenght -2;i++)
        {
            count += check(i,arr[i],arr[i+1],arr[i+2]);
        }
        

    }
    public static int check(Integer a,Integer arr_i,Integer arr_i1,Integer arr_i2 )
    {
        Integer[] data = new int[3];
        data[0] = arr_i;
        data[1] = arr_i1;
        data[2] = arr_i2;
        Integer[] sorted = Arrays.sort(data);

        if(sorted[1]==arr_i1){
            return 1;
        }
        else
        {
            return 0;
        }
    }

}

Compiler output:
Main.java:5: error: incompatible types: String cannot be converted to Integer
		Integer n = sc.next();
		                   ^
Main.java:6: error: incompatible types: String cannot be converted to Integer
        Integer arr_then = sc.next();
                                  ^
Main.java:7: error: cannot find symbol
        Integer[] arr = arr_then.split(" ",0);
                                ^
  symbol:   method split(String,int)
  location: variable arr_then of type Integer
Main.java:10: error: cannot find symbol
        for(int i=1; i<arr.lenght -2;i++)
                          ^
  symbol:   variable lenght
  location: variable arr of type Integer[]
Main.java:19: error: incompatible types: int[] cannot be converted to Integer[]
        Integer[] data = new int[3];
                         ^
Main.java:23: error: incompatible types: void cannot be converted to Integer[]
        Integer[] sorted = Arrays.sort(data);
                                      ^
6 errors
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:14:84: error: expected ')' before 'printf'
   14 |     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])
      |       ~                                                                            ^
      |                                                                                    )
   15 |     printf("Yes");
      |     ~~~~~~                                                                          
main.c:18:3: error: expected expression before '}' token
   18 |   }
      |   ^
Language: C++

/*
我的心脏怦怦跳，监管者就在附近
*/
#include<bits/stdc++.h>
#include<string>
#include<iostream>
#include<cmath>
#include<set>
#include<stack>
#include<queue>
#include<windows.h>
#include<unistd.h>
#include<stdio.h>
#include<cstring>
#define random(a,b) (rand()%(b-a+1)+a)
using namespace std;
map<char,int> a;
int main()
{
	string st;
	cin>>st;
	int i;
	if(st[0]==st[1]==st[2]==st[3]){
		cout<<"NO";
		return 0;
	} 
	for(i=0;i<st.size();i++){
		a[st[i]]++;
	}
	for(i=0;i<st.size();i+=2){
		if(a[st[i]]!=2){
			cout<<"NO";
			return 0;
		}
	}
	cout<<"YES";
	return 0;
}


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


#include <stdio.h>


int main()
{
	char str[5];
	int sum = 0;

	while (1) {
		scanf_s("%s", str, 5);

		if (str[0] == str[1] || str[1] == str[2] || str[0] == str[2]) {
			if (str[2] == str[3] || str[0] == str[3] || str[1] == str[3]) {
				if (str[0] != str[2] || str[0] != str[1]) {
					if (str[0] == str[1] && str[1] == str[2] || str[0] == str[1] && str[1] == str[3] || str[0] == str[2] && str[3] == str[2]) {
						printf("No\n");
					}
					else printf("Yes\n");
				}
				else printf("No\n");
			}
			else printf("No\n");
		}
		else printf("No\n");

		/*if (str[1] == str[2]) {
		if (str[0] == str[3]) {
		if (str[0] != str[1]) {
		printf("Yes\n");
		}
		else printf("No\n");
		}
		}

		if (str[0] == str[2]) {
		if (str[1] == str[3]) {
		if (str[0] != str[1]) {
		printf("Yes\n");
		}
		else printf("No\n");
		}
		}*/



	}
    return 0;
}



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

#include <stdio.h>

int main(){
  char vet[5];
  char a, b;
  int count1 = 0, count2 = 0;
  scanf(" %s", vet);
  if(vet[0] != vet[1]){
    a = vet[0];
    b = vet[1];
  } else {
    if(vet[1] != vet[2]){
      a = vet[1];
      b = vet[2];
    } else {
      if(vet[2] != vet[3]){
        a = vet[2];
        b = vet[3];
      } else {
        puts("No");
        return 0;
      }
    }
  }
  for(int i = 0; i < 4; ++i){
    if(a == vet[i]){
      ++count1;
    }
    if(b == vet[i]){
      ++count2;
    }
  if(count1 == 2 && count2 == 2){
    puts("Yes");
  }
  return 0;
}

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

using System;
 
namespacs Calculator
{
     class Class1
     {
        static void Main(string[] args)
        {
          
          var word = Console.ReadLine().Split( ' ' );
          string a = (word[0]);
          string b = (word[1]);
          string c = (word[2]);
          string d = (word[3]);
          
          if ((a == b) $$ (c == d))
          string x = "Yes";
          
          else if ((a == c) $$ (b == d))
          string x = "Yes";
          
          else if ((a == d) $$ (b == c))
          string x = "Yes";
          
          else
          string x = "No";
          
          Console.WriteLine(x);
        
        }
     }
}     

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:3:1: error: 'namespacs' does not name a type
    3 | namespacs Calculator
      | ^~~~~~~~~
Language: C++

using System;
 
namespacs Calculator
{
     class Program
     {
        static void Main(string[] args)
        {
          
          var word = Console.ReadLine().Split( ' ' );
          string a = (word[0]);
          string b = (word[1]);
          string c = (word[2]);
          string d = (word[3]);
          
          if ((a == b) $$ (c == d))
          string x = "Yes";
          
          else if ((a == c) $$ (b == d))
          string x = "Yes";
          
          else if ((a == d) $$ (b == c))
          string x = "Yes";
          
          else
          string x = "No";
          
          Console.WriteLine(x);
        
        }
     }
}     

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:3:1: error: 'namespacs' does not name a type
    3 | namespacs Calculator
      | ^~~~~~~~~
Language: C++

cnt = 0
for moji in s:

    num = s.count(moji)

    if num == 2:
        cnt+=1
    else:
        break
        print("No")
if cnt == 4:
    print("Yes")

Compiler output:
a.cc:1:1: error: 'cnt' does not name a type; did you mean 'int'?
    1 | cnt = 0
      | ^~~
      | int
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <string>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define SORT(x) sort(x.begin(),x.end())
#define REVE(x) reverse(x.begin(),x.end())
#define all(x) (x).begin(),(x).end()
#define fst first
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pob pop_back
#define sw swap
using LL = long long;
using ULL = unsigned long long;
#define FOR(i, m, n) for(int i = m;i < n;i++)
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
  int N,a,b,c;
  cin >>N;
    vector<int> v(N);
    rep(i, N) {cin >> v[i];
  SORT(v);
  cout << v[N/2]-v[N/2-1];
}

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

#include<stdio.h>
#include<math.h>

int main(void)
{
int x,i,n,j;
int a[100001];

scanf("%d",&n);

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

for(i=0;i<n;i++)
{
  for(j=0;j<n;j++)
  {
if(a[i]>a[j])
{
x=a[i];
a[i]=a[j];
a[j]=x;
}
}


x=a[(n/2)]-a[(n/2)-1];

printf("%d",x);

return 0;

}

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

using System;
 
namespacs Calculator
{
     class Program
     {
        static void Main(string[] args)
        {
          string a, b, c, d, x;
          var word = Console.ReadLine().Split( ' ' );
          a = string.Parse(word[0]);
          b = string.Parse(word[1]);
          c = string.Parse(word[2]);
          d = string.Parse(word[3]);
          
          if ((a == b) $$ (c == d))
          x = "Yes";
          
          else if ((a == c) $$ (b == d))
          x = "Yes";
          
          else if ((a == d) $$ (b == c))
          x = "Yes";
          
          else
          x = "No";
          
          Console.WriteLine(x);
        
        }
     }
}     

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:3:1: error: 'namespacs' does not name a type
    3 | namespacs Calculator
      | ^~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,k,a[2005][2005];
const int M=1e9+7;
int main(){
	scanf("%d %d",&n,&k);
	a[0][1]=1;
	for(int i=1;i<=n;++i){
		for(int o=1;o<=n;++o){
			a[i][o]=a[i-1][o-1]+a[i-1][o];
			if(a[i][o]>=M)a[i][o]-=M;
		}
	}
	if(i==k&&k==1){
		cout<<"1";
		return 0;
	}
	n-=k-1;
	for(int i=1;i<=k;++i){
		printf("%d\n",1ll*a[k-1][i]*a[n][i+1]%M);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: 'i' was not declared in this scope
   14 |         if(i==k&&k==1){
      |            ^
Language: C++


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


int main(void) {
    
    vector<char>a;
    char v[4];
    cin>>v;
    int i;
    for(i=0;v[i]!='\0';i++){
       a.push_back(v[i]);     
    }


    sort(a.begin(),a.end());
    
    if((a[0]==a[1])&&(a[2]==a[3])) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
   
    

    return 0;
}



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

using System;
 
namespacs Calculator
{
     class Program
     {
        static void Main(string[] args)
        {
          int a, b, c, d, x;
          var word = Console.ReadLine().Split( ' ' );
          a = string.Parse(word[0]);
          b = string.Parse(word[1]);
          c = string.Parse(word[2]);
          d = string.Parse(word[3]);
          
          if ((a == b) $$ (c == d))
          x = "Yes";
          
          else if ((a == c) $$ (b == d))
          x = "Yes";
          
          else if ((a == d) $$ (b == c))
          x = "Yes";
          
          else
          x = "No";
          
          Console.WriteLine(x);
        
        }
     }
}     

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:3:1: error: 'namespacs' does not name a type
    3 | namespacs Calculator
      | ^~~~~~~~~
Language: C++

using System;

namespacs Calculator
{
     class Program
     {
        static void Main(string[] args)
        {
          int a, b, c, d, x;
          var word = Console.ReadLine().Split( ' ' );
          a = string.Parse(word[0]);
          b = string.Parse(word[1]);
          c = string.Parse(word[2]);
          d = string.Parse(word[3]);
          
          if ((a == b) $$ (c == d))
          x = "Yes";
          
          else if ((a == c) $$ (b == d))
          x = "Yes";
          
          else if ((a == d) $$ (b == c))
          x = "Yes";
          
          else
          x = "No";
          
          Console.WriteLine(x);
        
        }
     {
{     

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:3:1: error: 'namespacs' does not name a type
    3 | namespacs Calculator
      | ^~~~~~~~~
Language: C

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

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

#include <iostream>
#include <string>
#include <set>

int main() {
  std::string S;
  std::set<string> exit;
  
  std::cin >> S;
  
  for (int i = 0; i < S.size(); i++) {
    if (exit.find(S[i]) == exit.end()) {
      exit.insert(S[i]);
    }
  }
  
  if (exit.size() == 2)
    std::cout << "Yes" << std::endl;
  else 
    std::cout << "No" << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: 'string' was not declared in this scope
    7 |   std::set<string> exit;
      |            ^~~~~~
a.cc:7:12: 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:7:18: error: template argument 1 is invalid
    7 |   std::set<string> exit;
      |                  ^
a.cc:7:18: error: template argument 2 is invalid
a.cc:7:18: error: template argument 3 is invalid
a.cc:12:14: error: request for member 'find' in 'exit', which is of non-class type 'int'
   12 |     if (exit.find(S[i]) == exit.end()) {
      |              ^~~~
a.cc:12:33: error: request for member 'end' in 'exit', which is of non-class type 'int'
   12 |     if (exit.find(S[i]) == exit.end()) {
      |                                 ^~~
a.cc:13:12: error: request for member 'insert' in 'exit', which is of non-class type 'int'
   13 |       exit.insert(S[i]);
      |            ^~~~~~
a.cc:17:12: error: request for member 'size' in 'exit', which is of non-class type 'int'
   17 |   if (exit.size() == 2)
      |            ^~~~
Language: C++

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int b[27];
int main()
{
	char a[5];
	gets(a);
	for(int i = 0 ; i < 4; i++){
		b[a[i] - 'A']++;	
	}
	for(int i = 0; i < 26; i++){
		if(b[i] == 1){
			printf("No");
			return 0;
		}
	}
	printf("Yes");
	return 0;
}

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

import collections
x=input()
y=[x[0],x[1],x[2],x[3]]
c = collections.Counter(y)
ans="Yes"
if(len(c))>3:
    ans="No"
if(ans=="Yes"):

    a=x.count(x[0])
    if(a>2):
        ans="No"



print(ans)


Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import collections
      | ^~~~~~
main.c:2:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'x'
    2 | x=input()
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    std::size_t n{};
    std::cin >> n;
    std::vector<int> ds(n, 0);
    int m = 0;
    for(std::size_t i = 0; i < n; ++i){
        std::cin >> ds[i];
        m = std::max(m, ds[i]);
    }
    int c = 0;
    for(int k = 1; k <= m; ++k){
        int c0 = 0;
        int c1 = 0;
        for(std::size_t j = 0; j < n; ++j){
            if(k < ds[j])
                ++c0;
            if(ds[j] <= k)
                ++c1;
        }
        if(c0 == c1)
            ++c;

    }
    std::cout << c << std::endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |     cin.tie(0);
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:5: error: 'ios' has not been declared
    7 |     ios::sync_with_stdio(false);
      |     ^~~
Language: C

#include<stdio.h>
int main(){
  string s[3];
  gets(s);
  if(s[1]!=s[2]){
    if(s[0]==s[1] || s[0]==s[2]){
    printf("Yes");
  }
    else{
      printf("No");
    }
 }
    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: In function 'main':
main.c:3:3: error: unknown type name 'string'; did you mean 'stdin'?
    3 |   string s[3];
      |   ^~~~~~
      |   stdin
main.c:4:3: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    4 |   gets(s);
      |   ^~~~
      |   fgets
Language: C++

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

int main() {
    string s;
    cin >> s;
    char c1 = s[0];
    char c2 = s[1];
    char c3 = s[2];
    char c4 = s[3];
    if(c1 == c2 && c3 == c4) {
        cout << "Yes";
    } else {
        if(c1 == c3 && c2 == c4) {
            cout << "Yes";
        } else {
            if(c1 == c4 && c2 == c3) {
                cout << "Yes";
                } else {
                       if(c1 != c2 || c3 != c4) {
            cout << "Yes";
    } else {
        if(c1 != c3 || c2 != c4) {
            cout << "Yes";
        } else {
            if(c1 != c4 || c2 != c3) {
                cout << "Yes"; 
            }
        }
    }
    return 0;
}



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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'Yes' was not declared in this scope
    8 |     cout<<Yes<<endl;
      |           ^~~
a.cc:11:13: error: 'Yes' was not declared in this scope
   11 |       cout<<Yes<<endl;
      |             ^~~
a.cc:14:11: error: 'Yes' was not declared in this scope
   14 |     cout<<Yes<<endl;
      |           ^~~
a.cc:17:11: error: 'No' was not declared in this scope
   17 |     cout<<No<<endl;
      |           ^~
Language: C

#include<stdio.h>

int main(){
  char s[4];
  
  for(int i=0;i<4;i++){
    scanf("%s",s[i]);
  }
  
  for(int j=0;j<4;j++){
    if(s[j] == s[j+1]) printf("Yes");
    else if(s[i] == s[i+2]) printf("Yes");
    else printf("No");
  }
  
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:15: error: 'i' undeclared (first use in this function)
   12 |     else if(s[i] == s[i+2]) printf("Yes");
      |               ^
main.c:12:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
 
using namespace std;
 
int main(){
	string s;
  	cin >> s;
  int cnt=0;
  for(int i=0;i<4;i++)
  	if(s.at(i)==s.at(i%4)) cnt++;
}

	if(cnt=2) cout << "Yes" << endl;
	else cout << "No" << endl;
}

Compiler output:
a.cc:13:9: error: expected unqualified-id before 'if'
   13 |         if(cnt=2) cout << "Yes" << endl;
      |         ^~
a.cc:14:9: error: expected unqualified-id before 'else'
   14 |         else cout << "No" << endl;
      |         ^~~~
a.cc:15:1: error: expected declaration before '}' token
   15 | }
      | ^
Language: C++

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

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(1) == S.at(2)){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected '}' before 'else'
    9 |   else if(S.at(0) == S.at(1) && S.at(2) == S.at(3)){
      |   ^~~~
a.cc:7:47: note: to match this '{'
    7 |   if(S.at(0) == S.at(1) && S.at(1) == S.at(2)){
      |                                               ^
Language: C++

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

int main(){
  string S;
  cin >> S;
  char first = S[0];
  int first_count = 0;
  int second_count = 0;
  for(int i=1;i<S.size();i++){
    if(S[i] == first){
      first_count++;
    }else if(i==1){
      char second = S[i];
    }else if(S[i]==second){
      second_count++;
    }
  }
  if(first_count==1&&second_count==1){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:16:20: error: 'second' was not declared in this scope
   16 |     }else if(S[i]==second){
      |                    ^~~~~~