#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 | #63475604 | Utilizator | |
| Fișier | superhedgy.cpp | Dimensiune | 1.65 KB |
| Data încărcării | 04 Martie 2026, 21:48 | 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:56:25: error: no matching function for call to 'std::vector<Cladire>::push_back(<brace-enclosed initializer list>)' sus.push_back({0, 0}); ^ superhedgy.cpp:56: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:57:25: error: no matching function for call to 'std::vector<Cladire>::push_back(<brace-enclosed initializer list>)' jos.push_back({0, 0}); ^ superhedgy.cpp:57: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:66:33: error: no matching function for call to 'std::vector<Cladire>::push_back(<brace-enclosed initializer list>)' sus.push_back({h, e}); ^ superhedgy.cpp:66: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:76:33: error: no matching function for call to 'std::vector<Cladire>::push_back(<brace-enclosed initializer list>)' jos.push_back({h, e}); ^ superhedgy.cpp:76: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:81:25: error: no matching function for call to 'std::vector<Cladire>::push_back(<brace-enclosed initializer list>)' sus.push_back({0, 0}); ^ superhedgy.cpp:81: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:82:25: error: no matching function for call to 'std::vector<Cladire>::push_back(<brace-enclosed initializer list>)' jos.push_back({0, 0}); ^ superhedgy.cpp:82: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ă.