#659
SumaLinii1
Gigel a găsit o matrice cu n
linii și m
coloane și elemente numere naturale. El își propune să determine, pentru fiecare linie, cea mai mică valoare care se poate obține adunând elementele de pe linie, cu excepția unuia.
Problema | SumaLinii1 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50284207 | Utilizator | |
Fișier | sumalinii1.cpp | Dimensiune | 407 B |
Data încărcării | 03 Aprilie 2024, 12:13 | Scor / rezultat | Eroare de compilare |
sumalinii1.cpp: In function 'int main()': sumalinii1.cpp:8:5: error: reference to 'max' is ambiguous max=INT_MIN; ^ sumalinii1.cpp:3:25: note: candidates are: int max int a[101][101],i,j,n,m,max,s; ^ 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/ostream:38, from /usr/include/c++/4.8/iostream:39, from sumalinii1.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ sumalinii1.cpp:8:9: error: 'INT_MIN' was not declared in this scope max=INT_MIN; ^ sumalinii1.cpp:14:9: error: reference to 'max' is ambiguous max=INT_MIN; ^ sumalinii1.cpp:3:25: note: candidates are: int max int a[101][101],i,j,n,m,max,s; ^ 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/ostream:38, from /usr/include/c++/4.8/iostream:39, from sumalinii1.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ sumalinii1.cpp:16:23: error: reference to 'max' is ambiguous { if(a[i][j]>=max) ^ sumalinii1.cpp:3:25: note: candidates are: int max int a[101][101],i,j,n,m,max,s; ^ 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/ostream:38, from /usr/include/c++/4.8/iostream:39, from sumalinii1.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ sumalinii1.cpp:17:13: error: reference to 'max' is ambiguous max=a[i][j]; ^ sumalinii1.cpp:3:25: note: candidates are: int max int a[101][101],i,j,n,m,max,s; ^ 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/ostream:38, from /usr/include/c++/4.8/iostream:39, from sumalinii1.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ sumalinii1.cpp:19:14: error: reference to 'max' is ambiguous cout<<s-max<<" ";} ^ sumalinii1.cpp:3:25: note: candidates are: int max int a[101][101],i,j,n,m,max,s; ^ 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/ostream:38, from /usr/include/c++/4.8/iostream:39, from sumalinii1.cpp:1: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ sumalinii1.cpp:20:5: error: 'retutn' was not declared in this scope retutn 0;} ^ sumalinii1.cpp:20:12: error: expected ';' before numeric constant retutn 0;} ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SumaLinii1 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ă.