#509
Să se scrie un program care ordonează crescător elementele unui vector.
| Problema | Ordonare | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64529087 | Utilizator | |
| Fișier | ordonare.cpp | Dimensiune | 1.49 KB |
| Data încărcării | 12 Mai 2026, 17:40 | Scor/rezultat | 100 puncte |
ordonare.cpp: In function ‘void heap_sort(std::vector<int>&, std::vector<int>&)’: ordonare.cpp:30:24: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 30 | for(int i = 0;i<a.size();++i) | ~^~~~~~~~~ ordonare.cpp:39:23: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 39 | if(st<sz && heap[st] < heap[mic]) | ^~ ordonare.cpp:41:26: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 41 | if(dr < sz && heap[dr] < heap[mic]) | ^~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | OK. | 60 | 60 | ||
| 3 | 0.001 secunde | OK. | 20 | 20 | ||
| Punctaj total | 100 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Ordonare 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ă.