#1408
Se dau n numere naturale. Calculați câte dintre ele sunt prime, cel mai mare și cel mai mic număr prim.
| Problema | Numere10 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64452194 | Utilizator | |
| Fișier | numere10.cpp | Dimensiune | 491 B |
| Data încărcării | 07 Mai 2026, 16:48 | Scor/rezultat | Eroare de compilare |
numere10.cpp: In function ‘int main()’: numere10.cpp:20:12: error: reference to ‘min’ is ambiguous 20 | if(min==-1 || x<min) | ^~~ In file included from /usr/include/c++/13/string:51, from /usr/include/c++/13/bits/locale_classes.h:40, from /usr/include/c++/13/bits/ios_base.h:41, from /usr/include/c++/13/ios:44, from /usr/include/c++/13/ostream:40, from /usr/include/c++/13/iostream:41, from numere10.cpp:1: /usr/include/c++/13/bits/stl_algobase.h:281:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’ 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:233:5: note: ‘template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)’ 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ numere10.cpp:4:15: note: ‘int min’ 4 | int n,x,cnt=0,min=-1,max=-1; | ^~~ numere10.cpp:20:25: error: reference to ‘min’ is ambiguous 20 | if(min==-1 || x<min) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:281:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’ 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:233:5: note: ‘template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)’ 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ numere10.cpp:4:15: note: ‘int min’ 4 | int n,x,cnt=0,min=-1,max=-1; | ^~~ numere10.cpp:21:13: error: reference to ‘min’ is ambiguous 21 | min=x; | ^~~ /usr/include/c++/13/bits/stl_algobase.h:281:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’ 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:233:5: note: ‘template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)’ 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ numere10.cpp:4:15: note: ‘int min’ 4 | int n,x,cnt=0,min=-1,max=-1; | ^~~ numere10.cpp:22:14: error: reference to ‘max’ is ambiguous 22 | if(x>max) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’ 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:257:5: note: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’ 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ numere10.cpp:4:22: note: ‘int max’ 4 | int n,x,cnt=0,min=-1,max=-1; | ^~~ numere10.cpp:23:13: error: reference to ‘max’ is ambiguous 23 | max=x;} | ^~~ /usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’ 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:257:5: note: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’ 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ numere10.cpp:4:22: note: ‘int max’ 4 | int n,x,cnt=0,min=-1,max=-1; | ^~~ numere10.cpp:26:21: error: reference to ‘min’ is ambiguous 26 | cout<<cnt<<" "<<min<<" "<<max; | ^~~ /usr/include/c++/13/bits/stl_algobase.h:281:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’ 281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:233:5: note: ‘template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)’ 233 | min(const _Tp& __a, const _Tp& __b) | ^~~ numere10.cpp:4:15: note: ‘int min’ 4 | int n,x,cnt=0,min=-1,max=-1; | ^~~ numere10.cpp:26:31: error: reference to ‘max’ is ambiguous 26 | cout<<cnt<<" "<<min<<" "<<max; | ^~~ /usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidates are: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’ 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/13/bits/stl_algobase.h:257:5: note: ‘template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)’ 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ numere10.cpp:4:22: note: ‘int max’ 4 | int n,x,cnt=0,min=-1,max=-1; | ^~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Numere10 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ă.