#553
Să se determine indicele maximului şi cel al minimului valorilor elementelor unui vector.
| Problema | PozMinMax | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64102687 | Utilizator | |
| Fișier | pozminmax.cpp | Dimensiune | 447 B |
| Data încărcării | 17 Aprilie 2026, 08:46 | Scor/rezultat | 0 puncte |
pozminmax.cpp: In function ‘int main()’: pozminmax.cpp:9:10: warning: overflow in conversion from ‘long int’ to ‘int’ changes value from ‘1000000000000001’ to ‘-1530494975’ [-Woverflow] 9 | mini=1000000000000001; | ^~~~~~~~~~~~~~~~ pozminmax.cpp:26:17: warning: ‘imin’ may be used uninitialized [-Wmaybe-uninitialized] 26 | cout<<imin<<" "<<imax; | ^~~ pozminmax.cpp:7:29: note: ‘imin’ was declared here 7 | int n,v[1001],mini,maxi,imin,imax; | ^~~~ pozminmax.cpp:26:22: warning: ‘imax’ may be used uninitialized [-Wmaybe-uninitialized] 26 | cout<<imin<<" "<<imax; | ^~~~ pozminmax.cpp:7:34: note: ‘imax’ was declared here 7 | int n,v[1001],mini,maxi,imin,imax; | ^~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.001 secunde | Raspuns gresit. | 40 | 0 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 30 | 0 | ||
| 4 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PozMinMax 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ă.