#3724
Se dă un cod de segmentare și numerotare și se cere să se afle:
1. numărul de subdiviziuni pe care acesta le generează;
2. dimensiunile unui dreptunghi de arie minimă pentru care acest cod este valid;
3. numărul de codificări distincte modulo 1.000.000.007
, echivalente cu codul citit (în acest număr va fi inclus și codul inițial);
4. primul cod în ordine lexicografică echivalent cu cel dat.
OJI 2021, clasele XI-XII
Problema | Dreptunghi2 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 256 MB
/
Stivă 8 MB
|
Id soluție | #55345220 | Utilizator | |
Fișier | dreptunghi2.cpp | Dimensiune | 3.31 KB |
Data încărcării | 11 Ianuarie 2025, 22:59 | Scor / rezultat | Eroare de compilare |
dreptunghi2.cpp: In function 'Cut* parseCode(std::string&, int&)': dreptunghi2.cpp:17:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (idx >= code.length()) return nullptr; ^ dreptunghi2.cpp:31:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] while (idx < code.length() && isdigit(code[idx])) { ^ dreptunghi2.cpp: In function 'std::pair<int, int> findMinDimensions(Cut*)': dreptunghi2.cpp:55:10: error: expected unqualified-id before '[' token auto [h1,w1] = findMinDimensions(root->left); ^ dreptunghi2.cpp:56:10: error: expected unqualified-id before '[' token auto [h2,w2] = findMinDimensions(root->right); ^ dreptunghi2.cpp:59:36: error: 'h1' was not declared in this scope return {max(root->pos + 1, h1 + h2), max(w1, w2)}; ^ dreptunghi2.cpp:59:41: error: 'h2' was not declared in this scope return {max(root->pos + 1, h1 + h2), max(w1, w2)}; ^ dreptunghi2.cpp:59:50: error: 'w1' was not declared in this scope return {max(root->pos + 1, h1 + h2), max(w1, w2)}; ^ dreptunghi2.cpp:59:54: error: 'w2' was not declared in this scope return {max(root->pos + 1, h1 + h2), max(w1, w2)}; ^ dreptunghi2.cpp:59:57: error: could not convert '{<expression error>, <expression error>}' from '<brace-enclosed initializer list>' to 'std::pair<int, int>' return {max(root->pos + 1, h1 + h2), max(w1, w2)}; ^ dreptunghi2.cpp:61:21: error: 'h1' was not declared in this scope return {max(h1, h2), max(root->pos + 1, w1 + w2)}; ^ dreptunghi2.cpp:61:25: error: 'h2' was not declared in this scope return {max(h1, h2), max(root->pos + 1, w1 + w2)}; ^ dreptunghi2.cpp:61:49: error: 'w1' was not declared in this scope return {max(h1, h2), max(root->pos + 1, w1 + w2)}; ^ dreptunghi2.cpp:61:54: error: 'w2' was not declared in this scope return {max(h1, h2), max(root->pos + 1, w1 + w2)}; ^ dreptunghi2.cpp:61:57: error: could not convert '{<expression error>, <expression error>}' from '<brace-enclosed initializer list>' to 'std::pair<int, int>' return {max(h1, h2), max(root->pos + 1, w1 + w2)}; ^ dreptunghi2.cpp: In function 'int main()': dreptunghi2.cpp:99:14: error: expected unqualified-id before '[' token auto [n,m] = findMinDimensions(root); ^ dreptunghi2.cpp:100:17: error: 'n' was not declared in this scope cout << n << " " << m << "\n"; ^ dreptunghi2.cpp:100:29: error: 'm' was not declared in this scope cout << n << " " << m << "\n"; ^ dreptunghi2.cpp: In function 'std::pair<int, int> findMinDimensions(Cut*)': dreptunghi2.cpp:63:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Dreptunghi2 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ă.