#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 |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54823628 | Utilizator | |
Fișier | ksort.cpp | Dimensiune | 8.41 KB |
Data încărcării | 09 Decembrie 2024, 18:08 | Scor / rezultat | Eroare de compilare |
ksort.cpp: In function 'int main()': ksort.cpp:6:24: warning: unused variable 'j' [-Wunused-variable] int n, V[1001], i, j, p, b, k; ^ ksort.cpp: In function 'int main()': ksort.cpp:45:5: error: redefinition of 'int main()' int main() ^ ksort.cpp:4:5: error: 'int main()' previously defined here int main() ^ ksort.cpp:47:24: warning: unused variable 'j' [-Wunused-variable] int n, V[1001], i, j, p, b, k; ^ ksort.cpp: In function 'int main()': ksort.cpp:86:5: error: redefinition of 'int main()' int main() ^ ksort.cpp:4:5: error: 'int main()' previously defined here int main() ^ ksort.cpp:88:24: warning: unused variable 'j' [-Wunused-variable] int n, V[1001], i, j, p, b, k; ^ ksort.cpp: In function 'int main()': ksort.cpp:127:5: error: redefinition of 'int main()' int main() ^ ksort.cpp:4:5: error: 'int main()' previously defined here int main() ^ ksort.cpp:129:24: warning: unused variable 'j' [-Wunused-variable] int n, V[1001], i, j, p, b, k; ^ ksort.cpp: In function 'int main()': ksort.cpp:168:5: error: redefinition of 'int main()' int main() ^ ksort.cpp:4:5: error: 'int main()' previously defined here int main() ^ ksort.cpp:170:24: warning: unused variable 'j' [-Wunused-variable] int n, V[1001], i, j, p, b, k; ^ ksort.cpp: In function 'int main()': ksort.cpp:209:5: error: redefinition of 'int main()' int main() ^ ksort.cpp:4:5: error: 'int main()' previously defined here int main() ^ ksort.cpp:211:24: warning: unused variable 'j' [-Wunused-variable] int n, V[1001], i, j, p, b, k; ^ ksort.cpp: In function 'int main()': ksort.cpp:250:5: error: redefinition of 'int main()' int main() ^ ksort.cpp:4:5: error: 'int main()' previously defined here int main() ^ ksort.cpp:252:24: warning: unused variable 'j' [-Wunused-variable] int n, V[1001], i, j, p, b, k; ^ ksort.cpp: In function 'int main()': ksort.cpp:291:5: error: redefinition of 'int main()' int main() ^ ksort.cpp:4:5: error: 'int main()' previously defined here int main() ^ ksort.cpp:293:24: warning: unused variable 'j' [-Wunused-variable] int n, V[1001], i, j, p, b, k; ^ ksort.cpp: In function 'int main()': ksort.cpp:332:5: error: redefinition of 'int main()' int main() ^ ksort.cpp:4:5: error: 'int main()' previously defined here int main() ^ ksort.cpp:334:24: warning: unused variable 'j' [-Wunused-variable] int n, V[1001], i, j, p, b, k; ^ ksort.cpp: In function 'int main()': ksort.cpp:373:5: error: redefinition of 'int main()' int main() ^ ksort.cpp:4:5: error: 'int main()' previously defined here int main() ^ ksort.cpp:375:24: warning: unused variable 'j' [-Wunused-variable] int n, V[1001], i, j, p, b, k; ^ ksort.cpp: In function 'int main()': ksort.cpp:414:5: error: redefinition of 'int main()' int main() ^ ksort.cpp:4:5: error: 'int main()' previously defined here int main() ^ ksort.cpp:416:24: warning: unused variable 'j' [-Wunused-variable] int n, V[1001], i, j, p, b, k; ^
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ă.