#511
KSort
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 | #54427984 | Utilizator | |
Fișier | ksort.cpp | Dimensiune | 1.17 KB |
Data încărcării | 28 Noiembrie 2024, 10:20 | Scor / rezultat | Eroare de compilare |
ksort.cpp:1:2: error: invalid digit "9" in octal constant [09:33, 11/28/2024] Nati 🧸💌 Optimus prime: #include <iostream> ^ ksort.cpp:1:1: error: stray '\360' in program [09:33, 11/28/2024] Nati 🧸💌 Optimus prime: #include <iostream> ^ ksort.cpp:1:1: error: stray '\237' in program ksort.cpp:1:1: error: stray '\247' in program ksort.cpp:1:1: error: stray '\270' in program ksort.cpp:1:1: error: stray '\360' in program ksort.cpp:1:1: error: stray '\237' in program ksort.cpp:1:1: error: stray '\222' in program ksort.cpp:1:1: error: stray '\214' in program ksort.cpp:1:50: error: stray '#' in program [09:33, 11/28/2024] Nati 🧸💌 Optimus prime: #include <iostream> ^ ksort.cpp:34:1: error: stray '\360' in program [10:11, 11/28/2024] Nati 🧸💌 Optimus prime: #include <iostream> ^ ksort.cpp:34:1: error: stray '\237' in program ksort.cpp:34:1: error: stray '\247' in program ksort.cpp:34:1: error: stray '\270' in program ksort.cpp:34:1: error: stray '\360' in program ksort.cpp:34:1: error: stray '\237' in program ksort.cpp:34:1: error: stray '\222' in program ksort.cpp:34:1: error: stray '\214' in program ksort.cpp:34:50: error: stray '#' in program [10:11, 11/28/2024] Nati 🧸💌 Optimus prime: #include <iostream> ^ ksort.cpp:1:1: error: expected unqualified-id before '[' token [09:33, 11/28/2024] Nati 🧸💌 Optimus prime: #include <iostream> ^ ksort.cpp: In function 'int main()': ksort.cpp:8:5: error: 'cin' was not declared in this scope cin>>n; ^ ksort.cpp:19:34: error: 'swap' was not declared in this scope { swap (v[i],v[i+1]); ^ ksort.cpp:27:13: error: 'cout' was not declared in this scope cout<<v[i]<<" "; ^ ksort.cpp:32:5: error: 'cout' was not declared in this scope cout<<"NU EXISTA"; ^ ksort.cpp: At global scope: ksort.cpp:34:1: error: expected unqualified-id before '[' token [10:11, 11/28/2024] Nati 🧸💌 Optimus prime: #include <iostream> ^ ksort.cpp: In function 'int main()': ksort.cpp:38:5: error: redefinition of 'int main()' int main() ^ ksort.cpp:5:5: error: 'int main()' previously defined here int main() ^ ksort.cpp:41:5: error: 'cin' was not declared in this scope cin>>n>>k; ^ ksort.cpp:53:27: error: 'swap' was not declared in this scope swap (v[i], v[i+1]); ^ ksort.cpp:64:26: error: 'swap' was not declared in this scope swap(v[i], v[i+1]); ^ ksort.cpp:71:9: error: 'cout' was not declared in this scope cout<<v[i]<<" "; ^
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ă.