#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 | #64432098 | Utilizator | |
| Fișier | pozminmax.cpp | Dimensiune | 465 B |
| Data încărcării | 06 Mai 2026, 16:32 | Scor/rezultat | 100 puncte |
pozminmax.cpp: In function ‘int main()’: pozminmax.cpp:18:4: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 18 | for (i=1;i<=n;i++) | ^~~ pozminmax.cpp:21:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 21 | cout<<imin<<" "; | ^~~~ pozminmax.cpp:21:17: warning: ‘imin’ may be used uninitialized [-Wmaybe-uninitialized] 21 | cout<<imin<<" "; | ^~~ pozminmax.cpp:6:20: note: ‘imin’ was declared here 6 | int n,i,a[1000],imin,imax,minim,maxim; | ^~~~ pozminmax.cpp:25:10: warning: ‘imax’ may be used uninitialized [-Wmaybe-uninitialized] 25 | cout<<imax; | ^~~~ pozminmax.cpp:6:25: note: ‘imax’ was declared here 6 | int n,i,a[1000],imin,imax,minim,maxim; | ^~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | OK. | 40 | 40 | ||
| 3 | 0.001 secunde | OK. | 30 | 30 | ||
| 4 | 0.001 secunde | OK. | 10 | 10 | ||
| Punctaj total | 100 | |||||
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ă.