#3701
Fie o matrice A de dimensiuni 2N x 2N date. Aceasta se construiește astfel:
Se pornește de la o matrice de dimensiune 2 x 2 având ca elemente litere mici ale alfabetului englez. Matricea B de dimensiune 2k x 2k se formează din patru submatrice de dimensiune 2k-1 x 2k-1 și se obține din matricea C de dimensiune 2k-1 x 2k-1. Se dau Q triplete (i, j, L), cu semnificația: pe poziția A[i][j] se află litera L. Care este numărul maxim de triplete care se pot selecta astfel încât toate să fie adevărate?
Concursul Național Info Pro, Etapa IV
| Problema | expandmat | Operații I/O |
expandmat.in/expandmat.out
|
|---|---|---|---|
| Limita timp | 0.2 secunde | Limita memorie |
Total: 256 MB
/
Stivă 8 MB
|
| Id soluție | #58706407 | Utilizator | |
| Fișier | expandmat.cpp | Dimensiune | 2.82 KB |
| Data încărcării | 21 Iulie 2025, 22:47 | Scor/rezultat | Eroare de compilare |
expandmat.cpp: In function 'int main()': expandmat.cpp:78:34: error: expected unqualified-id before '[' token for (auto const& [key, val] : counts[row][col]) { ^ expandmat.cpp:78:34: error: expected ';' before '[' token expandmat.cpp:78:35: error: 'key' was not declared in this scope for (auto const& [key, val] : counts[row][col]) { ^ expandmat.cpp:78:40: error: 'val' was not declared in this scope for (auto const& [key, val] : counts[row][col]) { ^ expandmat.cpp: In lambda function: expandmat.cpp:78:45: error: expected '{' before ':' token for (auto const& [key, val] : counts[row][col]) { ^ expandmat.cpp: In function 'int main()': expandmat.cpp:78:45: error: expected ';' before ':' token expandmat.cpp:78:45: error: expected primary-expression before ':' token expandmat.cpp:78:45: error: expected ')' before ':' token expandmat.cpp:78:45: error: expected primary-expression before ':' token expandmat.cpp:78:45: error: expected ';' before ':' token expandmat.cpp:94:1: error: expected '}' at end of input } ^ expandmat.cpp:94:1: error: expected '}' at end of input expandmat.cpp:75:17: warning: unused variable 'max_for_this_cell' [-Wunused-variable] int max_for_this_cell = 0; ^ expandmat.cpp:94:1: error: expected '}' at end of input } ^ expandmat.cpp:69:15: warning: unused variable 'max_triplets' [-Wunused-variable] long long max_triplets = 0; ^ expandmat.cpp:94:1: error: expected '}' at end of input } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema expandmat 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ă.