ამოხსნების სტატუსი

ამ გვერდზე თქვენ იხილავთ გაგზავნილი ამოხსნების სტატუსს.


გაგზავნის თარიღი: 10.09.2021 17:25:22

ამოცანა: სიტყვები

მომხმარებელი: Tatoandropadz

ვერდიქტი: ამოუხსნელი

შეფასება: 0 ქულა







#include <bits/stdc++.h>
using namespace std;
set <string> st;
string s;
int n, i,k,j;
main(){
cin>>n;
for (i=0; i<n; i++){
    cin>>s;
    k = s.size();
    for(j=0; j<k; j++){
        st.insert(s[j]);
    }
    cout<<st.size();
}
}
PROB_cpp_UID2026PID527_ef8fb5/main.cpp: In function 'int main()':
PROB_cpp_UID2026PID527_ef8fb5/main.cpp:12:23: error: no matching function for call to 'std::set<std::__cxx11::basic_string<char> >::insert(__gnu_cxx::__alloc_traits<std::allocator<char> >::value_type&)'
         st.insert(s[j]);
                       ^
In file included from /usr/include/c++/6/set:61:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:87,
                 from PROB_cpp_UID2026PID527_ef8fb5/main.cpp:1:
/usr/include/c++/6/bits/stl_set.h:480:7: note: candidate: std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Key>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(const value_type&) [with _Key = std::__cxx11::basic_string<char>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Key>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree_const_iterator<std::__cxx11::basic_string<char> >; std::set<_Key, _Compare, _Alloc>::value_type = std::__cxx11::basic_string<char>]
       insert(const value_type& __x)
       ^~~~~~
/usr/include/c++/6/bits/stl_set.h:480:7: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char> >::value_type {aka char}' to 'const value_type& {aka const std::__cxx11::basic_string<char>&}'
/usr/include/c++/6/bits/stl_set.h:489:7: note: candidate: std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Key>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::value_type&&) [with _Key = std::__cxx11::basic_string<char>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Key>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree_const_iterator<std::__cxx11::basic_string<char> >; std::set<_Key, _Compare, _Alloc>::value_type = std::__cxx11::basic_string<char>]
       insert(value_type&& __x)
       ^~~~~~
/usr/include/c++/6/bits/stl_set.h:489:7: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char> >::value_type {aka char}' to 'std::set<std::__cxx11::basic_string<char> >::value_type&& {aka std::__cxx11::basic_string<char>&&}'
/usr/include/c++/6/bits/stl_set.h:517:7: note: candidate: std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::const_iterator, const value_type&) [with _Key = std::__cxx11::basic_string<char>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree_const_iterator<std::__cxx11::basic_string<char> >; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree_const_iterator<std::__cxx11::basic_string<char> >; std::set<_Key, _Compare, _Alloc>::value_type = std::__cxx11::basic_string<char>]
       insert(const_iterator __position, const value_type& __x)
       ^~~~~~
/usr/include/c++/6/bits/stl_set.h:517:7: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/6/bits/stl_set.h:522:7: note: candidate: std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::insert(std::set<_Key, _Compare, _Alloc>::const_iterator, std::set<_Key, _Compare, _Alloc>::value_type&&) [with _Key = std::__cxx11::basic_string<char>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; std::set<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree_const_iterator<std::__cxx11::basic_string<char> >; std::set<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree_const_iterator<std::__cxx11::basic_string<char> >; std::set<_Key, _Compare, _Alloc>::value_type = std::__cxx11::basic_string<char>]
       insert(const_iterator __position, value_type&& __x)
       ^~~~~~
/usr/include/c++/6/bits/stl_set.h:522:7: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/6/bits/stl_set.h:537:2: note: candidate: template<class _InputIterator> void std::set<_Key, _Compare, _Alloc>::insert(_InputIterator, _InputIterator) [with _InputIterator = _InputIterator; _Key = std::__cxx11::basic_string<char>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::__cxx11::basic_string<char> >]
  insert(_InputIterator __first, _InputIterator __last)
  ^~~~~~
/usr/include/c++/6/bits/stl_set.h:537:2: note:   template argument deduction/substitution failed:
PROB_cpp_UID2026PID527_ef8fb5/main.cpp:12:23: note:   candidate expects 2 arguments, 1 provided
         st.insert(s[j]);
                       ^
In file included from /usr/include/c++/6/set:61:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:87,
                 from PROB_cpp_UID2026PID527_ef8fb5/main.cpp:1:
/usr/include/c++/6/bits/stl_set.h:549:7: note: candidate: void std::set<_Key, _Compare, _Alloc>::insert(std::initializer_list<_Tp>) [with _Key = std::__cxx11::basic_string<char>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::__cxx11::basic_string<char> >]
       insert(initializer_list<value_type> __l)
       ^~~~~~
/usr/include/c++/6/bits/stl_set.h:549:7: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char> >::value_type {aka char}' to 'std::initializer_list<std::__cxx11::basic_string<char> >'