#3475
TerenCasa_low
Gigel, un personaj cunoscut, vrea de data aceasta să își construiască o casă. Astfel, el cumpără un teren, reprezentat sub forma unei matrice binare cu n
linii și m
coloane, dar datorită lipsei de experiență în tranzacții imobiliare este păcălit, deoarece există pe teren zone afectate în care nu se poate construi, marcate în matrice cu 0
. Celelalte zone în care se poate construi sunt marcate cu 1
.
Gigel acceptă că a greșit și nu are altceva de făcut decât să își construiască casa unde este posibil. Acesta caută pe terenul achiziționat o bucată de teren pătrată de dimensiune cât mai mare, pentru care toate zonele ce o alcătuiesc să fie utilizabile(marcate cu 1
în matricea binară a reprezentării terenului), în care își va construi casa.
Acesta nu se descurcă singur și vă roagă pe voi să îl ajutați să își rezolve această problemă.
Problema | TerenCasa_low | Operații I/O |
terencasa_low.in /terencasa_low.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50210019 | Utilizator | |
Fișier | terencasa_low.cpp | Dimensiune | 941 B |
Data încărcării | 31 Martie 2024, 22:19 | Scor / rezultat | Eroare de compilare |
terencasa_low.cpp:3:13: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin("terencasa_low.in"); ^ terencasa_low.cpp:4:14: error: variable 'std::ofstream cout' has initializer but incomplete type ofstream cout("terencasa_low.out"); ^ terencasa_low.cpp: In function 'int main()': terencasa_low.cpp:8:5: error: reference to 'cin' is ambiguous cin >> n >> m; ^ terencasa_low.cpp:3:10: note: candidates are: <typeprefixerror>cin ifstream cin("terencasa_low.in"); ^ In file included from terencasa_low.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ terencasa_low.cpp:12:13: error: reference to 'cin' is ambiguous cin >> a[i][j]; ^ terencasa_low.cpp:3:10: note: candidates are: <typeprefixerror>cin ifstream cin("terencasa_low.in"); ^ In file included from terencasa_low.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ terencasa_low.cpp:20:26: error: reference to 'max' is ambiguous if(b[i][j] > max) max = b[i][j]; ^ terencasa_low.cpp:5:45: note: candidates are: int max int n , m , a[1001][1001] , b[1001][1001] , max; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, 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 terencasa_low.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ terencasa_low.cpp:20:31: error: reference to 'max' is ambiguous if(b[i][j] > max) max = b[i][j]; ^ terencasa_low.cpp:5:45: note: candidates are: int max int n , m , a[1001][1001] , b[1001][1001] , max; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, 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 terencasa_low.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ terencasa_low.cpp:22:5: error: reference to 'cout' is ambiguous cout << max << " "; ^ terencasa_low.cpp:4:10: note: candidates are: <typeprefixerror>cout ofstream cout("terencasa_low.out"); ^ In file included from terencasa_low.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ terencasa_low.cpp:22:13: error: reference to 'max' is ambiguous cout << max << " "; ^ terencasa_low.cpp:5:45: note: candidates are: int max int n , m , a[1001][1001] , b[1001][1001] , max; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, 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 terencasa_low.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ terencasa_low.cpp:25:27: error: reference to 'max' is ambiguous if(b[i][j] == max) ^ terencasa_low.cpp:5:45: note: candidates are: int max int n , m , a[1001][1001] , b[1001][1001] , max; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, 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 terencasa_low.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ terencasa_low.cpp:27:17: error: reference to 'cout' is ambiguous cout << i - max + 1<< " " << j - max + 1<< " " << i << " " << j; ^ terencasa_low.cpp:4:10: note: candidates are: <typeprefixerror>cout ofstream cout("terencasa_low.out"); ^ In file included from terencasa_low.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ terencasa_low.cpp:27:29: error: reference to 'max' is ambiguous cout << i - max + 1<< " " << j - max + 1<< " " << i << " " << j; ^ terencasa_low.cpp:5:45: note: candidates are: int max int n , m , a[1001][1001] , b[1001][1001] , max; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, 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 terencasa_low.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ terencasa_low.cpp:27:50: error: reference to 'max' is ambiguous cout << i - max + 1<< " " << j - max + 1<< " " << i << " " << j; ^ terencasa_low.cpp:5:45: note: candidates are: int max int n , m , a[1001][1001] , b[1001][1001] , max; ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, 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 terencasa_low.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema TerenCasa_low 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ă.