Detalii evaluare #53993094

Rezumat problemă

Se dă un șir de caractere format din cuvinte, separate prin spații. Cuvintele conțin doar litere mici ale alfabetului englez. Afișați, în ordine lexicografică, cuvintele din șir și frecvența lor de apariție.

Detalii

Problema Cuvinte Operații I/O tastatură/ecran
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #53993094 Utilizator Musuroi Bogdan Sorin (Bogdan_M07)
Fișier cuvinte.cpp Dimensiune 497 B
Data încărcării 17 Noiembrie 2024, 11:17 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

In file included from /usr/include/c++/4.8/bits/hashtable.h:35:0,
                 from /usr/include/c++/4.8/unordered_map:47,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:115,
                 from cuvinte.cpp:1:
/usr/include/c++/4.8/bits/hashtable_policy.h: In instantiation of 'struct std::__detail::_Hash_code_base<std::vector<char>, std::pair<const std::vector<char>, int>, std::__detail::_Select1st, std::hash<std::vector<char> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, true>':
/usr/include/c++/4.8/bits/hashtable_policy.h:1402:10:   required from 'struct std::__detail::_Hashtable_base<std::vector<char>, std::pair<const std::vector<char>, int>, std::__detail::_Select1st, std::equal_to<std::vector<char> >, std::hash<std::vector<char> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, false, true> >'
/usr/include/c++/4.8/bits/hashtable.h:174:11:   required from 'class std::_Hashtable<std::vector<char>, std::pair<const std::vector<char>, int>, std::allocator<std::pair<const std::vector<char>, int> >, std::__detail::_Select1st, std::equal_to<std::vector<char> >, std::hash<std::vector<char> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >'
/usr/include/c++/4.8/bits/unordered_map.h:100:18:   required from 'class std::unordered_map<std::vector<char>, int>'
cuvinte.cpp:3:33:   required from here
/usr/include/c++/4.8/bits/hashtable_policy.h:1070:12: error: invalid use of incomplete type 'struct std::hash<std::vector<char> >'
     struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2,
            ^
In file included from /usr/include/c++/4.8/bits/basic_string.h:3033:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from cuvinte.cpp:1:
/usr/include/c++/4.8/bits/functional_hash.h:58:12: error: declaration of 'struct std::hash<std::vector<char> >'
     struct hash;
            ^
In file included from /usr/include/c++/4.8/bits/hashtable.h:35:0,
                 from /usr/include/c++/4.8/unordered_map:47,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:115,
                 from cuvinte.cpp:1:
/usr/include/c++/4.8/bits/hashtable_policy.h:1070:12: error: invalid use of incomplete type 'struct std::hash<std::vector<char> >'
     struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2,
            ^
In file included from /usr/include/c++/4.8/bits/basic_string.h:3033:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from cuvinte.cpp:1:
/usr/include/c++/4.8/bits/functional_hash.h:58:12: error: declaration of 'struct std::hash<std::vector<char> >'
     struct hash;
            ^
In file included from /usr/include/c++/4.8/bits/hashtable.h:35:0,
                 from /usr/include/c++/4.8/unordered_map:47,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:115,
                 from cuvinte.cpp:1:
/usr/include/c++/4.8/bits/hashtable_policy.h:1082:53: error: invalid use of incomplete type 'struct std::hash<std::vector<char> >'
       using __ebo_h1 = _Hashtable_ebo_helper<1, _H1>;
                                                     ^
In file included from /usr/include/c++/4.8/bits/basic_string.h:3033:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from cuvinte.cpp:1:
/usr/include/c++/4.8/bits/functional_hash.h:58:12: error: declaration of 'struct std::hash<std::vector<char> >'
     struct hash;
            ^
In file included from /usr/include/c++/4.8/bits/hashtable.h:35:0,
                 from /usr/include/c++/4.8/unordered_map:47,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:115,
                 from cuvinte.cpp:1:
/usr/include/c++/4.8/bits/hashtable_policy.h:1082:53: error: invalid use of incomplete type 'struct std::hash<std::vector<char> >'
       using __ebo_h1 = _Hashtable_ebo_helper<1, _H1>;
                                                     ^
In file included from /usr/include/c++/4.8/bits/basic_string.h:3033:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from cuvinte.cpp:1:
/usr/include/c++/4.8/bits/functional_hash.h:58:12: error: declaration of 'struct std::hash<std::vector<char> >'
     struct hash;
            ^
cuvinte.cpp: In constructor 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type, const hasher&, const key_equal&, const allocator_type&) [with _Key = std::vector<char>; _Tp = int; _Hash = std::hash<std::vector<char> >; _Pred = std::equal_to<std::vector<char> >; _Alloc = std::allocator<std::pair<const std::vector<char>, int> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type = unsigned int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hasher = std::hash<std::vector<char> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_equal = std::equal_to<std::vector<char> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::allocator_type = std::allocator<std::pair<const std::vector<char>, int> >]':
cuvinte.cpp:3:33: error: invalid use of incomplete type 'std::unordered_map<std::vector<char>, int>::hasher {aka struct std::hash<std::vector<char> >}'
 unordered_map<vector<char>,int> m;

                                 ^
In file included from /usr/include/c++/4.8/bits/basic_string.h:3033:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from cuvinte.cpp:1:
/usr/include/c++/4.8/bits/functional_hash.h:58:12: error: declaration of 'std::unordered_map<std::vector<char>, int>::hasher {aka struct std::hash<std::vector<char> >}'
     struct hash;
            ^
cuvinte.cpp:3:33: note:   when instantiating default argument for call to std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type, const hasher&, const key_equal&, const allocator_type&) [with _Key = std::vector<char>; _Tp = int; _Hash = std::hash<std::vector<char> >; _Pred = std::equal_to<std::vector<char> >; _Alloc = std::allocator<std::pair<const std::vector<char>, int> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type = unsigned int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hasher = std::hash<std::vector<char> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_equal = std::equal_to<std::vector<char> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::allocator_type = std::allocator<std::pair<const std::vector<char>, int> >]
 unordered_map<vector<char>,int> m;

                                 ^
cuvinte.cpp: In function 'int main()':
cuvinte.cpp:11:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(i=0;i<strlen(s);i++)

                       ^
cuvinte.cpp:23:18: error: cannot bind 'std::ostream {aka std::basic_ostream<char>}' lvalue to 'std::basic_ostream<char>&&'
         cout<<it.first<<" "<<it.second<<endl;

                  ^
In file included from /usr/include/c++/4.8/istream:39:0,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from cuvinte.cpp:1:
/usr/include/c++/4.8/ostream:602:5: error:   initializing argument 1 of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = std::vector<char>]'
     operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x)
     ^
In file included from /usr/include/c++/4.8/bits/hashtable.h:35:0,
                 from /usr/include/c++/4.8/unordered_map:47,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:115,
                 from cuvinte.cpp:1:
/usr/include/c++/4.8/bits/hashtable_policy.h: In instantiation of 'std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::__hash_code std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::_M_hash_code(const _Key&) const [with _Key = std::vector<char>; _Value = std::pair<const std::vector<char>, int>; _ExtractKey = std::__detail::_Select1st; _H1 = std::hash<std::vector<char> >; _H2 = std::__detail::_Mod_range_hashing; std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::__hash_code = unsigned int]':
/usr/include/c++/4.8/bits/hashtable_policy.h:487:49:   required from 'std::__detail::_Map_base<_Key, _Pair, _Alloc, std::__detail::_Select1st, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, true>::mapped_type& std::__detail::_Map_base<_Key, _Pair, _Alloc, std::__detail::_Select1st, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, true>::operator[](const key_type&) [with _Key = std::vector<char>; _Pair = std::pair<const std::vector<char>, int>; _Alloc = std::allocator<std::pair<const std::vector<char>, int> >; _Equal = std::equal_to<std::vector<char> >; _H1 = std::hash<std::vector<char> >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, false, true>; std::__detail::_Map_base<_Key, _Pair, _Alloc, std::__detail::_Select1st, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, true>::mapped_type = int; std::__detail::_Map_base<_Key, _Pair, _Alloc, std::__detail::_Select1st, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, true>::key_type = std::vector<char>]'
/usr/include/c++/4.8/bits/unordered_map.h:596:20:   required from 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type&) [with _Key = std::vector<char>; _Tp = int; _Hash = std::hash<std::vector<char> >; _Pred = std::equal_to<std::vector<char> >; _Alloc = std::allocator<std::pair<const std::vector<char>, int> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type = int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type = std::vector<char>]'
cuvinte.cpp:17:16:   required from here
/usr/include/c++/4.8/bits/hashtable_policy.h:1103:22: error: no match for call to '(const std::hash<std::vector<char> >) (const std::vector<char>&)'
       { return _M_h1()(__k); }
                      ^
/usr/include/c++/4.8/bits/hashtable_policy.h: In instantiation of 'std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, std::__detail::_Default_ranged_hash, true>::_Hash_code_base(const _ExtractKey&, const _H1&, const _H2&, const std::__detail::_Default_ranged_hash&) [with _Key = std::vector<char>; _Value = std::pair<const std::vector<char>, int>; _ExtractKey = std::__detail::_Select1st; _H1 = std::hash<std::vector<char> >; _H2 = std::__detail::_Mod_range_hashing]':
/usr/include/c++/4.8/bits/hashtable_policy.h:1463:65:   required from 'std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::_Hashtable_base(const _ExtractKey&, const _H1&, const _H2&, const _Hash&, const _Equal&) [with _Key = std::vector<char>; _Value = std::pair<const std::vector<char>, int>; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<std::vector<char> >; _H1 = std::hash<std::vector<char> >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _Traits = std::__detail::_Hashtable_traits<true, false, true>]'
/usr/include/c++/4.8/bits/hashtable.h:828:24:   required from 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_Hashtable(std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::size_type, const _H1&, const _H2&, const _Hash&, const _Equal&, const _ExtractKey&, const allocator_type&) [with _Key = std::vector<char>; _Value = std::pair<const std::vector<char>, int>; _Alloc = std::allocator<std::pair<const std::vector<char>, int> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<std::vector<char> >; _H1 = std::hash<std::vector<char> >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, false, true>; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::size_type = unsigned int; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::allocator_type = std::allocator<std::pair<const std::vector<char>, int> >]'
/usr/include/c++/4.8/bits/hashtable.h:397:26:   required from 'std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_Hashtable(std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::size_type, const _H1&, const key_equal&, const allocator_type&) [with _Key = std::vector<char>; _Value = std::pair<const std::vector<char>, int>; _Alloc = std::allocator<std::pair<const std::vector<char>, int> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<std::vector<char> >; _H1 = std::hash<std::vector<char> >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, false, true>; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::size_type = unsigned int; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::key_equal = std::equal_to<std::vector<char> >; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::allocator_type = std::allocator<std::pair<const std::vector<char>, int> >]'
/usr/include/c++/4.8/bits/unordered_map.h:142:35:   required from 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type, const hasher&, const key_equal&, const allocator_type&) [with _Key = std::vector<char>; _Tp = int; _Hash = std::hash<std::vector<char> >; _Pred = std::equal_to<std::vector<char> >; _Alloc = std::allocator<std::pair<const std::vector<char>, int> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::size_type = unsigned int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hasher = std::hash<std::vector<char> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_equal = std::equal_to<std::vector<char> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::allocator_type = std::allocator<std::pair<const std::vector<char>, int> >]'
cuvinte.cpp:3:33:   required from here
/usr/include/c++/4.8/bits/hashtable_policy.h:1099:63: error: invalid use of incomplete type 'struct std::hash<std::vector<char> >'
       : __ebo_extract_key(__ex), __ebo_h1(__h1), __ebo_h2(__h2) { }
                                                               ^
In file included from /usr/include/c++/4.8/bits/basic_string.h:3033:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from cuvinte.cpp:1:
/usr/include/c++/4.8/bits/functional_hash.h:58:12: error: declaration of 'struct std::hash<std::vector<char> >'
     struct hash;
            ^
In file included from /usr/include/c++/4.8/bits/hashtable.h:35:0,
                 from /usr/include/c++/4.8/unordered_map:47,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:115,
                 from cuvinte.cpp:1:
/usr/include/c++/4.8/bits/hashtable_policy.h:1099:63: error: invalid use of incomplete type 'struct std::hash<std::vector<char> >'
       : __ebo_extract_key(__ex), __ebo_h1(__h1), __ebo_h2(__h2) { }
                                                               ^
In file included from /usr/include/c++/4.8/bits/basic_string.h:3033:0,
                 from /usr/include/c++/4.8/string:52,
                 from /usr/include/c++/4.8/bits/locale_classes.h:40,
                 from /usr/include/c++/4.8/bits/ios_base.h:41,
                 from /usr/include/c++/4.8/ios:42,
                 from /usr/include/c++/4.8/istream:38,
                 from /usr/include/c++/4.8/sstream:38,
                 from /usr/include/c++/4.8/complex:45,
                 from /usr/include/c++/4.8/ccomplex:38,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52,
                 from cuvinte.cpp:1:
/usr/include/c++/4.8/bits/functional_hash.h:58:12: error: declaration of 'struct std::hash<std::vector<char> >'
     struct hash;
            ^

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema Cuvinte face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.