#4927
Un număr de postere dreptunghiulare, fotografii și alte imagini de aceeași formă sunt lipite pe un perete. Laturile lor sunt toate verticale sau orizontale. Fiecare dreptunghi poate fi parțial sau total acoperit de celelalte. Lungimea limitei unirii tuturor dreptunghiurilor se numește perimetru. Scrieți un program care calculează perimetrul.
| Problema | picture | Operații I/O |
picture.in/picture.out
|
|---|---|---|---|
| Limita timp | 0.9 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63586572 | Utilizator | |
| Fișier | picture.cpp | Dimensiune | 1.41 KB |
| Data încărcării | 10 Martie 2026, 14:11 | Scor/rezultat | Eroare de compilare |
picture.cpp: In function 'int main()': picture.cpp:45:50: error: no matching function for call to 'std::vector<event>::push_back(<brace-enclosed initializer list>)' events_lin[x1+VMAX].push_back({y1, y2, 1}); ^ picture.cpp:45:50: note: candidates are: In file included from /usr/include/c++/4.8/vector:64:0, from /usr/include/c++/4.8/bits/random.h:34, from /usr/include/c++/4.8/random:50, from /usr/include/c++/4.8/bits/stl_algo.h:65, from /usr/include/c++/4.8/algorithm:62, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from picture.cpp:1: /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = event; _Alloc = std::allocator<event>; std::vector<_Tp, _Alloc>::value_type = event] 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 event&}' /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 = event; _Alloc = std::allocator<event>; std::vector<_Tp, _Alloc>::value_type = event] 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<event>::value_type&& {aka event&&}' picture.cpp:46:51: error: no matching function for call to 'std::vector<event>::push_back(<brace-enclosed initializer list>)' events_lin[x2+VMAX].push_back({y1, y2, -1}); ^ picture.cpp:46:51: note: candidates are: In file included from /usr/include/c++/4.8/vector:64:0, from /usr/include/c++/4.8/bits/random.h:34, from /usr/include/c++/4.8/random:50, from /usr/include/c++/4.8/bits/stl_algo.h:65, from /usr/include/c++/4.8/algorithm:62, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from picture.cpp:1: /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = event; _Alloc = std::allocator<event>; std::vector<_Tp, _Alloc>::value_type = event] 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 event&}' /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 = event; _Alloc = std::allocator<event>; std::vector<_Tp, _Alloc>::value_type = event] 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<event>::value_type&& {aka event&&}' picture.cpp:48:50: error: no matching function for call to 'std::vector<event>::push_back(<brace-enclosed initializer list>)' events_col[y1+VMAX].push_back({x1, x2, 1}); ^ picture.cpp:48:50: note: candidates are: In file included from /usr/include/c++/4.8/vector:64:0, from /usr/include/c++/4.8/bits/random.h:34, from /usr/include/c++/4.8/random:50, from /usr/include/c++/4.8/bits/stl_algo.h:65, from /usr/include/c++/4.8/algorithm:62, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from picture.cpp:1: /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = event; _Alloc = std::allocator<event>; std::vector<_Tp, _Alloc>::value_type = event] 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 event&}' /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 = event; _Alloc = std::allocator<event>; std::vector<_Tp, _Alloc>::value_type = event] 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<event>::value_type&& {aka event&&}' picture.cpp:49:51: error: no matching function for call to 'std::vector<event>::push_back(<brace-enclosed initializer list>)' events_col[y2+VMAX].push_back({x1, x2, -1}); ^ picture.cpp:49:51: note: candidates are: In file included from /usr/include/c++/4.8/vector:64:0, from /usr/include/c++/4.8/bits/random.h:34, from /usr/include/c++/4.8/random:50, from /usr/include/c++/4.8/bits/stl_algo.h:65, from /usr/include/c++/4.8/algorithm:62, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from picture.cpp:1: /usr/include/c++/4.8/bits/stl_vector.h:901:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = event; _Alloc = std::allocator<event>; std::vector<_Tp, _Alloc>::value_type = event] 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 event&}' /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 = event; _Alloc = std::allocator<event>; std::vector<_Tp, _Alloc>::value_type = event] 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<event>::value_type&& {aka event&&}'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema picture 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ă.