#3263
SumMax_XI
Se dă o matrice pătratică cu n
lini şi n
coloane şi elemente numere întregi. Determinaţi cea mai mare sumă a n
elemente din matrice, adunând câte un element de pe fiecare linie a matricei.
Problema | SumMax_XI | Operații I/O |
summax_xi.in /summax_xi.out
|
---|---|---|---|
Limita timp | 0.75 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53000871 | Utilizator | |
Fișier | summax_xi.cpp | Dimensiune | 343 B |
Data încărcării | 15 Octombrie 2024, 11:26 | Scor / rezultat | Eroare de compilare |
summax_xi.cpp:3:12: warning: missing terminating " character [enabled by default] ifstream f("summax_xi.in); ^ summax_xi.cpp:3:1: error: missing terminating " character ifstream f("summax_xi.in); ^ summax_xi.cpp:4:12: warning: missing terminating " character [enabled by default] ofstream g("summax_xi.out); ^ summax_xi.cpp:4:1: error: missing terminating " character ofstream g("summax_xi.out); ^ summax_xi.cpp:6:1: error: expected ')' before '{' token { ^ summax_xi.cpp:6:1: error: expected ')' before '{' token summax_xi.cpp: In function 'std::ifstream f(std::ofstream (*)(int (*)()))': summax_xi.cpp:8:8: error: invalid operands of types 'std::ifstream(std::ofstream (*)(int (*)())) {aka std::basic_ifstream<char>(std::basic_ofstream<char> (*)(int (*)()))}' and 'int' to binary 'operator>>' f>>n; ^ summax_xi.cpp:12:25: error: invalid operands of types 'std::ifstream(std::ofstream (*)(int (*)())) {aka std::basic_ifstream<char>(std::basic_ofstream<char> (*)(int (*)()))}' and 'int' to binary 'operator>>' f>>mat[i][j]; ^ summax_xi.cpp:13:24: error: no matching function for call to 'sort(int, int (*)[102])' sort (1,mat+n+1); ^ summax_xi.cpp:13:24: note: candidates are: 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 summax_xi.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:5447:5: note: template<class _RAIter> void std::sort(_RAIter, _RAIter) sort(_RandomAccessIterator __first, _RandomAccessIterator __last) ^ /usr/include/c++/4.8/bits/stl_algo.h:5447:5: note: template argument deduction/substitution failed: summax_xi.cpp:13:24: note: deduced conflicting types for parameter '_RAIter' ('int' and 'int (*)[102]') sort (1,mat+n+1); ^ 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 summax_xi.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h:5483:5: note: template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare) sort(_RandomAccessIterator __first, _RandomAccessIterator __last, ^ /usr/include/c++/4.8/bits/stl_algo.h:5483:5: note: template argument deduction/substitution failed: summax_xi.cpp:13:24: note: deduced conflicting types for parameter '_RAIter' ('int' and 'int (*)[102]') sort (1,mat+n+1); ^ summax_xi.cpp:16:8: error: invalid operands of types 'std::ofstream (*)(int (*)()) {aka std::basic_ofstream<char> (*)(int (*)())}' and 'int' to binary 'operator<<' g<<s; ^ summax_xi.cpp:17:8: error: could not convert '0' from 'int' to 'std::ifstream {aka std::basic_ifstream<char>}' return 0; ^ summax_xi.cpp:18:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SumMax_XI 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ă.