#180
Să se ordoneze crescător elementele dintr-un şir dat cuprinse între elementul de valoare maximă şi cel de valoare minimă.
| Problema | sortMinMax | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64867672 | Utilizator | |
| Fișier | sortminmax.cpp | Dimensiune | 388 B |
| Data încărcării | 08 Iunie 2026, 14:47 | Scor/rezultat | 100 puncte |
sortminmax.cpp: In function ‘int main()’: sortminmax.cpp:16:1: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 16 | for(i=1;i<=n;i++) | ^~~ sortminmax.cpp:18:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 18 | return 0; | ^~~~~~ sortminmax.cpp:13:1: warning: ‘pmax’ may be used uninitialized [-Wmaybe-uninitialized] 13 | if(pmin>pmax) swap(pmin,pmax); | ^~ sortminmax.cpp:6:32: note: ‘pmax’ was declared here 6 | int n,v[1001],Min=99999,Max=-1,pmax,pmin,i,j; | ^~~~ sortminmax.cpp:13:1: warning: ‘pmin’ may be used uninitialized [-Wmaybe-uninitialized] 13 | if(pmin>pmax) swap(pmin,pmax); | ^~ sortminmax.cpp:6:37: note: ‘pmin’ was declared here 6 | int n,v[1001],Min=99999,Max=-1,pmax,pmin,i,j; | ^~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.003 secunde | OK. | 20 | 20 | ||
| 2 | 0.003 secunde | OK. | 40 | 40 | ||
| 3 | 0.004 secunde | OK. | 40 | 40 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema sortMinMax 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ă.