Language: C++

//a,b,cのうち最大のものから最小のものを引いた答えが１以下となればYES
#include <bits/stdc++.h>
int main() {
	string S;
	vector<int> Word(3, 0);
	cin >> S;
	for (int i = 0; i < S.size(); i++) {
		if (S.at(i) == 'A')
		{
			Word.at(0)++;
		}
		else if (S.at(i) == 'B')
		{
			Word.at(1)++;
		}
		else if (S.at(i) == 'C')
		{
			Word.at(2)++;
		}
	}
	int max=Word.at(0),min = Word.at(0);
	for (size_t i = 1; i < 3; i++)
	{
		if (Word.at(i)>max)
		{
			max = Word.at(i);
		}else if (Word.at(i) < min)
		{
			min = Word.at(i);
		}
	}
	if (max-min<=1)
	{
		cout << "YES";
	}
	else {
		cout << "NO";
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'string' was not declared in this scope
    4 |         string S;
      |         ^~~~~~
a.cc:4:9: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:2:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:5:9: error: 'vector' was not declared in this scope
    5 |         vector<int> Word(3, 0);
      |         ^~~~~~
a.cc:5:9: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:5:16: error: expected primary-expression before 'int'
    5 |         vector<int> Word(3, 0);
      |                ^~~
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin >> S;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:16: error: 'S' was not declared in this scope
    6 |         cin >> S;
      |                ^
a.cc:10:25: error: 'Word' was not declared in this scope
   10 |                         Word.at(0)++;
      |                         ^~~~
a.cc:14:25: error: 'Word' was not declared in this scope
   14 |                         Word.at(1)++;
      |                         ^~~~
a.cc:18:25: error: 'Word' was not declared in this scope
   18 |                         Word.at(2)++;
      |                         ^~~~
a.cc:21:17: error: 'Word' was not declared in this scope
   21 |         int max=Word.at(0),min = Word.at(0);
      |                 ^~~~
a.cc:27:40: error: 'min' was not declared in this scope; did you mean 'std::min'?
   27 |                 }else if (Word.at(i) < min)
      |                                        ^~~
      |                                        std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:32:17: error: 'min' was not declared in this scope; did you mean 'std::min'?
   32 |         if (max-min<=1)
      |                 ^~~
      |                 std::min
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:34:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   34 |                 cout << "YES";
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:37:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   37 |                 cout << "NO";
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~