#183
sortPP
Să se ordoneze crescător elementele pătrat perfect ale unui şir dat, fără a afecta elementele care nu sunt pătrat perfect.
Problema | sortPP | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54138746 | Utilizator | |
Fișier | sortpp.cpp | Dimensiune | 1.23 KB |
Data încărcării | 20 Noiembrie 2024, 16:59 | Scor / rezultat | Eroare de compilare |
sortpp.cpp:9:1: error: stray '\304' in program bool estePătratPerfect(int x) { ^ sortpp.cpp:9:1: error: stray '\203' in program sortpp.cpp:26:5: error: stray '\304' in program vector<int> pătratePerfecte; ^ sortpp.cpp:26:5: error: stray '\203' in program sortpp.cpp:30:9: error: stray '\304' in program if (estePătratPerfect(v[i])) { ^ sortpp.cpp:30:9: error: stray '\203' in program sortpp.cpp:31:13: error: stray '\304' in program pătratePerfecte.push_back(v[i]); ^ sortpp.cpp:31:13: error: stray '\203' in program sortpp.cpp:36:5: error: stray '\304' in program sort(pătratePerfecte.begin(), pătratePerfecte.end()); ^ sortpp.cpp:36:5: error: stray '\203' in program sortpp.cpp:36:5: error: stray '\304' in program sortpp.cpp:36:5: error: stray '\203' in program sortpp.cpp:43:9: error: stray '\304' in program if (estePătratPerfect(v[i])) { ^ sortpp.cpp:43:9: error: stray '\203' in program sortpp.cpp:44:13: error: stray '\304' in program v[i] = pătratePerfecte[idx++]; ^ sortpp.cpp:44:13: error: stray '\203' in program sortpp.cpp:9:13: error: expected initializer before 'tratPerfect' bool estePătratPerfect(int x) { ^ sortpp.cpp: In function 'int main()': sortpp.cpp:26:20: error: expected initializer before 'tratePerfecte' vector<int> pătratePerfecte; ^ sortpp.cpp:30:13: error: 'esteP' was not declared in this scope if (estePătratPerfect(v[i])) { ^ sortpp.cpp:30:20: error: expected ')' before 'tratPerfect' if (estePătratPerfect(v[i])) { ^ sortpp.cpp:31:13: error: 'p' was not declared in this scope pătratePerfecte.push_back(v[i]); ^ sortpp.cpp:31:16: error: expected ';' before 'tratePerfecte' pătratePerfecte.push_back(v[i]); ^ sortpp.cpp:36:10: error: 'p' was not declared in this scope sort(pătratePerfecte.begin(), pătratePerfecte.end()); ^ sortpp.cpp:36:39: error: expected ')' before 'tratePerfecte' sort(pătratePerfecte.begin(), pătratePerfecte.end()); ^ sortpp.cpp:43:13: error: 'esteP' was not declared in this scope if (estePătratPerfect(v[i])) { ^ sortpp.cpp:43:20: error: expected ')' before 'tratPerfect' if (estePătratPerfect(v[i])) { ^ sortpp.cpp:44:23: error: expected ';' before 'tratePerfecte' v[i] = pătratePerfecte[idx++]; ^ sortpp.cpp:39:9: warning: unused variable 'idx' [-Wunused-variable] int idx = 0; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema sortPP 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ă.