#551
Elevi
La liceul nostru sunt m
clase, fiecare având n
elevi. Pentru fiecare elev se cunoaşte talentul artistic, exprimat printr-un număr natural. Să se determine cea mai mare valoare pe care o are talentul artistic al elevilor, notată cu MAX
şi numărul CNT
de clase din liceu în care există elevi care au talent maxim.
Problema | Elevi | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54254312 | Utilizator | |
Fișier | elevi.cpp | Dimensiune | 508 B |
Data încărcării | 23 Noiembrie 2024, 16:18 | Scor / rezultat | Eroare de compilare |
elevi.cpp: In function 'int main()': elevi.cpp:6:10: error: 'k' was not declared in this scope for (k = 1; k <= m; ++k) { ^ elevi.cpp:7:14: error: 'i' was not declared in this scope for (i = 0; i < n; i++) ^ elevi.cpp:10:14: error: 'i' was not declared in this scope for (i = 0; i < n; i++) ^ elevi.cpp:13:20: error: reference to 'max' is ambiguous if (cmax > max) { ^ elevi.cpp:3:20: note: candidates are: int max int n, m, v[1001], max = -1, c = 0,cmax; ^ 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 elevi.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) ^ elevi.cpp:14:13: error: reference to 'max' is ambiguous max = cmax; ^ elevi.cpp:3:20: note: candidates are: int max int n, m, v[1001], max = -1, c = 0,cmax; ^ 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 elevi.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) ^ elevi.cpp:16:28: error: reference to 'max' is ambiguous } else if (cmax == max) ^ elevi.cpp:3:20: note: candidates are: int max int n, m, v[1001], max = -1, c = 0,cmax; ^ 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 elevi.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) ^ elevi.cpp:18:15: error: reference to 'max' is ambiguous } cout << max << " " << c; ^ elevi.cpp:3:20: note: candidates are: int max int n, m, v[1001], max = -1, c = 0,cmax; ^ 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 elevi.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) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Elevi 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ă.