#4356
Se dă un vector cu n elemente numere naturale. Folosind metoda Divide et Impera să se verifice dacă are elementele ordonate strict crescător sau strict descrescător.
| Problema | OrdonatDivImp | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64427683 | Utilizator | |
| Fișier | ordonatdivimp.cpp | Dimensiune | 788 B |
| Data încărcării | 06 Mai 2026, 12:50 | Scor/rezultat | Eroare de compilare |
ordonatdivimp.cpp: In function ‘int crescator(int, int)’: ordonatdivimp.cpp:12:9: error: expected ‘,’ or ‘;’ before ‘int’ 12 | int c1=crescator(st,m); | ^~~ ordonatdivimp.cpp:14:16: error: ‘c1’ was not declared in this scope; did you mean ‘c2’? 14 | return c1&&c2&&v[m]<v[m+1]; | ^~ | c2 ordonatdivimp.cpp:17:1: error: a function-definition is not allowed here before ‘{’ token 17 | { | ^ ordonatdivimp.cpp:28:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 28 | int main() | ^~ ordonatdivimp.cpp:28:9: note: remove parentheses to default-initialize a variable 28 | int main() | ^~ | -- ordonatdivimp.cpp:28:9: note: or replace parentheses with braces to value-initialize a variable ordonatdivimp.cpp:29:1: error: a function-definition is not allowed here before ‘{’ token 29 | { | ^ ordonatdivimp.cpp:40:2: error: expected ‘}’ at end of input 40 | } | ^ ordonatdivimp.cpp:6:1: note: to match this ‘{’ 6 | { | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema OrdonatDivImp 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ă.