#3474
Aflați numărul subsecventelor care au produsul pătrat perfect.
| Problema | Squary | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.04 secunde | Limita memorie |
Total: 4 MB
/
Stivă 4 MB
|
| Id soluție | #62033183 | Utilizator | |
| Fișier | squary.cpp | Dimensiune | 790 B |
| Data încărcării | 02 Ianuarie 2026, 21:34 | Scor/rezultat | Eroare de compilare |
squary.cpp: In function 'int main()': squary.cpp:27:6: error: no match for 'operator[]' (operand types are 'std::unordered_map<std::bitset<295u>, int>' and 'std::bitset<304u>') f[curent] = 1; ^ squary.cpp:27:6: note: candidates are: In file included from /usr/include/c++/4.8/unordered_map:48:0, from squary.cpp:3: /usr/include/c++/4.8/bits/unordered_map.h:595:7: note: 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::bitset<295u>; _Tp = int; _Hash = std::hash<std::bitset<295u> >; _Pred = std::equal_to<std::bitset<295u> >; _Alloc = std::allocator<std::pair<const std::bitset<295u>, int> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type = int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type = std::bitset<295u>] operator[](const key_type& __k) ^ /usr/include/c++/4.8/bits/unordered_map.h:595:7: note: no known conversion for argument 1 from 'std::bitset<304u>' to 'const key_type& {aka const std::bitset<295u>&}' /usr/include/c++/4.8/bits/unordered_map.h:599:7: note: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type&&) [with _Key = std::bitset<295u>; _Tp = int; _Hash = std::hash<std::bitset<295u> >; _Pred = std::equal_to<std::bitset<295u> >; _Alloc = std::allocator<std::pair<const std::bitset<295u>, int> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type = int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type = std::bitset<295u>] operator[](key_type&& __k) ^ /usr/include/c++/4.8/bits/unordered_map.h:599:7: note: no known conversion for argument 1 from 'std::bitset<304u>' to 'std::unordered_map<std::bitset<295u>, int>::key_type&& {aka std::bitset<295u>&&}' squary.cpp:30:16: error: no match for 'operator^=' (operand types are 'std::bitset<304u>' and 'std::bitset<295u>') curent ^= a[v[i]]; ^ squary.cpp:30:16: note: candidates are: In file included from squary.cpp:2:0: /usr/include/c++/4.8/bitset:965:7: note: std::bitset<_Nb>& std::bitset<_Nb>::operator^=(const std::bitset<_Nb>&) [with unsigned int _Nb = 304u] operator^=(const bitset<_Nb>& __rhs) _GLIBCXX_NOEXCEPT ^ /usr/include/c++/4.8/bitset:965:7: note: no known conversion for argument 1 from 'std::bitset<295u>' to 'const std::bitset<304u>&' In file included from /usr/include/c++/4.8/ios:42:0, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from squary.cpp:1: /usr/include/c++/4.8/bits/ios_base.h:101:3: note: const std::_Ios_Fmtflags& std::operator^=(std::_Ios_Fmtflags&, std::_Ios_Fmtflags) operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) ^ /usr/include/c++/4.8/bits/ios_base.h:101:3: note: no known conversion for argument 1 from 'std::bitset<304u>' to 'std::_Ios_Fmtflags&' /usr/include/c++/4.8/bits/ios_base.h:143:3: note: const std::_Ios_Openmode& std::operator^=(std::_Ios_Openmode&, std::_Ios_Openmode) operator^=(_Ios_Openmode& __a, _Ios_Openmode __b) ^ /usr/include/c++/4.8/bits/ios_base.h:143:3: note: no known conversion for argument 1 from 'std::bitset<304u>' to 'std::_Ios_Openmode&' /usr/include/c++/4.8/bits/ios_base.h:183:3: note: const std::_Ios_Iostate& std::operator^=(std::_Ios_Iostate&, std::_Ios_Iostate) operator^=(_Ios_Iostate& __a, _Ios_Iostate __b) ^ /usr/include/c++/4.8/bits/ios_base.h:183:3: note: no known conversion for argument 1 from 'std::bitset<304u>' to 'std::_Ios_Iostate&' squary.cpp:31:16: error: no match for 'operator[]' (operand types are 'std::unordered_map<std::bitset<295u>, int>' and 'std::bitset<304u>') nr += f[curent]; ^ squary.cpp:31:16: note: candidates are: In file included from /usr/include/c++/4.8/unordered_map:48:0, from squary.cpp:3: /usr/include/c++/4.8/bits/unordered_map.h:595:7: note: 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::bitset<295u>; _Tp = int; _Hash = std::hash<std::bitset<295u> >; _Pred = std::equal_to<std::bitset<295u> >; _Alloc = std::allocator<std::pair<const std::bitset<295u>, int> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type = int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type = std::bitset<295u>] operator[](const key_type& __k) ^ /usr/include/c++/4.8/bits/unordered_map.h:595:7: note: no known conversion for argument 1 from 'std::bitset<304u>' to 'const key_type& {aka const std::bitset<295u>&}' /usr/include/c++/4.8/bits/unordered_map.h:599:7: note: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type&&) [with _Key = std::bitset<295u>; _Tp = int; _Hash = std::hash<std::bitset<295u> >; _Pred = std::equal_to<std::bitset<295u> >; _Alloc = std::allocator<std::pair<const std::bitset<295u>, int> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type = int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type = std::bitset<295u>] operator[](key_type&& __k) ^ /usr/include/c++/4.8/bits/unordered_map.h:599:7: note: no known conversion for argument 1 from 'std::bitset<304u>' to 'std::unordered_map<std::bitset<295u>, int>::key_type&& {aka std::bitset<295u>&&}' squary.cpp:32:10: error: no match for 'operator[]' (operand types are 'std::unordered_map<std::bitset<295u>, int>' and 'std::bitset<304u>') f[curent]++; ^ squary.cpp:32:10: note: candidates are: In file included from /usr/include/c++/4.8/unordered_map:48:0, from squary.cpp:3: /usr/include/c++/4.8/bits/unordered_map.h:595:7: note: 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::bitset<295u>; _Tp = int; _Hash = std::hash<std::bitset<295u> >; _Pred = std::equal_to<std::bitset<295u> >; _Alloc = std::allocator<std::pair<const std::bitset<295u>, int> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type = int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type = std::bitset<295u>] operator[](const key_type& __k) ^ /usr/include/c++/4.8/bits/unordered_map.h:595:7: note: no known conversion for argument 1 from 'std::bitset<304u>' to 'const key_type& {aka const std::bitset<295u>&}' /usr/include/c++/4.8/bits/unordered_map.h:599:7: note: std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type&&) [with _Key = std::bitset<295u>; _Tp = int; _Hash = std::hash<std::bitset<295u> >; _Pred = std::equal_to<std::bitset<295u> >; _Alloc = std::allocator<std::pair<const std::bitset<295u>, int> >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type = int; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type = std::bitset<295u>] operator[](key_type&& __k) ^ /usr/include/c++/4.8/bits/unordered_map.h:599:7: note: no known conversion for argument 1 from 'std::bitset<304u>' to 'std::unordered_map<std::bitset<295u>, int>::key_type&& {aka std::bitset<295u>&&}'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Squary face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
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ă.