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

#include <iostream>
using namespace std;
int main(){
  set<char> mySet;
  string s;
  cin>>s;
  for(int i=0;i<s.length();i++){
    if(mySet.find(s[i]) == mySet.end()) mySet.insert(s[i]);
  }
  if(mySet.size()==2) cout<<"Yes";
  else cout<<"No";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'set' was not declared in this scope
    4 |   set<char> mySet;
      |   ^~~
a.cc:2:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    1 | #include <iostream>
  +++ |+#include <set>
    2 | using namespace std;
a.cc:4:7: error: expected primary-expression before 'char'
    4 |   set<char> mySet;
      |       ^~~~
a.cc:8:8: error: 'mySet' was not declared in this scope
    8 |     if(mySet.find(s[i]) == mySet.end()) mySet.insert(s[i]);
      |        ^~~~~
a.cc:10:6: error: 'mySet' was not declared in this scope
   10 |   if(mySet.size()==2) cout<<"Yes";
      |      ^~~~~
Language: C++

int main()
{
	int n=0;
	char a[5] = { 0 };
	
	cin >> a;
	sort(rbegin(a),rend(a));
	
	if ((a[0] == a[1]) && (a[2] == a[3]) && (a[1] != a[2]))
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin >> a;
      |         ^~~
a.cc:7:14: error: 'rbegin' was not declared in this scope
    7 |         sort(rbegin(a),rend(a));
      |              ^~~~~~
a.cc:7:24: error: 'rend' was not declared in this scope; did you mean 'friend'?
    7 |         sort(rbegin(a),rend(a));
      |                        ^~~~
      |                        friend
a.cc:7:9: error: 'sort' was not declared in this scope; did you mean 'short'?
    7 |         sort(rbegin(a),rend(a));
      |         ^~~~
      |         short
a.cc:10:17: error: 'cout' was not declared in this scope
   10 |                 cout << "Yes" << endl;
      |                 ^~~~
a.cc:10:34: error: 'endl' was not declared in this scope
   10 |                 cout << "Yes" << endl;
      |                                  ^~~~
a.cc:12:17: error: 'cout' was not declared in this scope
   12 |                 cout << "No" << endl;
      |                 ^~~~
a.cc:12:33: error: 'endl' was not declared in this scope
   12 |                 cout << "No" << endl;
      |                                 ^~~~
Language: C++

#include<iostream>
#include<algorithm>


using namespace std;

int main(){


    string st;
    cin>>st;

    sort(st.begin(),st.end());

    if(st[0]!=st[1]||st[2]!=st[3]){
        cout<<"No"<<ednl;
        return 0;
    }

    cout<<"Yes"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:21: error: 'ednl' was not declared in this scope
   16 |         cout<<"No"<<ednl;
      |                     ^~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
  string s;
  cin >> s;
  for(int i=0;i<3;i++){
    for(int j=i+1;j<4;j++){
      if(s[i]==s[j]){
        string ss = (s.Remove(i,1)).Remove(j-1,1);
        if(ss[0]==ss[1]){
          cout << "Yes" << endl;
          return 0;
        }else{
          break;
        }
      }
    }
  }
  cout << "No" << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'Remove'
    9 |         string ss = (s.Remove(i,1)).Remove(j-1,1);
      |                        ^~~~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
  string s;
  cin >> s;
  for(int i=0;i<3;i++){
    for(int j=i+1;j<4;j++){
      if(s[i]==s[j]){
        string ss = (s.Replace(i,1)).Replace(j-1,1);
        if(ss[0]==ss[1]){
          cout << "Yes" << endl;
          return 0;
        }else{
          break;
        }
      }
    }
  }
  cout << "No" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'Replace'; did you mean 'replace'?
    9 |         string ss = (s.Replace(i,1)).Replace(j-1,1);
      |                        ^~~~~~~
      |                        replace
Language: C++

uwqydgfajhafuhe
efgoliheqojq,mfjb
heujwhguhewyoiujojfbk
gdufhewupwoqikfjjbjkjef
ufewgjfkhkjlkjfliuewjekljw
ufeihfiueiueihffffffffffefeh
feiuhegiiiiikjwdujhfeikhoihfejik

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

#include<bits/stdc++.h>
using namespace std;
#define SORT(x) sort(x.begin(),x.end())
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
int main(){
    string s;
    cin>>s;
    int k[27]={};
    rep(i,4){
        k[s[i]-'A']++;
    }
    rep(i,27){
        if(s[i]!=2&&s[i]!=0){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;

    return 0;
}#include<bits/stdc++.h>
using namespace std;
#define SORT(x) sort(x.begin(),x.end())
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
int main(){
    string s;
    cin>>s;
    int k[27]={};
    rep(i,4){
        k[s[i]-'A']++;
    }
    rep(i,27){
        if(s[i]!=2&&s[i]!=0){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;

    return 0;
}

Compiler output:
a.cc:27:2: error: stray '#' in program
   27 | }#include<bits/stdc++.h>
      |  ^
a.cc:27:3: error: 'include' does not name a type
   27 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:35:5: error: redefinition of 'int dx []'
   35 | int dx[]={1,0,-1,0};
      |     ^~
a.cc:9:5: note: 'int dx [4]' previously defined here
    9 | int dx[]={1,0,-1,0};
      |     ^~
a.cc:36:5: error: redefinition of 'int dy []'
   36 | int dy[]={0,1,0,-1};
      |     ^~
a.cc:10:5: note: 'int dy [4]' previously defined here
   10 | int dy[]={0,1,0,-1};
      |     ^~
a.cc:37:5: error: redefinition of 'int main()'
   37 | int main(){
      |     ^~~~
a.cc:11:5: note: 'int main()' previously defined here
   11 | int main(){
      |     ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'd' was not declared in this scope
   11 |   d=str1.at(3);
      |   ^
a.cc:18:5: error: expected '(' before '{' token
   18 |   if{y==1){
      |     ^
      |     (
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: Java

import java.util.Scanner;

public class A_Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String source = sc.next();

    for (int i = 0; i < source.length(); i++) {
      boolean appear = false;

      for (int j = i + 1; j < source.length(); j++) {
        if(source.charAt(i)==source.charAt(j)){
          if(!appear) {
            appear = true;
          }else {
            System.out.println("No");
            return;
          }
        }
      }
      if(!appear){
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }
}




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

class FiftyFity{
 
  public boolean check(String S){
  if(S==null||S.length()!=4){
    return false;
  }
  
  Map<Character,Integer> map=new HashMap();
  for(char c:S.toCharArray()){
  	map.put(c,map.getOrDefault(c,0)+1);
  }
  
  return map.size()==2; 
}

  
}

Compiler output:
Main.java:8: error: cannot find symbol
  Map<Character,Integer> map=new HashMap();
  ^
  symbol:   class Map
  location: class FiftyFity
Main.java:8: error: cannot find symbol
  Map<Character,Integer> map=new HashMap();
                                 ^
  symbol:   class HashMap
  location: class FiftyFity
2 errors
Language: Java

public boolean check(String S){
  if(S==null||S.length()!=4){
    return false;
  }
  
  Map<Character,Integer> map=new HashMap();
  for(char c:S.toCharArray()){
  	map.put(c,map.getOrDefault(c,0)+1);
  }
  
  return map.size()==2; 
}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public boolean check(String S){
       ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: C++

#include<iostream>
using namespace std;

int main(){
    char a[5];
    cin >> a;
    if (a[0]==a[1] && a[1]!=a[2] && a[2]=a[3]) cout << "Yes";
    else if (a[0]==a[2] && a[0]!=a[2] && a[0]==a[1]) cout << "Yes";
    else if (a[0]==a[3] && a[0]!=a[1] && a[1]==a[2]) cout << "Yes";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:34: error: lvalue required as left operand of assignment
    7 |     if (a[0]==a[1] && a[1]!=a[2] && a[2]=a[3]) cout << "Yes";
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
Language: C++

#include<iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:34: error: lvalue required as left operand of assignment
    7 |     if (a[0]==a[1] && a[1]!=a[2] && a[2]=a[3]) cout << "Yes";
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
Language: C++

s = input()

s = sorted(list(s))

if s[0] == s[1] and s[2] == s[3]:
  print('YES')
else:
  print('NO')

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

#include<stdio.h>
#include<string.h>
int main()
{
	char s[4];
	gets(s);
	int i,j,k=0,z=0;
	for(i=1;i<4;i++)
	{
		if(s[0]!=s[i])
		{
			j=i;
			break;
		}	
    }
    for(i=0;i<4;i++)
    {
    	if(s[0]==s[i])
    	k++;
    }
    
    for(i=0;i<4;i++)
    {
    	if(s[j]==s[i])
    	z++;
    }
    if(k==2&&z==2)
    printf("Yes");
    else
    printf("No");
}

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

#include <bits/stdc++.h>

using namespace std;

int main(){
  string s; cin >> s;
  sort(s.begin(),s.end());
  
  bool a = (s[0] == s[1]);
  bool b = (s[2] == s[3]);
  bool dif = (s[0] != s[2])
  
  if(a and b and dif) cout << "YES" << endl;
  else cout << "NO" << endl;
}
    
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: expected ',' or ';' before 'if'
   13 |   if(a and b and dif) cout << "YES" << endl;
      |   ^~
a.cc:14:3: error: 'else' without a previous 'if'
   14 |   else cout << "NO" << endl;
      |   ^~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:4:13: error: expected initializer before '>>' token
    4 | string  cin >> S;
      |             ^~
a.cc:5:6: error: 'S' was not declared in this scope
    5 |   if(S[0]==S[1]&&S[2]==S[3]&&S[1]!=S[2]||S[0]==S[2]&&S[1]==S[3]||S[0]==S[3]&&S[1]==S[2])cout << "Yes"<<endl;
      |      ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:4:17: error: expected primary-expression before 'S'
    4 |   cin >> string S;
      |                 ^
a.cc:5:6: error: 'S' was not declared in this scope
    5 |   if(S[0]==S[1]&&S[2]==S[3]&&S[1]!=S[2]||S[0]==S[2]&&S[1]==S[3]||S[0]==S[3]&&S[1]==S[2])cout << "Yes"<<endl;
      |      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef pair<P,int> T;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
int main(){
	string s;
	cin >> s;
	for(int i=0;i<s.size();i++){
		cnt[s[i]-'a']++;
	}
	for(int i=0;i<30;i++){
		if(!(cnt[i]==0||cnt[i]==2)){
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
   26 |                 cnt[s[i]-'a']++;
      |                 ^~~
      |                 int
a.cc:29:22: error: 'cnt' was not declared in this scope; did you mean 'int'?
   29 |                 if(!(cnt[i]==0||cnt[i]==2)){
      |                      ^~~
      |                      int
Language: Java

char[] s = in.next().toCharArray();
Arrays.sort(s);
out.println(s[0] == s[1] && s[2] == s[3] && s[1] != s[2] ? "Yes" : "No");

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
char[] s = in.next().toCharArray();
^
  (use --enable-preview to enable unnamed classes)
Main.java:2: error: class, interface, enum, or record expected
Arrays.sort(s);
^
Main.java:3: error: class, interface, enum, or record expected
out.println(s[0] == s[1] && s[2] == s[3] && s[1] != s[2] ? "Yes" : "No");
^
3 errors
Language: C++


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

int main() {
  string s;
  cin >> s;
  bool ans = false;
/*
//解法1
  //OOXX
  if ((s[0] == s[1]) && (s[2] == s[3]) && (s[1] != s[2])) {
    ans = true;
  }
  //OXOX
  if ((s[0] == s[2]) && (s[1] == s[3]) && (s[1] != s[2])) {
    ans = true;
  }
  //OXXO
  if ((s[0] == s[3]) && (s[1] == s[2]) && (s[0] != s[1])) {
    ans = true;
  }
*/

  //解法2(sort)
  sort(s.begin(), s.end());
  //OOXX
  if ((s[0] == s[1]) && (s[2] == s[3]) && (s[1] != s[2])) {
    ans = true;
  }

  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}


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

#include<stdio.h>
 #include<algorithm>
 using namespace std;
int 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:
main.c:2:10: fatal error: algorithm: No such file or directory
    2 |  #include<algorithm>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

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

/* #pragma */
/*
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
*/

/*alias*/
#define F first
#define S second

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define itn int

/*template*/
template<class T>inline bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>inline bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }

/* func */
int GCD(int a,int b){return b?GCD(b,a%b):a;}
long long GCD(long long a, long long b){return b ? GCD(b, a%b) : a;}
int LCM(int a, int b){return a * b / GCD(a, b);}
long long LCM(long long a, long long b){return a * b / GCD(a, b);}

/*struct*/
struct aaa {
	aaa() {
		cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20);
	};
}aaaaaaa;

/* const */
const int INF = 1001001001;
const long long LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7; //10^9
const double EPS = 1e-9;
const int dx[] = { 1, 1, 0, -1, -1, -1, 0, 1 }, dy[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
//const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
//Counterclockwise from the 6o'clock direction
//Take the x-axis downward and the y-axis right

//#define int long long

//g++ -std=c++14 -Wall --pedantic-errors -o template template.cpp
//g++ -std=c++14 -Wall --pedantic-errors template.cpp
//chcp 65001

/*global*/

signed main()
{
//	v.resize(n);
string s;cin >> s;
if((s[0] == s[1] && s[2] == s[3]){
	cout << "Yes" << endl;
	
}
else if(s[0] == s[2] && s[1] == s[3]){
	cout << "Yes" << endl;
}
else if(s[0] == s[3] && s[0] == s[3]){
	cout << "Yes" << endl;
}
else{
	cout << "No" << endl;
}
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:61:34: error: expected ';' before '{' token
   61 | if((s[0] == s[1] && s[2] == s[3]){
      |                                  ^
      |                                  ;
a.cc:65:1: error: expected primary-expression before 'else'
   65 | else if(s[0] == s[2] && s[1] == s[3]){
      | ^~~~
a.cc:64:2: error: expected ')' before 'else'
   64 | }
      |  ^
      |  )
   65 | else if(s[0] == s[2] && s[1] == s[3]){
      | ~~~~
a.cc:61:3: note: to match this '('
   61 | if((s[0] == s[1] && s[2] == s[3]){
      |   ^
Language: Java

import java.util.Scanner;
public class FiftyFifty {

    public static void main(String[] args) {
        Scanner hi = new Scanner(System.in);
        String S = hi.nextLine();

        char g = S.charAt(0);
        if (S.charAt(0) == S.charAt(1)) {

            char r = S.charAt(2);
            if (S.charAt(2) == S.charAt(3))
            {
                if (S.charAt(0) == S.charAt(3))
                    System.out.println("No");
                if (S.charAt(0) != S.charAt(3))
                    System.out.println("Yes");
            }
                 else{
                    System.out.println("No");
            }
        } else if (S.charAt(0) == S.charAt(2)) {
            char r = S.charAt(2);
            if (S.charAt(1) == S.charAt(3))
            {
                if (S.charAt(0) == S.charAt(1))
                    System.out.println("No");
                if (S.charAt(0) != S.charAt(1))
                    System.out.println("Yes");
            }
            else{
                System.out.println("No");
            }


        }else if (S.charAt(0) == S.charAt(3))
        {
            char r = S.charAt(2);
            if (S.charAt(1) == S.charAt(2))
            {
                if (S.charAt(0) == S.charAt(1))
                    System.out.println("No");
                if (S.charAt(0) != S.charAt(1))
                    System.out.println("Yes");
            }
            else{
                System.out.println("No");
            }


        }

        else System.out.println("No");
    }


}


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

#include <iostream>

using namespace std;

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

	bool ret = false;

	if (s[0] == s[1] && s[2] == s[3] && s[0] != s[2]) ret = true;
	else if (s[0] == s[2] && s[1] == s[3] && s[0] != s[1]) ret = true;
	else if (s[0] == s[3] && s[1] == s[2] && s[0] != s[1]) ret = true;

	cout << (ret ? "Yes" : "No") << endl;
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:17:18: error: expected '}' at end of input
   17 |         return 0;
      |                  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include <iostream>
using namespace std;
int main()
{	
	int sum = 0;
	char S[5];
	cin >> S;
	for (int i = 0; i < 4; i++) {
		for (int j = 0; j < 4; j++) {
			if (S[i] == S[j]) {
				sum++;
			}
		}
	}
	if (sum == 4) {
		cout << "Yes" << endl;
	}else {
		cout << "No" << endl;
	}
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:20:18: error: expected '}' at end of input
   20 |         return 0;
      |                  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: Java


Beta
  paiza.IO
新規コード
一覧
ウェブ開発  
New!
日本語 
 
Enter a title here
Main.java 
Success  
  
        
出力
入力
コメント 0
(0.05 sec)
 
No
 

Compiler output:
Main.java:2: error: class, interface, enum, or record expected
Beta
^
Main.java:13: error: illegal character: '\u2028'
??
^
Main.java:13: error: illegal character: '\u2028'
??
 ^
3 errors
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
    string S;
    //Sを定義
    char A;
    //Aを定義
    char B;
    //Bを定義
    bool is = true;
    if (S[A] == S[A]) is = false;
    bool isa = true;
    if (S[B] == S[B]) isa = false;
    bool is = true;
    if (S[B] == S[A]) isb = false;
    bool isc = true;
    if (S[A] == S[B]) isc = false;

    if (is + isa){
        cout << "Yes" << endl;
    } else if(isa + is){
        cout << "Yes" << endl;
    } else if(isb + isc){
        cout << "Yes" << endl;
    } else if(isc + isb){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: redeclaration of 'bool is'
   17 |     bool is = true;
      |          ^~
a.cc:13:10: note: 'bool is' previously declared here
   13 |     bool is = true;
      |          ^~
a.cc:18:23: error: 'isb' was not declared in this scope; did you mean 'isa'?
   18 |     if (S[B] == S[A]) isb = false;
      |                       ^~~
      |                       isa
a.cc:26:15: error: 'isb' was not declared in this scope; did you mean 'isc'?
   26 |     } else if(isb + isc){
      |               ^~~
      |               isc
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[A]) isgood = false;
    bool isgooda = true;
    if (S[B] == S[B]) isgooda = false;
    bool isgood = true;
    if (S[B] == S[A]) isgoodb = false;
    bool isgoodc = true;
    if (S[A] == S[B]) isgoodc = false;

    if (isgood + isgooda){
        cout << "Yes" << endl;
    } else if(isgooda + isgood){
        cout << "Yes" << endl;
    } else if(isgoodb + isgoodc){
        cout << "Yes" << endl;
    } else if(isgoodc + isgoodb){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: redeclaration of 'bool isgood'
   17 |     bool isgood = true;
      |          ^~~~~~
a.cc:13:10: note: 'bool isgood' previously declared here
   13 |     bool isgood = true;
      |          ^~~~~~
a.cc:18:23: error: 'isgoodb' was not declared in this scope; did you mean 'isgooda'?
   18 |     if (S[B] == S[A]) isgoodb = false;
      |                       ^~~~~~~
      |                       isgooda
a.cc:26:15: error: 'isgoodb' was not declared in this scope; did you mean 'isgoodc'?
   26 |     } else if(isgoodb + isgoodc){
      |               ^~~~~~~
      |               isgoodc
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(int argc, char* argv[]){
    string S;
    //Sを定義
    char A;
    //Aを定義
    char B;
    //Bを定義
    bool is = true;
    if (S[A] == S[A]) isgood = false;
    bool isgooda = true;
    if (S[B] == S[B]) isgooda = false;
    bool isgoodb = true;
    if (S[B] == S[A]) isgoodb = false;
    bool isgoodc = true;
    if (S[A] == S[B]) isgoodc = false;

    if (isgood + isgooda){
        cout << "Yes" << endl;
    } else if(isgooda + isgood){
        cout << "Yes" << endl;
    } else if(isgoodb + isgoodc){
        cout << "Yes" << endl;
    } else if(isgoodc + isgoodb){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:14:23: error: 'isgood' was not declared in this scope
   14 |     if (S[A] == S[A]) isgood = false;
      |                       ^~~~~~
a.cc:22:9: error: 'isgood' was not declared in this scope; did you mean 'isgoodc'?
   22 |     if (isgood + isgooda){
      |         ^~~~~~
      |         isgoodc
Language: C++

#include <iostream>
#include <string>

using namespace std;

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

    if (isgood + isgooda){
        cout << "Yes" << endl;
    } else if(isgooda + isgood){
        cout << "Yes" << endl;
    } else if(isgoodb + isgoodc){
        cout << "Yes" << endl;
    } else if(isgoodc + isgoodb){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: 'isgood' was not declared in this scope
   14 |     if (S[A] == S[A]) isgood = false;
      |                       ^~~~~~
a.cc:22:9: error: 'isgood' was not declared in this scope; did you mean 'isgoodc'?
   22 |     if (isgood + isgooda){
      |         ^~~~~~
      |         isgoodc
Language: C++

#include <iostream>
#include <string>

using namespace std;

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

    if (isgood && isgooda){
        cout << "Yes" << endl;
    } else if(isgooda && isgood){
        cout << "Yes" << endl;
    } else if(isgoodb && isgoodc){
        cout << "Yes" << endl;
    } else if(isgoodc && isgoodb){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: 'isgood' was not declared in this scope
   14 |     if (S[A] == S[A]) isgood = false;
      |                       ^~~~~~
a.cc:22:9: error: 'isgood' was not declared in this scope; did you mean 'isgoodc'?
   22 |     if (isgood && isgooda){
      |         ^~~~~~
      |         isgoodc
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[A]) isgood = false;
    bool isgooda = true;
    if (S[B] == S[B]) isgooda = false;
    bool isgoodb = true;
    if (S[B] == S[A]) isgoodb = false;
    bool isgoodc = true;
    if (S[A] == S[B]) isgoodc = false;

    if (isgooda && isgoodb){
        cout << "Yes" << endl;
    } else if(isgoodb && isgooda){
        cout << "Yes" << endl;
    } else if(isgoodc && isgoodd){
        cout << "Yes" << endl;
    } else if(isgoodd && isgoodc){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:26: error: 'isgoodd' was not declared in this scope; did you mean 'isgoodc'?
   26 |     } else if(isgoodc && isgoodd){
      |                          ^~~~~~~
      |                          isgoodc
Language: C++

#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<pair>

#define MOD (1000000007)

using namespace std;

int main(void){
    long long N, K;
    cin >> N >> K;
    set<long long> s;
    for(int i = 1; i * i <= N; i++){
        s.insert(i);
        s.insert(N / i);
    }

    int S = s.size();

    vector<int> v;
    vector<pair<long long, long long>> interval;
    interval.reserve(S);
    for(int i : s) interval.push_back(make_pair(0LL, i));
    interval[0].first = 0;
    for(int i = 1; i < S; i++) interval[i].first = interval[i - 1].second;

    // for(int i = 0; i < S; i++) cout << interval[i].first << " " << interval[i].second << endl;

    vector<long long> dp(S);

    for(int i = 0; i < S; i++) dp[i] = interval[i].second - interval[i].first;
    map<long long, long long> cumsum;
    for(int k = 2; k <= K; k++){
        cumsum[0] = 0;
        for(int i = 0; i < S; i++){
            cumsum[0] += dp[i];
            cumsum[N / interval[i].second] = -dp[i];
        }
        long long s = cumsum[0];
        for(int i = 0; i < S; i++){
            dp[i] = s * (interval[i].second - interval[i].first);
            dp[i] %= MOD;
            s += cumsum[interval[i].second];
        }

        // for(int i = 0; i < S; i++) cout << interval[i].first << " " << interval[i].second << " " << ndp[i] << endl;
    }

    long long ans = 0;
    for(int i = 0; i < S; i++){
        ans += dp[i]; // * (interval[i].second - interval[i].first);
        ans %= MOD;
    }
    cout << ans << endl;

    return 0;
}


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

    #include <bits/stdc++.h>
    using namespace std;
     
     
     
    int main(){
        int N, K ;
        cin >> N >> K;
        int lim = min(N, K);
        long comb = N - K + 1;
        cout << comb << endl;
        int low = pow(10, 9) + 7;
        for(int i=2; i < lim + 1; i++){
            comb = comb*(N-K+2-i)*(K+1-i);
            comb /= i*(i-1);
            comb %= low;
            cout << comb << endl;
        }
    }

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



int main(){
    int N, K ;
    cin >> N >> K;
    int lim = min(N-K+1, K);
    long comb = N - K + 1;
    cout << comb << endl;
    int low = pow(10, 9) + 7;
    for(int i=2; i < lim + 1; i++){
        comb = comb*(N-K+2-i)*(K+1-i);
        comb /= i*(i-1);
        comb %= low;
        cout << comb << endl;
    }
}


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

#include<bits/stdc++.h>
using namespace std;
int main()
{
  string str;
  cin>>str;
  set<char> c;
  for(int i=0;i<str.length();i++)
    c.insert(str[i]);
  if(c.size()==2)cout<<"Yes"<<endl
    else cout<<"No"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:35: error: expected ';' before 'else'
   10 |   if(c.size()==2)cout<<"Yes"<<endl
      |                                   ^
      |                                   ;
   11 |     else cout<<"No"<<endl;
      |     ~~~~
Language: C++

#include <iostream>
#include <fstream>
#include <queue>
#include <unordered_map>
#include <string>
#include <bits/stdc++.h>
#include <algorithm>
#include <vector>

using namespace std;

bool isSubsequence(string s, string t);

int main() {

    string s;
    cin >> s;
    int arr[26] = {0};
    for(int i = 0;i<4;i++){
        arr[s[i] - 'a']++;
    }
    for(int i = 0;i<26;i++){
        if(arr[i] != 0 && arr[i] != 2){
            cout << "NO";
            return 0;
        }
    }
    cout <, "YES";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:11: error: expected primary-expression before ',' token
   28 |     cout <, "YES";
      |           ^
Language: C++

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


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

#iclude<stdio.h>
int main(){
  char str[5];
  int i,j,c1,c2 = -1,cn1 = 0,cn2 = 0;
  for(i = 1, c1 = str[0],cn1++;i < 5 - 1;i++){
    if(c1 == (int)str[i]){
      cn1++;
    }else{
      if(c2 == -1){
        c2 = (int)str[i];
        cn2++;
      }else{
        break;
      }
    }
  }
  if(cn1 == cn2 && cn2 == 2){
    printf("Yes");
  }else{
    printf("No");
  }
  return 0;
}
    

Compiler output:
main.c:1:2: error: invalid preprocessing directive #iclude; did you mean #include?
    1 | #iclude<stdio.h>
      |  ^~~~~~
      |  include
main.c: In function 'main':
main.c:18:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   18 |     printf("Yes");
      |     ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | #iclude<stdio.h>
main.c:18:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   18 |     printf("Yes");
      |     ^~~~~~
main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:20:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   20 |     printf("No");
      |     ^~~~~~
main.c:20:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#iclude<stdio.h>
int main(){
  char str[5];
  int i,j,c1,c2 = -1,cn1 = 0,cn2 = 0;
  for(i = 1, c1 = str[0],cn1++; < 5 - 1;i++){
    if(c1 == (int)str[i]){
      cn1++;
    }else{
      if(c2 == -1){
        c2 = (int)str[i];
        cn2++;
      }else{
        break;
      }
    }
  }
  if(cn1 == cn2 && cn2 == 2){
    printf("Yes");
  }else{
    printf("No");
  }
  return 0;
}
    

Compiler output:
main.c:1:2: error: invalid preprocessing directive #iclude; did you mean #include?
    1 | #iclude<stdio.h>
      |  ^~~~~~
      |  include
main.c: In function 'main':
main.c:5:33: error: expected expression before '<' token
    5 |   for(i = 1, c1 = str[0],cn1++; < 5 - 1;i++){
      |                                 ^
main.c:18:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   18 |     printf("Yes");
      |     ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | #iclude<stdio.h>
main.c:18:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   18 |     printf("Yes");
      |     ^~~~~~
main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:20:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   20 |     printf("No");
      |     ^~~~~~
main.c:20:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

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

int main()
{
	string S; cin >> S;
  	bool result = false;
  	if(S[0]==S[1] && S[2]==S[3] && S[0]!=S[2]) result = true;
    if(S[0]==S[2] && S[1]==S[3] && S[0]!=S[1]) result = true;
    if(S[0]==S[3] && S[1]==S[2] && S[0]!=S[1]) result = true;
  	if(result) cout << "Yes";
  	else cout << "No"
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: expected ';' before 'return'
   12 |         else cout << "No"
      |                          ^
      |                          ;
   13 |         return 0;
      |         ~~~~~~
Language: C++

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

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

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

#include <iostream>

using namespace std;

int main() {
    char s[4];
    cin >> s;
    sort(s, s+4);
    s[0] == s[1] && s[1] != s[2] && s[2] == s[3] ? cout << "Yes" << endl : cout << "No" << endl;
    return 0;
}

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

#include <stdio.h>
int main()
{
	char a[4],s='\0',k='\0';
	gets(a);
	s=a[0];
	for(int i=1;i<4;i++)
	{
		if(a[i]!=s && k=='\0')  
			k=a[i];
		else if(a[i]!=s && a[i]!=k)
		{
			printf("No");
			return 0;
		} 
			 		
	} 
	if(k=='\0')
	{
		printf("No");
	}
		
	else
	{
		printf("Yes");
	}	
		
}

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:23:25: error: expected ')' before '{' token
   23 |   if (S.at(2) == S.at(3) {
      |      ~                  ^~
      |                         )
a.cc:33:1: error: expected primary-expression before '}' token
   33 | }
      | ^
Language: C

#include <stdio.h>

int main(void){
 
  /* 文字列の入力 */
  //printf("文字列を入力してください。\n");
  char S[4];
  ret = scanf("%s", S);
  if (S[0]==S[1]){
    if (S[2]==S[3]){
      printf("Yes");
    }else{
      printf("No");
    }
  }else{
      if((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:8:3: error: 'ret' undeclared (first use in this function)
    8 |   ret = scanf("%s", S);
      |   ^~~
main.c:8:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <array>
#include <iostream>

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

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

    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:21:14: error: expected '}' at end of input
   21 |     return 0;
      |              ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: Java

import java.io.*;

public class abc132 {

	public static void main(String[] args) throws IOException{
		
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str = br.readLine();
	
		// 文字列を分割する
		// 4文字の前提
		char[] c = new char[4];
		
		for(int i = 0; i < 4; i++) {
			c[i]=str.charAt(i);
			System.out.println(c[i]);
		}

        // 組み合わせを調べる
		int[] x = {0,0,0,0};
		
		for(int i = 0; i < 4; i++) {
			for(int j = 0; j < 4; j++) {
				if ( c[i] == c[j] ) {
					x[i]++;
				}
			}
		}
		
		//全て2つ同じ値であればOKそれ以外はNG
		boolean chk = true;
		
		for(int i = 0; i < 4; i++) {
			if ( x[i] != 2) {
				chk = false;
			}
		}
		
		// 結果出力
		if (chk) {
			System.out.println("OK");
		} else {
			System.out.println("NG");
		}
				
	
	}

}


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

#include <iostream>
#include <string>
#include <map>
std::string s;
int main(){
  std::cin>>s;
  std::map<char,ll> m;
  for(int i =0;i<4;i++){
    m[s[i]]++;
  }
  for(int i =0;i<4;i++){
    if(m[s[i]]!=2){
      std::cout<<"No"<<std::endl;
      return 0;
    }
  }
  std::cout<<"Yes"<<std::endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'll' was not declared in this scope
    7 |   std::map<char,ll> m;
      |                 ^~
a.cc:7:19: error: template argument 2 is invalid
    7 |   std::map<char,ll> m;
      |                   ^
a.cc:7:19: error: template argument 4 is invalid
a.cc:9:6: error: invalid types 'int[__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}]' for array subscript
    9 |     m[s[i]]++;
      |      ^
a.cc:12:9: error: invalid types 'int[__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}]' for array subscript
   12 |     if(m[s[i]]!=2){
      |         ^
Language: C++

#include <iostream>
#include <string>
#include <map>
string s;
int main(){
  cin>>s;
  map<char,ll> m;
  for(int i =0;i<4;i++){
    m[s[i]]++;
  }
  for(int i =0;i<4;i++){
    if(m[s[i]]!=2){
      cout<<"No"<<endl;
      return 0;
    }
  }
  cout<<"Yes"<<endl;
  return 0;
}

Compiler output:
a.cc:4:1: error: 'string' does not name a type; did you mean 'stdin'?
    4 | string s;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>s;
      |   ^~~
      |   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:6:8: error: 's' was not declared in this scope
    6 |   cin>>s;
      |        ^
a.cc:7:3: error: 'map' was not declared in this scope
    7 |   map<char,ll> m;
      |   ^~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/map:63,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_map.h:102:11: note:   'std::map'
  102 |     class map
      |           ^~~
/usr/include/c++/14/map:89:13: note:   'std::pmr::map'
   89 |       using map
      |             ^~~
a.cc:7:7: error: expected primary-expression before 'char'
    7 |   map<char,ll> m;
      |       ^~~~
a.cc:9:5: error: 'm' was not declared in this scope
    9 |     m[s[i]]++;
      |     ^
a.cc:12:8: error: 'm' was not declared in this scope
   12 |     if(m[s[i]]!=2){
      |        ^
a.cc:13:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |       cout<<"No"<<endl;
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |       cout<<"No"<<endl;
      |                   ^~~~
      |                   std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:17:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |   cout<<"Yes"<<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:17:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   17 |   cout<<"Yes"<<endl;
      |                ^~~~
      |                std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
#include<string>
#include<map>
string s;
int main(){
  cin>>s;
  map<char,ll> m;
  for(int i =0;i<4;i++){
    m[s[i]]++;
  }
  for(int i =0;i<4;i++){
    if(m[s[i]]!=2){
      cout<<"No"<<endl;
      return 0;
    }
  }
  cout<<"Yes"<<endl;
  return 0;
}

Compiler output:
a.cc:4:1: error: 'string' does not name a type; did you mean 'stdin'?
    4 | string s;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>s;
      |   ^~~
      |   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:6:8: error: 's' was not declared in this scope
    6 |   cin>>s;
      |        ^
a.cc:7:3: error: 'map' was not declared in this scope
    7 |   map<char,ll> m;
      |   ^~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/map:63,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_map.h:102:11: note:   'std::map'
  102 |     class map
      |           ^~~
/usr/include/c++/14/map:89:13: note:   'std::pmr::map'
   89 |       using map
      |             ^~~
a.cc:7:7: error: expected primary-expression before 'char'
    7 |   map<char,ll> m;
      |       ^~~~
a.cc:9:5: error: 'm' was not declared in this scope
    9 |     m[s[i]]++;
      |     ^
a.cc:12:8: error: 'm' was not declared in this scope
   12 |     if(m[s[i]]!=2){
      |        ^
a.cc:13:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |       cout<<"No"<<endl;
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |       cout<<"No"<<endl;
      |                   ^~~~
      |                   std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:17:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |   cout<<"Yes"<<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:17:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   17 |   cout<<"Yes"<<endl;
      |                ^~~~
      |                std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;

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

}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: expected '(' before '{' token
   10 |   } else if {( (S.at(0) == S.at(2)) && (S.at(1) == S.at(3)) ) {
      |             ^
      |             (
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^