#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 | #64297454 | Utilizator | |
| Fișier | ksort.cpp | Dimensiune | 631 B |
| Data încărcării | 28 Aprilie 2026, 14:24 | Scor/rezultat | 0 puncte |
ksort.cpp: In function ‘int main()’: ksort.cpp:9:1: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 9 | for(i=1;i<=n;i++) | ^~~ ksort.cpp:11:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 11 | do | ^~ ksort.cpp:21:16: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 21 | } while (sortat=false); | ~~~~~~^~~~~~ ksort.cpp:32:16: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 32 | } while(aranjat=false); | ~~~~~~~^~~~~~ ksort.cpp:33:1: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 33 | for(i=1;i<=n;i++) | ^~~ ksort.cpp:36:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 36 | return 0; | ^~~~~~
| 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ă.