#685
Domino
Să se determine, dacă este posibil, un șir de piese de domino care respectă o anumită regulă.
Problema | Domino | Operații I/O |
domino.in /domino.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 64 MB
|
Id soluție | #45500312 | Utilizator | |
Fișier | domino.cpp | Dimensiune | 1.43 KB |
Data încărcării | 14 Octombrie 2023, 13:27 | Scor / rezultat | Eroare de compilare |
domino.cpp: In function 'bool* getUsedPointer(piesa)': domino.cpp:25:5: error: 'f' was not declared in this scope */f ^ domino.cpp:26:3: error: expected ';' before 'if' if ( p2.first > p2.second ) ^ domino.cpp:28:15: error: no match for 'operator[]' (operand types are 'std::unordered_map<bool, std::pair<int, int> >' and 'piesa {aka std::pair<int, int>}') return &used[ p2 ]; // 0-indexing vs 1-indexing ^ domino.cpp:28:15: note: candidates are: In file included from /usr/include/c++/4.8/unordered_map:48:0, from domino.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 = bool; _Tp = std::pair<int, int>; _Hash = std::hash<bool>; _Pred = std::equal_to<bool>; _Alloc = std::allocator<std::pair<const bool, std::pair<int, int> > >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type = std::pair<int, int>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type = bool] operator[](const key_type& __k) ^ /usr/include/c++/4.8/bits/unordered_map.h:595:7: note: no known conversion for argument 1 from 'piesa {aka std::pair<int, int>}' to 'const key_type& {aka const bool&}' /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 = bool; _Tp = std::pair<int, int>; _Hash = std::hash<bool>; _Pred = std::equal_to<bool>; _Alloc = std::allocator<std::pair<const bool, std::pair<int, int> > >; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type = std::pair<int, int>; std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::key_type = bool] operator[](key_type&& __k) ^ /usr/include/c++/4.8/bits/unordered_map.h:599:7: note: no known conversion for argument 1 from 'piesa {aka std::pair<int, int>}' to 'std::unordered_map<bool, std::pair<int, int> >::key_type&& {aka bool&&}' domino.cpp:29:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Domino 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ă.