#4850
O matrice cu n linii şi m coloane se completează aleatoriu cu numerele \( 2^{1}, 2^{2},…, 2^{n\cdot m}\), fiecare număr fiind folosit o singură dată. Matricea se numeşte perfecta dacă produsul elementelor pe fiecare linie şi fiecare coloană este pătrat perfect. Să se afle câte matrice perfecte se pot forma.
***
| Problema | Perfecta | Operații I/O |
perfecta.in/perfecta.out
|
|---|---|---|---|
| Limita timp | 0.75 secunde | Limita memorie |
Total: 256 MB
/
Stivă 8 MB
|
| Id soluție | #59113395 | Utilizator | |
| Fișier | perfecta.cpp | Dimensiune | 1.50 KB |
| Data încărcării | 17 Septembrie 2025, 23:09 | Scor/rezultat | Eroare de compilare |
perfecta.cpp: In function 'int solve(int, int)': perfecta.cpp:27:17: error: converting to 'std::map<std::tuple<int, int, int>, long long int>::key_type {aka std::tuple<int, int, int>}' from initializer list would use explicit constructor 'constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {int, int, int}; <template-parameter-2-2> = void; _Elements = {int, int, int}]' dp[{0, 0, 0}] = 1; ^ perfecta.cpp:32:18: error: expected unqualified-id before '[' token auto [r, mask, used] = entry.first; ^ perfecta.cpp:35:17: error: 'r' was not declared in this scope if (r != row) continue; ^ perfecta.cpp:40:36: error: 'mask' was not declared in this scope int new_mask = mask ^ config; ^ perfecta.cpp:41:36: error: 'used' was not declared in this scope int new_used = used + cnt; ^ perfecta.cpp:44:59: error: converting to 'std::map<std::tuple<int, int, int>, long long int>::key_type {aka std::tuple<int, int, int>}' from initializer list would use explicit constructor 'constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {int, int&, int&}; <template-parameter-2-2> = void; _Elements = {int, int, int}]' new_dp[{row+1, new_mask, new_used}] += ways; ^ perfecta.cpp:52:24: error: converting to 'std::map<std::tuple<int, int, int>, long long int>::key_type {aka std::tuple<int, int, int>}' from initializer list would use explicit constructor 'constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {int&, int, int&}; <template-parameter-2-2> = void; _Elements = {int, int, int}]' return dp[{n, 0, p}] % MOD * factorial(p, MOD) % MOD * factorial(q, MOD) % MOD; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Perfecta 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ă.