#4645
matrix
Costin are o matrice pătratică A
cu N
linii (numerotate de sus în jos de la 1
la N
) și N
coloane (numerotate de la stânga la dreapta de la 1
la N
). Inițial toate elementele matricei sunt egale cu 0
. Scrieți un program care, cunoscând N
, precum și o succesiune de M
operații, afișează matricea rezultată în urma efectuării în ordine a operațiilor din succesiune.
CNER CODE clasa a IX-a
Problema | matrix | Operații I/O |
matrix.in /matrix.out
|
---|---|---|---|
Limita timp | 0.7 secunde | Limita memorie |
Total: 256 MB
/
Stivă 8 MB
|
Id soluție | #50513321 | Utilizator | |
Fișier | matrix.cpp | Dimensiune | 2.84 KB |
Data încărcării | 12 Aprilie 2024, 11:28 | Scor / rezultat | Eroare de compilare |
matrix.cpp: In function 'int32_t main()': matrix.cpp:64:42: error: redeclaration of 'long long int y33' int x44 = L.get(x2, y1), y33 = C.get(x2, y1); ^ matrix.cpp:63:42: error: 'long long int y33' previously declared here int x33 = L.get(x1, y2), y33 = C.get(x1, y2); ^ matrix.cpp:69:48: error: 'y44' was not declared in this scope int ymin = min({y11, y22, y33, y44}); ^ matrix.cpp:69:52: error: no matching function for call to 'min(<brace-enclosed initializer list>)' int ymin = min({y11, y22, y33, y44}); ^ matrix.cpp:69:52: note: candidates are: In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from matrix.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&) min(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/4.8/bits/stl_algobase.h:193:5: note: template argument deduction/substitution failed: matrix.cpp:69:52: note: candidate expects 2 arguments, 1 provided int ymin = min({y11, y22, y33, y44}); ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/istream:38, from /usr/include/c++/4.8/sstream:38, from /usr/include/c++/4.8/complex:45, from /usr/include/c++/4.8/ccomplex:38, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:52, from matrix.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare) min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:239:5: note: template argument deduction/substitution failed: matrix.cpp:69:52: note: candidate expects 3 arguments, 1 provided int ymin = min({y11, y22, y33, y44}); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64, from matrix.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:4221:5: note: template<class _Tp> _Tp std::min(std::initializer_list<_Tp>) min(initializer_list<_Tp> __l) ^ /usr/include/c++/4.8/bits/stl_algo.h:4221:5: note: template argument deduction/substitution failed: /usr/include/c++/4.8/bits/stl_algo.h:4226:5: note: template<class _Tp, class _Compare> _Tp std::min(std::initializer_list<_Tp>, _Compare) min(initializer_list<_Tp> __l, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algo.h:4226:5: note: template argument deduction/substitution failed: matrix.cpp:70: confused by earlier errors, bailing out Preprocessed source stored into /tmp/ccKK9Y5Z.out file, please attach this to your bugreport.
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema matrix 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ă.