#511
Se dă un vector cu n elemente, numere naturale și un număr k. Ordonați crescător primele k elemente ale vectorului și descrescător ultimele n-k elemente.
| Problema | KSort | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64285402 | Utilizator | |
| Fișier | ksort.cpp | Dimensiune | 744 B |
| Data încărcării | 28 Aprilie 2026, 08:42 | Scor/rezultat | 0 puncte |
ksort.cpp: In function ‘void crescator()’: ksort.cpp:14:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 14 | for(i=2;i<=k;i++); | ^~~ ksort.cpp:15:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 15 | { | ^ ksort.cpp: In function ‘void descrescator()’: ksort.cpp:29:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 29 | for(i=k+1;i<n;i++); | ^~~ ksort.cpp:30:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 30 | for(j=1+1;j<=n;j++) | ^~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
| 2 | 0.001 secunde | Raspuns gresit. | 40 | 0 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 40 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema KSort 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ă.