Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a) //追加//
#define pp() pop_back() //削除//
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())

signed main(){
  int n;
  cin>>n;
  to_string(n);
  Sort(n);
  if(n[0]==n[1]&&n[1]==n[2]||n[1]==n[2]&&n[2]==n[3]||n[1]==n[0]&&n[1]==n[2]&&n[2]==n[3])
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:12: warning: ignoring return value of 'std::string std::__cxx11::to_string(long long int)', declared with attribute 'nodiscard' [-Wunused-result]
   26 |   to_string(n);
      |   ~~~~~~~~~^~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4310:3: note: declared here
 4310 |   to_string(long long __val)
      |   ^~~~~~~~~
a.cc:5:24: error: request for member 'begin' in 'n', which is of non-class type 'long long int'
    5 | #define Sort(a) sort(a.begin(),a.end())
      |                        ^~~~~
a.cc:27:3: note: in expansion of macro 'Sort'
   27 |   Sort(n);
      |   ^~~~
a.cc:5:34: error: request for member 'end' in 'n', which is of non-class type 'long long int'
    5 | #define Sort(a) sort(a.begin(),a.end())
      |                                  ^~~
a.cc:27:3: note: in expansion of macro 'Sort'
   27 |   Sort(n);
      |   ^~~~
a.cc:28:7: error: invalid types 'long long int[int]' for array subscript
   28 |   if(n[0]==n[1]&&n[1]==n[2]||n[1]==n[2]&&n[2]==n[3]||n[1]==n[0]&&n[1]==n[2]&&n[2]==n[3])
      |       ^
a.cc:28:13: error: invalid types 'long long int[int]' for array subscript
   28 |   if(n[0]==n[1]&&n[1]==n[2]||n[1]==n[2]&&n[2]==n[3]||n[1]==n[0]&&n[1]==n[2]&&n[2]==n[3])
      |             ^
a.cc:28:19: error: invalid types 'long long int[int]' for array subscript
   28 |   if(n[0]==n[1]&&n[1]==n[2]||n[1]==n[2]&&n[2]==n[3]||n[1]==n[0]&&n[1]==n[2]&&n[2]==n[3])
      |                   ^
a.cc:28:25: error: invalid types 'long long int[int]' for array subscript
   28 |   if(n[0]==n[1]&&n[1]==n[2]||n[1]==n[2]&&n[2]==n[3]||n[1]==n[0]&&n[1]==n[2]&&n[2]==n[3])
      |                         ^
a.cc:28:31: error: invalid types 'long long int[int]' for array subscript
   28 |   if(n[0]==n[1]&&n[1]==n[2]||n[1]==n[2]&&n[2]==n[3]||n[1]==n[0]&&n[1]==n[2]&&n[2]==n[3])
      |                               ^
a.cc:28:37: error: invalid types 'long long int[int]' for array subscript
   28 |   if(n[0]==n[1]&&n[1]==n[2]||n[1]==n[2]&&n[2]==n[3]||n[1]==n[0]&&n[1]==n[2]&&n[2]==n[3])
      |                                     ^
a.cc:28:43: error: invalid types 'long long int[int]' for array subscript
   28 |   if(n[0]==n[1]&&n[1]==n[2]||n[1]==n[2]&&n[2]==n[3]||n[1]==n[0]&&n[1]==n[2]&&n[2]==n[3])
      |                                           ^
a.cc:28:49: error: invalid types 'long long int[int]' for array subscript
   28 |   if(n[0]==n[1]&&n[1]==n[2]||n[1]==n[2]&&n[2]==n[3]||n[1]==n[0]&&n[1]==n[2]&&n[2]==n[3])
      |                                                 ^
a.cc:28:55: error: invalid types 'long long int[int]' for array subscript
   28 |   if(n[0]==n[1]&&n[1]==n[2]||n[1]==n[2]&&n[2]==n[3]||n[1]==n[0]&&n[1]==n[2]&&n[2]==n[3])
      |                                                       ^
a.cc:28:61: error: invalid types 'long long int[int]' for array subscript
   28 |   if(n[0]==n[1]&&n[1]==n[2]||n[1]==n[2]&&n[2]==n[3]||n[1]==n[0]&&n[1]==n[2]&&n[2]==n[3])
      |                                                             ^
a.cc:28:67: error: invalid types 'long long int[int]' for array subscript
   28 |   if(n[0]==n[1]&&n[1]==n[2]||n[1]==n[2]&&n[2]==n[3]||n[1]==n[0]&&n[1]==n[2]&&n[2]==n[3])
      |                                                                   ^
a.cc:28:73: error: invalid types 'long long int[int]' for array subscript
   28 |   if(n[0]==n[1]&&n[1]==n[2]||n[1]==n[2]&&n[2]==n[3]||n[1]==n[0]&&n[1]==n[2]&&n[2]==n[3])
      |                                                                         ^
a.cc:28:79: error: invalid types 'long long int[int]' for array subscript
   28 |   if(n[0]==n[1]&&n[1]==n[2]||n[1]==n[2]&&n[2]==n[3]||n[1]==n[0]&&n[1]==n[2]&&n[2]==n[3])
      |                                                                               ^
a.cc:28:85: error: invalid types 'long long int[int]' for array subscript
   28 |   if(n[0]==n[1]&&n[1]==n[2]||n[1]==n[2]&&n[2]==n[3]||n[1]==n[0]&&n[1]==n[2]&&n[2]==n[3])
      |                                                                                     ^