Language: C++

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

int main() {
  int N,re;cin >> N;
  
  vector<string>  str= {N};
  for (i=0,i++,i<N){
    string sample;
    str.at(i) = cin >> sample;
  }
  int new_str = unique(str.begin() ,str.end() )
  str.erase(new_str,str.end())
  re = str.size()
  cout >> re >> endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:26: error: converting to 'std::vector<std::__cxx11::basic_string<char> >' from initializer list would use explicit constructor 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; size_type = long unsigned int; allocator_type = std::allocator<std::__cxx11::basic_string<char> >]'
    7 |   vector<string>  str= {N};
      |                          ^
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,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:556:7: note: 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; size_type = long unsigned int; allocator_type = std::allocator<std::__cxx11::basic_string<char> >]' declared here
  556 |       vector(size_type __n, const allocator_type& __a = allocator_type())
      |       ^~~~~~
a.cc:7:25: warning: narrowing conversion of 'N' from 'int' to 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wnarrowing]
    7 |   vector<string>  str= {N};
      |                         ^
a.cc:8:8: error: 'i' was not declared in this scope
    8 |   for (i=0,i++,i<N){
      |        ^
a.cc:12:23: error: cannot convert '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' to 'int' in initialization
   12 |   int new_str = unique(str.begin() ,str.end() )
      |                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
      |                       |
      |                       __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >
a.cc:12:48: error: expected ';' before 'str'
   12 |   int new_str = unique(str.begin() ,str.end() )
      |                                                ^
      |                                                ;
   13 |   str.erase(new_str,str.end())
      |   ~~~                                           
a.cc:13:12: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::erase(int&, std::vector<std::__cxx11::basic_string<char> >::iterator)'
   13 |   str.erase(new_str,str.end())
      |   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; iterator = std::vector<std::__cxx11::basic_string<char> >::iterator; const_iterator = std::vector<std::__cxx11::basic_string<char> >::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; iterator = std::vector<std::__cxx11::basic_string<char> >::iterator; const_iterator = std::vector<std::__cxx11::basic_string<char> >::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:28: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::__cxx11::basic_string<char> >::const_iterator'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |             ~~~~~~~~~~~~~~~^~~~~~~
a.cc:13:31: error: expected ')' before 're'
   13 |   str.erase(new_str,str.end())
      |                               ^
      |                               )
   14 |   re = str.size()
      |   ~~                           
a.cc:8:7: note: to match this '('
    8 |   for (i=0,i++,i<N){
      |       ^
a.cc:14:18: error: expected ';' before 'cout'
   14 |   re = str.size()
      |                  ^
      |                  ;
   15 |   cout >> re >> endl;
      |   ~~~~