#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 | #49642993 | Utilizator | |
Fișier | tablou2.cpp | Dimensiune | 7.81 KB |
Data încărcării | 11 Martie 2024, 08:27 | Scor / rezultat | Eroare de compilare |
tablou2.cpp:8:19: error: stray '#' in program int32_t Y = 0;#include <iostream> ^ tablou2.cpp:8:20: error: 'include' does not name a type int32_t Y = 0;#include <iostream> ^ tablou2.cpp:24:32: error: field 'TopLeft' has incomplete type Point TopLeft = { 999, 999 }; ^ tablou2.cpp:25:32: error: field 'BottomRight' has incomplete type Point BottomRight = { 0, 0 }; ^ tablou2.cpp: In member function 'std::vector<Point::Piece> Point::GetPieces()': tablou2.cpp:52:27: error: 'struct Point::Piece' has no member named 'TopLeft' piece.TopLeft.X = std::min(piece.TopLeft.X, curPoint.X); ^ tablou2.cpp:52:54: error: 'struct Point::Piece' has no member named 'TopLeft' piece.TopLeft.X = std::min(piece.TopLeft.X, curPoint.X); ^ tablou2.cpp:53:27: error: 'struct Point::Piece' has no member named 'TopLeft' piece.TopLeft.Y = std::min(piece.TopLeft.Y, curPoint.Y); ^ tablou2.cpp:53:54: error: 'struct Point::Piece' has no member named 'TopLeft' piece.TopLeft.Y = std::min(piece.TopLeft.Y, curPoint.Y); ^ tablou2.cpp:54:27: error: 'struct Point::Piece' has no member named 'BottomRight' piece.BottomRight.X = std::max(piece.BottomRight.X, curPoint.X); ^ tablou2.cpp:54:58: error: 'struct Point::Piece' has no member named 'BottomRight' piece.BottomRight.X = std::max(piece.BottomRight.X, curPoint.X); ^ tablou2.cpp:55:27: error: 'struct Point::Piece' has no member named 'BottomRight' piece.BottomRight.Y = std::max(piece.BottomRight.Y, curPoint.Y); ^ tablou2.cpp:55:58: error: 'struct Point::Piece' has no member named 'BottomRight' piece.BottomRight.Y = std::max(piece.BottomRight.Y, curPoint.Y); ^ tablou2.cpp:69:37: error: 'struct Point::Piece' has no member named 'BottomRight' piece.Area = (piece.BottomRight.X - piece.TopLeft.X + 1) * (piece.BottomRight.Y - piece.TopLeft.Y + 1); ^ tablou2.cpp:69:59: error: 'struct Point::Piece' has no member named 'TopLeft' piece.Area = (piece.BottomRight.X - piece.TopLeft.X + 1) * (piece.BottomRight.Y - piece.TopLeft.Y + 1); ^ tablou2.cpp:69:83: error: 'struct Point::Piece' has no member named 'BottomRight' piece.Area = (piece.BottomRight.X - piece.TopLeft.X + 1) * (piece.BottomRight.Y - piece.TopLeft.Y + 1); ^ tablou2.cpp:69:105: error: 'struct Point::Piece' has no member named 'TopLeft' piece.Area = (piece.BottomRight.X - piece.TopLeft.X + 1) * (piece.BottomRight.Y - piece.TopLeft.Y + 1); ^ tablou2.cpp:73:41: error: 'struct Point::Piece' has no member named 'TopLeft' for (int32_t eY = piece.TopLeft.Y; eY <= piece.BottomRight.Y; ++eY) { ^ tablou2.cpp:73:64: error: 'struct Point::Piece' has no member named 'BottomRight' for (int32_t eY = piece.TopLeft.Y; eY <= piece.BottomRight.Y; ++eY) { ^ tablou2.cpp:74:45: error: 'struct Point::Piece' has no member named 'TopLeft' for (int32_t eX = piece.TopLeft.X; eX <= piece.BottomRight.X; ++eX) { ^ tablou2.cpp:74:68: error: 'struct Point::Piece' has no member named 'BottomRight' for (int32_t eX = piece.TopLeft.X; eX <= piece.BottomRight.X; ++eX) { ^ tablou2.cpp: In member function 'int Point::main()': tablou2.cpp:137:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^
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ă.