#4341
tablou2
Cunoscând N
, M
numărul de linii respectiv numărul de coloane din matrice și elementele matricei care reprezintă afișul, scrieţi un program care să rezolve următoarele cerinţe:
1. Determină aria minimă a unui tablou care conține obiectul de suprafață maximă care poate fi încadrat într-un tablou;
2. Determină numărul maxim de tablouri care pot fi decupate știind că elevii caută începând de sus în jos și de la stânga la dreapta obiectele care pot fi încadrate într-un tablou și decupează tabloul.
Olimpiada Municipală de Informatică, Iași, 2023
Problema | tablou2 | Operații I/O |
tablou.in /tablou.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #52581146 | Utilizator | |
Fișier | tablou2.cpp | Dimensiune | 3.91 KB |
Data încărcării | 03 Octombrie 2024, 18:03 | Scor / rezultat | Eroare de compilare |
tablou2.cpp: In function 'std::tuple<int, int, int, int, int> fill(int, int, int)': tablou2.cpp:14:55: error: return type 'class std::tuple<int, int, int, int, int>' is incomplete tuple<int,int,int,int, int> fill(int i, int j, int val){ ^ tablou2.cpp:45:45: error: 'make_tuple' was not declared in this scope return make_tuple(x1,y1, x2, y2, cnt - 1); ^ tablou2.cpp: In function 'int main()': tablou2.cpp:59:48: error: variable 'std::tuple<int, int, int, int, int> ret' has initializer but incomplete type tuple<int,int,int,int, int>ret = fill(i , j, mat[i][j]); ^ tablou2.cpp:61:30: error: 'get' was not declared in this scope int x1 = get<0>(ret); ^ tablou2.cpp:61:25: warning: unused variable 'x1' [-Wunused-variable] int x1 = get<0>(ret); ^ tablou2.cpp:62:25: warning: unused variable 'y1' [-Wunused-variable] int y1 = get<1>(ret); ^ tablou2.cpp:63:25: warning: unused variable 'x2' [-Wunused-variable] int x2 = get<2>(ret); ^ tablou2.cpp:64:25: warning: unused variable 'y2' [-Wunused-variable] int y2 = get<3>(ret); ^ tablou2.cpp:102:25: error: 'std::tuple<int, int, int, int, int> elem' has incomplete type for(auto elem : ans){ ^ tablou2.cpp:103:22: error: 'get' was not declared in this scope int x1 = get<0>(elem); ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:67:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from tablou2.cpp:1: /usr/include/c++/4.8/bits/stl_iterator.h: In instantiation of '__gnu_cxx::__normal_iterator<_Iterator, _Container>& __gnu_cxx::__normal_iterator<_Iterator, _Container>::operator++() [with _Iterator = std::tuple<int, int, int, int, int>*; _Container = std::vector<std::tuple<int, int, int, int, int> >]': tablou2.cpp:102:25: required from here /usr/include/c++/4.8/bits/stl_iterator.h:748:2: error: cannot increment a pointer to incomplete type 'std::tuple<int, int, int, int, int>' ++_M_current; ^ In file included from /usr/include/c++/4.8/vector:64:0, from /usr/include/c++/4.8/queue:61, from tablou2.cpp:3: /usr/include/c++/4.8/bits/stl_vector.h: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = std::tuple<int, int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int, int> >]': /usr/include/c++/4.8/bits/stl_vector.h:249:15: required from 'std::vector<_Tp, _Alloc>::vector() [with _Tp = std::tuple<int, int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int, int> >]' tablou2.cpp:8:37: required from here /usr/include/c++/4.8/bits/stl_vector.h:161:9: error: invalid use of incomplete type 'class std::tuple<int, int, int, int, int>' - this->_M_impl._M_start); } ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from tablou2.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:83:11: error: declaration of 'class std::tuple<int, int, int, int, int>' class tuple; ^ In file included from /usr/include/c++/4.8/deque:62:0, from /usr/include/c++/4.8/queue:60, from tablou2.cpp:3: /usr/include/c++/4.8/bits/stl_construct.h: In instantiation of 'void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = std::tuple<int, int, int, int, int>*]': /usr/include/c++/4.8/bits/stl_construct.h:151:31: required from 'void std::_Destroy(_ForwardIterator, _ForwardIterator, std::allocator<_T2>&) [with _ForwardIterator = std::tuple<int, int, int, int, int>*; _Tp = std::tuple<int, int, int, int, int>]' /usr/include/c++/4.8/bits/stl_vector.h:416:30: required from 'std::vector<_Tp, _Alloc>::~vector() [with _Tp = std::tuple<int, int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int, int> >]' tablou2.cpp:8:37: required from here /usr/include/c++/4.8/bits/stl_construct.h:127:27: error: invalid use of incomplete type '_Value_type {aka class std::tuple<int, int, int, int, int>}' __destroy(__first, __last); ^ In file included from /usr/include/c++/4.8/bits/stl_algobase.h:64:0, from /usr/include/c++/4.8/bits/char_traits.h:39, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from tablou2.cpp:1: /usr/include/c++/4.8/bits/stl_pair.h:83:11: error: declaration of '_Value_type {aka class std::tuple<int, int, int, int, int>}' class tuple; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema tablou2 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ă.