#3724
Dreptunghi2
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 | tastatură/ecran |
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 256 MB
/
Stivă 8 MB
|
Id soluție | #40497892 | Utilizator | |
Fișier | dreptunghi2.cpp | Dimensiune | 1.93 KB |
Data încărcării | 10 Decembrie 2022, 22:04 | Scor / rezultat | Eroare de compilare |
dreptunghi2.cpp: In lambda function: dreptunghi2.cpp:16:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (i == C.size()) { ^ dreptunghi2.cpp:38:14: error: use of 'is_valid_code_recursive' before deduction of 'auto' return is_valid_code_recursive(k, M) && is_valid_code_recursive(N - k, M); ^ dreptunghi2.cpp:38:14: error: use of 'is_valid_code(const string&, int, int)::__lambda0::__is_valid_code_recursive' before deduction of 'auto' dreptunghi2.cpp:38:14: error: use of 'is_valid_code_recursive' before deduction of 'auto' dreptunghi2.cpp:38:47: error: use of 'is_valid_code_recursive' before deduction of 'auto' return is_valid_code_recursive(k, M) && is_valid_code_recursive(N - k, M); ^ dreptunghi2.cpp:46:11: warning: unused variable 'k' [-Wunused-variable] int k = C[i] - '0'; ^ dreptunghi2.cpp:47:10: error: expected '}' at end of input ++i; ^ dreptunghi2.cpp:47:10: error: expected '}' at end of input dreptunghi2.cpp: In function 'bool is_valid_code(const string&, int, int)': dreptunghi2.cpp:13:34: error: use of 'is_valid_code_recursive' before deduction of 'auto' auto is_valid_code_recursive = [&](int N, int M) -> bool { ^ dreptunghi2.cpp:47:10: error: expected ',' or ';' at end of input ++i; ^ dreptunghi2.cpp:47:10: error: expected '}' at end of input dreptunghi2.cpp:47:10: warning: no return statement in function returning non-void [-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ă.