#4116
Ariciul Gălușcă este un arici obișnuit pe timp de zi. Noaptea, însă, el este de fapt eroul misterios al orașului Hedgytown – un oraș mai special, deoarece are clădiri atât deasupra solului, cât și sub pamânt, unde gravitația este inversată. Orașul poate fi văzut ca o dreaptă (ce reprezintă solul), cu un șir de clădiri dreptunghiulare lipite deasupra solului, și un șir de clădiri dreptunghiulare lipite dedesubtul solului. Sunt N clădiri peste pământ și M sub pământ. Cele două șiruri încep și se termină la aceleași poziții. Fiecare clădire este caracterizată de trei valori: L, H și E. L reprezintă lățimea clădirii, H reprezintă înălțimea clădirii și E reprezintă efortul necesar pentru a folosi liftul din acea clădire. Se cere să se afle numărul minim de unități de efort pe care trebuie să le depună ariciul Gălușcă pentru a ajunge la destinația sa.
OJI 2022 clasele XI-XII
| Problema | superhedgy | Operații I/O |
superhedgy.in/superhedgy.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 512 MB
/
Stivă 64 MB
|
| Id soluție | #63475577 | Utilizator | |
| Fișier | superhedgy.cpp | Dimensiune | 1.61 KB |
| Data încărcării | 04 Martie 2026, 21:47 | Scor/rezultat | Eroare de compilare |
superhedgy.cpp: In function 'void print(Cld&, Cld&, std::vector<int>&)': superhedgy.cpp:21:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < alegeri.size(); i++) { ^ superhedgy.cpp: In function 'void back(Cld&, Cld&, int, std::vector<int>&)': superhedgy.cpp:40:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (poz == sus.size() - 1) { ^ superhedgy.cpp: In function 'int main()': superhedgy.cpp:54:36: error: no matching function for call to 'std::vector<Cladire>::vector(<brace-enclosed initializer list>)' std::vector<Cladire> sus{{0, 0}}, jos{{0, 0}}; ^ superhedgy.cpp:54:36: note: candidates are: In file included from /usr/include/c++/4.8/vector:64:0, from superhedgy.cpp:4: /usr/include/c++/4.8/bits/stl_vector.h:392:9: note: template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) vector(_InputIterator __first, _InputIterator __last, ^ /usr/include/c++/4.8/bits/stl_vector.h:392:9: note: template argument deduction/substitution failed: superhedgy.cpp:54:36: note: candidate expects 3 arguments, 1 provided std::vector<Cladire> sus{{0, 0}}, jos{{0, 0}}; ^ In file included from /usr/include/c++/4.8/vector:64:0, from superhedgy.cpp:4: /usr/include/c++/4.8/bits/stl_vector.h:364:7: note: std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<Cladire>] vector(initializer_list<value_type> __l, ^ /usr/include/c++/4.8/bits/stl_vector.h:364:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::initializer_list<Cladire>' /usr/include/c++/4.8/bits/stl_vector.h:340:7: note: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<Cladire>] vector(vector&& __rv, const allocator_type& __m) ^ /usr/include/c++/4.8/bits/stl_vector.h:340:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/4.8/bits/stl_vector.h:331:7: note: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, const allocator_type&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<Cladire>] vector(const vector& __x, const allocator_type& __a) ^ /usr/include/c++/4.8/bits/stl_vector.h:331:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/4.8/bits/stl_vector.h:327:7: note: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>] vector(vector&& __x) noexcept ^ /usr/include/c++/4.8/bits/stl_vector.h:327:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<Cladire>&&' /usr/include/c++/4.8/bits/stl_vector.h:310:7: note: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>] vector(const vector& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:310:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::vector<Cladire>&' /usr/include/c++/4.8/bits/stl_vector.h:281:7: note: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const value_type&, const allocator_type&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::size_type = unsigned int; std::vector<_Tp, _Alloc>::value_type = Cladire; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<Cladire>] vector(size_type __n, const value_type& __value, ^ /usr/include/c++/4.8/bits/stl_vector.h:281:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/4.8/bits/stl_vector.h:269:7: note: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::size_type = unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<Cladire>] vector(size_type __n, const allocator_type& __a = allocator_type()) ^ /usr/include/c++/4.8/bits/stl_vector.h:269:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<Cladire>::size_type {aka unsigned int}' /usr/include/c++/4.8/bits/stl_vector.h:256:7: note: std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<Cladire>] vector(const allocator_type& __a) ^ /usr/include/c++/4.8/bits/stl_vector.h:256:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const allocator_type& {aka const std::allocator<Cladire>&}' /usr/include/c++/4.8/bits/stl_vector.h:248:7: note: std::vector<_Tp, _Alloc>::vector() [with _Tp = Cladire; _Alloc = std::allocator<Cladire>] vector() ^ /usr/include/c++/4.8/bits/stl_vector.h:248:7: note: candidate expects 0 arguments, 1 provided superhedgy.cpp:54:49: error: no matching function for call to 'std::vector<Cladire>::vector(<brace-enclosed initializer list>)' std::vector<Cladire> sus{{0, 0}}, jos{{0, 0}}; ^ superhedgy.cpp:54:49: note: candidates are: In file included from /usr/include/c++/4.8/vector:64:0, from superhedgy.cpp:4: /usr/include/c++/4.8/bits/stl_vector.h:392:9: note: template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) vector(_InputIterator __first, _InputIterator __last, ^ /usr/include/c++/4.8/bits/stl_vector.h:392:9: note: template argument deduction/substitution failed: superhedgy.cpp:54:49: note: candidate expects 3 arguments, 1 provided std::vector<Cladire> sus{{0, 0}}, jos{{0, 0}}; ^ In file included from /usr/include/c++/4.8/vector:64:0, from superhedgy.cpp:4: /usr/include/c++/4.8/bits/stl_vector.h:364:7: note: std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<Cladire>] vector(initializer_list<value_type> __l, ^ /usr/include/c++/4.8/bits/stl_vector.h:364:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::initializer_list<Cladire>' /usr/include/c++/4.8/bits/stl_vector.h:340:7: note: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<Cladire>] vector(vector&& __rv, const allocator_type& __m) ^ /usr/include/c++/4.8/bits/stl_vector.h:340:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/4.8/bits/stl_vector.h:331:7: note: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, const allocator_type&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<Cladire>] vector(const vector& __x, const allocator_type& __a) ^ /usr/include/c++/4.8/bits/stl_vector.h:331:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/4.8/bits/stl_vector.h:327:7: note: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>] vector(vector&& __x) noexcept ^ /usr/include/c++/4.8/bits/stl_vector.h:327:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<Cladire>&&' /usr/include/c++/4.8/bits/stl_vector.h:310:7: note: std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>] vector(const vector& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:310:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::vector<Cladire>&' /usr/include/c++/4.8/bits/stl_vector.h:281:7: note: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const value_type&, const allocator_type&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::size_type = unsigned int; std::vector<_Tp, _Alloc>::value_type = Cladire; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<Cladire>] vector(size_type __n, const value_type& __value, ^ /usr/include/c++/4.8/bits/stl_vector.h:281:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/4.8/bits/stl_vector.h:269:7: note: std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::size_type = unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<Cladire>] vector(size_type __n, const allocator_type& __a = allocator_type()) ^ /usr/include/c++/4.8/bits/stl_vector.h:269:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<Cladire>::size_type {aka unsigned int}' /usr/include/c++/4.8/bits/stl_vector.h:256:7: note: std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<Cladire>] vector(const allocator_type& __a) ^ /usr/include/c++/4.8/bits/stl_vector.h:256:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const allocator_type& {aka const std::allocator<Cladire>&}' /usr/include/c++/4.8/bits/stl_vector.h:248:7: note: std::vector<_Tp, _Alloc>::vector() [with _Tp = Cladire; _Alloc = std::allocator<Cladire>] vector() ^ /usr/include/c++/4.8/bits/stl_vector.h:248:7: note: candidate expects 0 arguments, 1 provided superhedgy.cpp:63:33: error: no matching function for call to 'std::vector<Cladire>::push_back(<brace-enclosed initializer list>)' sus.push_back({h, e}); ^ superhedgy.cpp:63:33: note: candidates are: In file included from /usr/include/c++/4.8/vector:64:0, from superhedgy.cpp:4: /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::value_type = Cladire] push_back(const value_type& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const Cladire&}' /usr/include/c++/4.8/bits/stl_vector.h:919:7: note: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::value_type = Cladire] push_back(value_type&& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:919:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<Cladire>::value_type&& {aka Cladire&&}' superhedgy.cpp:73:33: error: no matching function for call to 'std::vector<Cladire>::push_back(<brace-enclosed initializer list>)' jos.push_back({h, e}); ^ superhedgy.cpp:73:33: note: candidates are: In file included from /usr/include/c++/4.8/vector:64:0, from superhedgy.cpp:4: /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::value_type = Cladire] push_back(const value_type& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const Cladire&}' /usr/include/c++/4.8/bits/stl_vector.h:919:7: note: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::value_type = Cladire] push_back(value_type&& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:919:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<Cladire>::value_type&& {aka Cladire&&}' superhedgy.cpp:78:25: error: no matching function for call to 'std::vector<Cladire>::push_back(<brace-enclosed initializer list>)' sus.push_back({0, 0}); ^ superhedgy.cpp:78:25: note: candidates are: In file included from /usr/include/c++/4.8/vector:64:0, from superhedgy.cpp:4: /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::value_type = Cladire] push_back(const value_type& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const Cladire&}' /usr/include/c++/4.8/bits/stl_vector.h:919:7: note: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::value_type = Cladire] push_back(value_type&& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:919:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<Cladire>::value_type&& {aka Cladire&&}' superhedgy.cpp:79:25: error: no matching function for call to 'std::vector<Cladire>::push_back(<brace-enclosed initializer list>)' jos.push_back({0, 0}); ^ superhedgy.cpp:79:25: note: candidates are: In file included from /usr/include/c++/4.8/vector:64:0, from superhedgy.cpp:4: /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::value_type = Cladire] push_back(const value_type& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type& {aka const Cladire&}' /usr/include/c++/4.8/bits/stl_vector.h:919:7: note: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = Cladire; _Alloc = std::allocator<Cladire>; std::vector<_Tp, _Alloc>::value_type = Cladire] push_back(value_type&& __x) ^ /usr/include/c++/4.8/bits/stl_vector.h:919:7: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<Cladire>::value_type&& {aka Cladire&&}'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema superhedgy 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ă.