Language: C++

#include<iostream>
2
#include<vector>
3
#include<map>
4
#include<algorithm>
5
#include<string>
6
using namespace std;
7
typedef long long ll;
8
​
9
int main()
10
{
11
    ll n, counter=1;
12
    cin >> n;
13
    string s;
14
    cin >> s;
15
    char last=s[0];
16
    for(ll i=1; i<n; i++){
17
        if(last==s[i]){
18
            counter --;
19
        }
20
        last=s[i];
21
        counter ++;
22
    }
23
    cout << counter << endl;
24
    return 0;
25
}

Compiler output:
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 2
      | ^
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h: In static member function 'static constexpr bool std::vector<_Tp, _Alloc>::_S_nothrow_relocate(std::true_type)':
/usr/include/c++/14/bits/stl_vector.h:472:30: error: '__relocate_a' is not a member of 'std'
  472 |         return noexcept(std::__relocate_a(std::declval<pointer>(),
      |                              ^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h: In static member function 'static std::vector<_Tp, _Alloc>::pointer std::vector<_Tp, _Alloc>::_S_do_relocate(pointer, pointer, pointer, _Tp_alloc_type&, std::true_type)':
/usr/include/c++/14/bits/stl_vector.h:495:21: error: '__relocate_a' is not a member of 'std'
  495 |         return std::__relocate_a(__first, __last, __result, __alloc);
      |                     ^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h: In static member function 'static std::vector<_Tp, _Alloc>::pointer std::vector<_Tp, _Alloc>::_S_relocate(pointer, pointer, pointer, _Tp_alloc_type&)':
/usr/include/c++/14/bits/stl_vector.h:509:21: error: '__relocate_a' is not a member of 'std'
  509 |         return std::__relocate_a(__first, __last, __result, __alloc);
      |                     ^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h: In copy constructor 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&)':
/usr/include/c++/14/bits/stl_vector.h:606:16: error: '__uninitialized_copy_a' is not a member of 'std'
  606 |           std::__uninitialized_copy_a(__x.begin(), __x.end(),
      |                ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h: In constructor 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&)':
/usr/include/c++/14/bits/stl_vector.h:628:16: error: '__uninitialized_copy_a' is not a member of 'std'
  628 |           std::__uninitialized_copy_a(__x.begin(), __x.end(),
      |                ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h: In constructor 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::false_type)':
/usr/include/c++/14/bits/stl_vector.h:649:20: error: '__uninitialized_move_a' is not a member of 'std'
  649 |               std::__uninitialized_move_a(__rv.begin(), __rv.end(),
      |                    ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h: In member function 'std::vector<_Tp, _Alloc>::pointer std::vector<_Tp, _Alloc>::_M_allocate_and_copy(size_type, _ForwardIterator, _ForwardIterator)':
/usr/include/c++/14/bits/stl_vector.h:1624:20: error: '__uninitialized_copy_a' is not a member of 'std'
 1624 |               std::__uninitialized_copy_a(__first, __last, __result,
      |                    ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h: In member function 'void std::vector<_Tp, _Alloc>::_M_range_initialize(_ForwardIterator, _ForwardIterator, std::forward_iterator_tag)':
/usr/include/c++/14/bits/stl_vector.h:1697:18: error: '__uninitialized_copy_a' is not a member of 'std'
 1697 |             std::__uninitialized_copy_a(__first, __last,
      |                  ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h: In member function 'void std::vector<_Tp, _Alloc>::_M_fill_initialize(size_type, const value_type&)':
/usr/include/c++/14/bits/stl_vector.h:1709:16: error: '__uninitialized_fill_n_a' is not a member of 'std'
 1709 |           std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
      |                ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h: In member function 'void std::vector<_Tp, _Alloc>::_M_default_initialize(size_type)':
/usr/include/c++/14/bits/stl_vector.h:1720:16: error: '__uninitialized_default_n_a' is not a member of 'std'
 1720 |           std::__uninitialized_default_n_a(this->_M_impl._M_start, __n,
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:72:
/usr/include/c++/14/bits/vector.tcc: In member function 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&)':
/usr/include/c++/14/bits/vector.tcc:257:20: error: '__uninitialized_copy_a' is not a member of 'std'
  257 |               std::__uninitialized_copy_a(__x._M_impl._M_start + size(),
      |                    ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_fill_assign(std::size_t, const value_type&)':
/usr/include/c++/14/bits/vector.tcc:287:18: error: '__uninitialized_fill_n_a' is not a member of 'std'
  287 |             std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_assign_aux(_ForwardIterator, _ForwardIterator, std::forward_iterator_tag)':
/usr/include/c++/14/bits/vector.tcc:352:20: error: '__uninitialized_copy_a' is not a member of 'std'
  352 |               std::__uninitialized_copy_a(__mid, __last,
      |                    ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_realloc_insert(iterator, _Args&& ...)':
/usr/include/c++/14/bits/vector.tcc:549:33: error: '__uninitialized_move_if_noexcept_a' is not a member of 'std'
  549 |             __new_finish = std::__uninitialized_move_if_noexcept_a(
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:557:33: error: '__uninitialized_move_if_noexcept_a' is not a member of 'std'
  557 |             __new_finish = std::__uninitialized_move_if_noexcept_a(
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_realloc_append(_Args&& ...)':
/usr/include/c++/14/bits/vector.tcc:676:33: error: '__uninitialized_move_if_noexcept_a' is not a member of 'std'
  676 |             __new_finish = std::__uninitialized_move_if_noexcept_a(
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_fill_insert(iterator, size_type, const value_type&)':
/usr/include/c++/14/bits/vector.tcc:719:24: error: '__uninitialized_move_a' is not a member of 'std'
  719 |                   std::__uninitialized_move_a(__old_finish - __n,
      |                        ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:734:26: error: '__uninitialized_fill_n_a' is not a member of 'std'
  734 |                     std::__uninitialized_fill_n_a(__old_finish,
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:739:24: error: '__uninitialized_move_a' is not a member of 'std'
  739 |                   std::__uninitialized_move_a(__position.base(), __old_finish,
      |                        ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:763:24: error: '__uninitialized_fill_n_a' is not a member of 'std'
  763 |                   std::__uninitialized_fill_n_a(__new_start + __elems_before,
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:769:28: error: '__uninitialized_move_if_noexcept_a' is not a member of 'std'
  769 |                     = std::__uninitialized_move_if_noexcept_a
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:775:28: error: '__uninitialized_move_if_noexcept_a' is not a member of 'std'
  775 |                     = std::__uninitialized_move_if_noexcept_a
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_default_append(size_type)':
/usr/include/c++/14/bits/vector.tcc:821:22: error: '__uninitialized_default_n_a' is not a member of 'std'
  821 |                 std::__uninitialized_default_n_a(this->_M_impl._M_finish,
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:863:22: error: '__uninitialized_default_n_a' is not a member of 'std'
  863 |                 std::__uninitialized_default_n_a(__new_start + __size, __n,
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:894:26: error: '__uninitialized_move_if_noexcept_a' is not a member of 'std'
  894 |                     std::__uninitialized_move_if_noexcept_a(
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_range_insert(iterator, _ForwardIterator, _ForwardIterator, std::forward_iterator_tag)':
/usr/include/c++/14/bits/vector.tcc:969:26: error: '__uninitialized_move_a' is not a member of 'std'
  969 |                     std::__uninitialized_move_a(this->_M_impl._M_finish - __n,
      |                          ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:984:26: error: '__uninitialized_copy_a' is not a member of 'std'
  984 |                     std::__uninitialized_copy_a(__mid, __last,
      |                          ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:989:26: error: '__uninitialized_move_a' is not a member of 'std'
  989 |                     std::__uninitialized_move_a(__position.base(),
      |                          ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:1018:30: error: '__uninitialized_move_if_noexcept_a' is not a member of 'std'
 1018 |                       = std::__uninitialized_move_if_noexcept_a
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:1022:30: error: '__uninitialized_copy_a' is not a member of 'std'
 1022 |                       = std::__uninitialized_copy_a(__first, __last,
      |                              ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:1026:30: error: '__uninitialized_move_if_noexcept_a' is not a member of 'std'
 1026 |