Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <string>

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

using namespace std;


int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    rep(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}

template <typename T>
void output(T a, int precision) {
    if(precision > 0){
        cout << setprecision(precision)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}

int main(int argc, const char * argv[]) {
    
  // source code
  string ss;
  cin >> ss;
  int vccount = 0;
  vector<string> vc;

  rep(i,ss.length())
  {
    vc.push_back(&ss[i]);
    if(vc.size() > 1 && vc[vc.end() - 1] == ss[i])
    {
      if(i == ss.Length() - 1)
      {
        cout << vc.size() - 1;
        return;
      }
      else
      {
        vc[vc.end()] = vc[vc.end()] + ss[i + 1];
        i++;
      }
    }
  }
  cout << vc.size();
  return;
  
  
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:60:27: error: no match for 'operator[]' (operand types are 'std::vector<std::__cxx11::basic_string<char> >' and '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >')
   60 |     if(vc.size() > 1 && vc[vc.end() - 1] == ss[i])
      |                           ^
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; reference = std::__cxx11::basic_string<char>&; size_type = long unsigned int]'
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1128:28: note:   no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' to 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'}
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |                  ~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1147:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; const_reference = const std::__cxx11::basic_string<char>&; size_type = long unsigned int]'
 1147 |       operator[](size_type __n) const _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1147:28: note:   no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' to 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'}
 1147 |       operator[](size_type __n) const _GLIBCXX_NOEXCEPT
      |                  ~~~~~~~~~~^~~
a.cc:62:18: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'Length'; did you mean 'length'?
   62 |       if(i == ss.Length() - 1)
      |                  ^~~~~~
      |                  length
a.cc:65:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   65 |         return;
      |         ^~~~~~
a.cc:69:11: error: no match for 'operator[]' (operand types are 'std::vector<std::__cxx11::basic_string<char> >' and 'std::vector<std::__cxx11::basic_string<char> >::iterator')
   69 |         vc[vc.end()] = vc[vc.end()] + ss[i + 1];
      |           ^
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; reference = std::__cxx11::basic_string<char>&; size_type = long unsigned int]'
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1128:28: note:   no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >::iterator' to 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'}
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |                  ~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1147:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; const_reference = const std::__cxx11::basic_string<char>&; size_type = long unsigned int]'
 1147 |       operator[](size_type __n) const _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1147:28: note:   no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >::iterator' to 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'}
 1147 |       operator[](size_type __n) const _GLIBCXX_NOEXCEPT
      |                  ~~~~~~~~~~^~~
a.cc:69:26: error: no match for 'operator[]' (operand types are 'std::vector<std::__cxx11::basic_string<char> >' and 'std::vector<std::__cxx11::basic_string<char> >::iterator')
   69 |         vc[vc.end()] = vc[vc.end()] + ss[i + 1];
      |                          ^
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; reference = std::__cxx11::basic_string<char>&; size_type = long unsigned int]'
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1128:28: note:   no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >::iterator' to 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'}
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |                  ~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1147:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](size_type) const [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; const_reference = const std::__cxx11::basic_string<char>&; size_type = long unsigned int]'
 1147 |       operator[](size_type __n) const _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1147:28: note:   no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >::iterator' to 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'}
 1147 |       operator[](size_type __n) const _GLIBCXX_NOEXCEPT
      |                  ~~~~~~~~~~^~~
a.cc:75:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
   75 |   return;
      |   ^~~~~~