#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 | #64812767 | Utilizator | |
| Fișier | sortmax.cpp | Dimensiune | 900 B |
| Data încărcării | 02 Iunie 2026, 23:13 | Scor/rezultat | Eroare de compilare |
sortmax.cpp: In function ‘int main()’: sortmax.cpp:11:17: error: invalid types ‘int[int]’ for array subscript 11 | cin >> v[i]; | ^ sortmax.cpp:16:14: error: invalid types ‘int[int]’ for array subscript 16 | if (v[i] > v[poz_max]) { | ^ sortmax.cpp:16:21: error: invalid types ‘int[int]’ for array subscript 16 | if (v[i] > v[poz_max]) { | ^ sortmax.cpp:23:18: error: invalid types ‘int[int]’ for array subscript 23 | if (v[i] > v[j]) { | ^ sortmax.cpp:23:25: error: invalid types ‘int[int]’ for array subscript 23 | if (v[i] > v[j]) { | ^ sortmax.cpp:24:28: error: invalid types ‘int[int]’ for array subscript 24 | int aux = v[i]; | ^ sortmax.cpp:25:18: error: invalid types ‘int[int]’ for array subscript 25 | v[i] = v[j]; | ^ sortmax.cpp:25:25: error: invalid types ‘int[int]’ for array subscript 25 | v[i] = v[j]; | ^ sortmax.cpp:26:18: error: invalid types ‘int[int]’ for array subscript 26 | v[j] = aux; | ^ sortmax.cpp:33:18: error: invalid types ‘int[int]’ for array subscript 33 | if (v[i] < v[j]) { | ^ sortmax.cpp:33:25: error: invalid types ‘int[int]’ for array subscript 33 | if (v[i] < v[j]) { | ^ sortmax.cpp:34:28: error: invalid types ‘int[int]’ for array subscript 34 | int aux = v[i]; | ^ sortmax.cpp:35:18: error: invalid types ‘int[int]’ for array subscript 35 | v[i] = v[j]; | ^ sortmax.cpp:35:25: error: invalid types ‘int[int]’ for array subscript 35 | v[i] = v[j]; | ^ sortmax.cpp:36:18: error: invalid types ‘int[int]’ for array subscript 36 | v[j] = aux; | ^ sortmax.cpp:42:18: error: invalid types ‘int[int]’ for array subscript 42 | cout << v[i] << " "; | ^
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ă.