#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 | #60667653 | Utilizator | |
| Fișier | perfecta.cpp | Dimensiune | 3.40 KB |
| Data încărcării | 07 Noiembrie 2025, 21:12 | Scor/rezultat | Eroare de compilare |
perfecta.cpp: In function 'int main()': perfecta.cpp:49:19: error: 'cur' was not declared in this scope (long long) **cur = new (long long)*[1001]; ^ perfecta.cpp:49:42: error: expected identifier before numeric constant (long long) **cur = new (long long)*[1001]; ^ perfecta.cpp: In lambda function: perfecta.cpp:49:47: error: expected '{' before ';' token (long long) **cur = new (long long)*[1001]; ^ perfecta.cpp: In function 'int main()': perfecta.cpp:49:40: error: no match for 'operator*' (operand types are 'long long int*' and 'main()::__lambda5') (long long) **cur = new (long long)*[1001]; ^ perfecta.cpp:49:40: note: candidates are: In file included from /usr/include/c++/4.8/ccomplex:38:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from perfecta.cpp:1: /usr/include/c++/4.8/complex:384:5: note: template<class _Tp> std::complex<_Tp> std::operator*(const std::complex<_Tp>&, const std::complex<_Tp>&) operator*(const complex<_Tp>& __x, const complex<_Tp>& __y) ^ /usr/include/c++/4.8/complex:384:5: note: template argument deduction/substitution failed: perfecta.cpp:49:47: note: mismatched types 'const std::complex<_Tp>' and 'long long int*' (long long) **cur = new (long long)*[1001]; ^ In file included from /usr/include/c++/4.8/ccomplex:38:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from perfecta.cpp:1: /usr/include/c++/4.8/complex:393:5: note: template<class _Tp> std::complex<_Tp> std::operator*(const std::complex<_Tp>&, const _Tp&) operator*(const complex<_Tp>& __x, const _Tp& __y) ^ /usr/include/c++/4.8/complex:393:5: note: template argument deduction/substitution failed: perfecta.cpp:49:47: note: mismatched types 'const std::complex<_Tp>' and 'long long int*' (long long) **cur = new (long long)*[1001]; ^ In file included from /usr/include/c++/4.8/ccomplex:38:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from perfecta.cpp:1: /usr/include/c++/4.8/complex:402:5: note: template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const std::complex<_Tp>&) operator*(const _Tp& __x, const complex<_Tp>& __y) ^ /usr/include/c++/4.8/complex:402:5: note: template argument deduction/substitution failed: perfecta.cpp:49:47: note: 'main()::__lambda5' is not derived from 'const std::complex<_Tp>' (long long) **cur = new (long long)*[1001]; ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from perfecta.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template<class _Dom1, class _Dom2> std::_Expr<std::_BinClos<std::__multiplies, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(*, __multiplies) ^ /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template argument deduction/substitution failed: perfecta.cpp:49:47: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'long long int*' (long long) **cur = new (long long)*[1001]; ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from perfecta.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__multiplies, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&) _DEFINE_EXPR_BINARY_OPERATOR(*, __multiplies) ^ /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template argument deduction/substitution failed: perfecta.cpp:49:47: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'long long int*' (long long) **cur = new (long long)*[1001]; ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from perfecta.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__multiplies, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(*, __multiplies) ^ /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template argument deduction/substitution failed: perfecta.cpp:49:47: note: 'main()::__lambda5' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' (long long) **cur = new (long long)*[1001]; ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from perfecta.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__multiplies, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _Dom::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(*, __multiplies) ^ /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template argument deduction/substitution failed: perfecta.cpp:49:47: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'long long int*' (long long) **cur = new (long long)*[1001]; ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from perfecta.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__multiplies, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const std::valarray<typename _Dom::value_type>&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(*, __multiplies) ^ /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template argument deduction/substitution failed: perfecta.cpp:49:47: note: mismatched types 'const std::valarray<typename _Dom::value_type>' and 'long long int*' (long long) **cur = new (long long)*[1001]; ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0, from perfecta.cpp:1: /usr/include/c++/4.8/valarray:1169:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__multiplies, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const std::valarray<_Tp>&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(*, __multiplies) ^ /usr/include/c++/4.8/valarray:1169:1: note: template argument deduction/substitution failed: perfecta.cpp:49:47: note: mismatched types 'const std::valarray<_Tp>' and 'long long int*' (long long) **cur = new (long long)*[1001]; ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0, from perfecta.cpp:1: /usr/include/c++/4.8/valarray:1169:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__multiplies, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const std::valarray<_Tp>&, const _Tp&) _DEFINE_BINARY_OPERATOR(*, __multiplies) ^ /usr/include/c++/4.8/valarray:1169:1: note: template argument deduction/substitution failed: perfecta.cpp:49:47: note: mismatched types 'const std::valarray<_Tp>' and 'long long int*' (long long) **cur = new (long long)*[1001]; ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0, from perfecta.cpp:1: /usr/include/c++/4.8/valarray:1169:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__multiplies, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const _Tp&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(*, __multiplies) ^ /usr/include/c++/4.8/valarray:1169:1: note: template argument deduction/substitution failed: perfecta.cpp:49:47: note: 'main()::__lambda5' is not derived from 'const std::valarray<_Tp>' (long long) **cur = new (long long)*[1001]; ^ perfecta.cpp:51:33: error: array bound forbidden after parenthesized type-id cur[i] = new (long long)[51]; ^ perfecta.cpp:51:33: note: try removing the parentheses around the type-id perfecta.cpp:56:19: error: 'nxt' was not declared in this scope (long long) **nxt = new (long long)*[1001]; ^ perfecta.cpp:56:42: error: expected identifier before numeric constant (long long) **nxt = new (long long)*[1001]; ^ perfecta.cpp: In lambda function: perfecta.cpp:56:47: error: expected '{' before ';' token (long long) **nxt = new (long long)*[1001]; ^ perfecta.cpp: In function 'int main()': perfecta.cpp:56:40: error: no match for 'operator*' (operand types are 'long long int*' and 'main()::__lambda6') (long long) **nxt = new (long long)*[1001]; ^ perfecta.cpp:56:40: note: candidates are: In file included from /usr/include/c++/4.8/ccomplex:38:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from perfecta.cpp:1: /usr/include/c++/4.8/complex:384:5: note: template<class _Tp> std::complex<_Tp> std::operator*(const std::complex<_Tp>&, const std::complex<_Tp>&) operator*(const complex<_Tp>& __x, const complex<_Tp>& __y) ^ /usr/include/c++/4.8/complex:384:5: note: template argument deduction/substitution failed: perfecta.cpp:56:47: note: mismatched types 'const std::complex<_Tp>' and 'long long int*' (long long) **nxt = new (long long)*[1001]; ^ In file included from /usr/include/c++/4.8/ccomplex:38:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from perfecta.cpp:1: /usr/include/c++/4.8/complex:393:5: note: template<class _Tp> std::complex<_Tp> std::operator*(const std::complex<_Tp>&, const _Tp&) operator*(const complex<_Tp>& __x, const _Tp& __y) ^ /usr/include/c++/4.8/complex:393:5: note: template argument deduction/substitution failed: perfecta.cpp:56:47: note: mismatched types 'const std::complex<_Tp>' and 'long long int*' (long long) **nxt = new (long long)*[1001]; ^ In file included from /usr/include/c++/4.8/ccomplex:38:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from perfecta.cpp:1: /usr/include/c++/4.8/complex:402:5: note: template<class _Tp> std::complex<_Tp> std::operator*(const _Tp&, const std::complex<_Tp>&) operator*(const _Tp& __x, const complex<_Tp>& __y) ^ /usr/include/c++/4.8/complex:402:5: note: template argument deduction/substitution failed: perfecta.cpp:56:47: note: 'main()::__lambda6' is not derived from 'const std::complex<_Tp>' (long long) **nxt = new (long long)*[1001]; ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from perfecta.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template<class _Dom1, class _Dom2> std::_Expr<std::_BinClos<std::__multiplies, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::_Expr<_Dom2, typename _Dom2::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(*, __multiplies) ^ /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template argument deduction/substitution failed: perfecta.cpp:56:47: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'long long int*' (long long) **nxt = new (long long)*[1001]; ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from perfecta.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__multiplies, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&) _DEFINE_EXPR_BINARY_OPERATOR(*, __multiplies) ^ /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template argument deduction/substitution failed: perfecta.cpp:56:47: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'long long int*' (long long) **nxt = new (long long)*[1001]; ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from perfecta.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__multiplies, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const typename _Dom::value_type&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(*, __multiplies) ^ /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template argument deduction/substitution failed: perfecta.cpp:56:47: note: 'main()::__lambda6' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>' (long long) **nxt = new (long long)*[1001]; ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from perfecta.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__multiplies, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const std::_Expr<_Dom1, typename _Dom1::value_type>&, const std::valarray<typename _Dom::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(*, __multiplies) ^ /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template argument deduction/substitution failed: perfecta.cpp:56:47: note: mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'long long int*' (long long) **nxt = new (long long)*[1001]; ^ In file included from /usr/include/c++/4.8/valarray:587:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94, from perfecta.cpp:1: /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template<class _Dom> std::_Expr<std::_BinClos<std::__multiplies, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__multiplies, typename _Dom1::value_type>::result_type> std::operator*(const std::valarray<typename _Dom::value_type>&, const std::_Expr<_Dom1, typename _Dom1::value_type>&) _DEFINE_EXPR_BINARY_OPERATOR(*, __multiplies) ^ /usr/include/c++/4.8/bits/valarray_after.h:404:5: note: template argument deduction/substitution failed: perfecta.cpp:56:47: note: mismatched types 'const std::valarray<typename _Dom::value_type>' and 'long long int*' (long long) **nxt = new (long long)*[1001]; ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0, from perfecta.cpp:1: /usr/include/c++/4.8/valarray:1169:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__multiplies, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const std::valarray<_Tp>&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(*, __multiplies) ^ /usr/include/c++/4.8/valarray:1169:1: note: template argument deduction/substitution failed: perfecta.cpp:56:47: note: mismatched types 'const std::valarray<_Tp>' and 'long long int*' (long long) **nxt = new (long long)*[1001]; ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0, from perfecta.cpp:1: /usr/include/c++/4.8/valarray:1169:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__multiplies, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const std::valarray<_Tp>&, const _Tp&) _DEFINE_BINARY_OPERATOR(*, __multiplies) ^ /usr/include/c++/4.8/valarray:1169:1: note: template argument deduction/substitution failed: perfecta.cpp:56:47: note: mismatched types 'const std::valarray<_Tp>' and 'long long int*' (long long) **nxt = new (long long)*[1001]; ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:94:0, from perfecta.cpp:1: /usr/include/c++/4.8/valarray:1169:1: note: template<class _Tp> std::_Expr<std::_BinClos<std::__multiplies, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__multiplies, _Tp>::result_type> std::operator*(const _Tp&, const std::valarray<_Tp>&) _DEFINE_BINARY_OPERATOR(*, __multiplies) ^ /usr/include/c++/4.8/valarray:1169:1: note: template argument deduction/substitution failed: perfecta.cpp:56:47: note: 'main()::__lambda6' is not derived from 'const std::valarray<_Tp>' (long long) **nxt = new (long long)*[1001]; ^ perfecta.cpp:58:33: error: array bound forbidden after parenthesized type-id nxt[i] = new (long long)[51]; ^ perfecta.cpp:58:33: note: try removing the parentheses around the type-id
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ă.