#512
Se dă un vector cu n elemente, numere naturale distincte. Ordonați crescător elementele situate înaintea valorii maxime din vector și descrescător elementele situate după această valoare.
| Problema | SortMax | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64134402 | Utilizator | |
| Fișier | sortmax.cpp | Dimensiune | 575 B |
| Data încărcării | 19 Aprilie 2026, 21:03 | Scor/rezultat | 100 puncte |
sortmax.cpp: In function ‘int main()’: sortmax.cpp:19:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 19 | for(int a=1;a<=k;a++) | ^~~ sortmax.cpp:21:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 21 | cout<<ma<<' '; | ^~~~ sortmax.cpp:7:27: warning: unused variable ‘m’ [-Wunused-variable] 7 | int n,v[1001],r[1001],m[1001],k=0,x,p[1001],u=0,a,ma=0,c; | ^ sortmax.cpp:7:39: warning: unused variable ‘x’ [-Wunused-variable] 7 | int n,v[1001],r[1001],m[1001],k=0,x,p[1001],u=0,a,ma=0,c; | ^ sortmax.cpp:7:53: warning: unused variable ‘a’ [-Wunused-variable] 7 | int n,v[1001],r[1001],m[1001],k=0,x,p[1001],u=0,a,ma=0,c; | ^ sortmax.cpp:14:18: warning: ‘c’ may be used uninitialized [-Wmaybe-uninitialized] 14 | for(int a=1;a<c;a++) | ~^~ sortmax.cpp:7:60: note: ‘c’ was declared here 7 | int n,v[1001],r[1001],m[1001],k=0,x,p[1001],u=0,a,ma=0,c; | ^
| 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. | 40 | 40 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SortMax 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ă.