#1148
ExistaImpareDivImp
Se dă un şir cu n
elemente, numere naturale. Folosind metoda Divide et Impera să se verifice dacă în şir există elemente impare.
Problema | ExistaImpareDivImp | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50147096 | Utilizator | |
Fișier | existaimparedivimp.cpp | Dimensiune | 477 B |
Data încărcării | 28 Martie 2024, 17:14 | Scor / rezultat | Eroare de compilare |
existaimparedivimp.cpp: In function 'int exista(int*, int, int)': existaimparedivimp.cpp:15:28: error: invalid conversion from 'int' to 'int*' [-fpermissive] return exista(st, m) || exista(m+1, dr); ^ existaimparedivimp.cpp:15:28: error: too few arguments to function 'int exista(int*, int, int)' existaimparedivimp.cpp:5:5: note: declared here int exista(int v[1001],int st, int dr) ^ existaimparedivimp.cpp:15:41: error: invalid conversion from 'int' to 'int*' [-fpermissive] return exista(st, m) || exista(m+1, dr); ^ existaimparedivimp.cpp:15:47: error: too few arguments to function 'int exista(int*, int, int)' return exista(st, m) || exista(m+1, dr); ^ existaimparedivimp.cpp:5:5: note: declared here int exista(int v[1001],int st, int dr) ^ existaimparedivimp.cpp: In function 'int main()': existaimparedivimp.cpp:24:21: error: invalid conversion from 'int' to 'int*' [-fpermissive] if(exista(1, n-1)==1) ^ existaimparedivimp.cpp:24:21: error: too few arguments to function 'int exista(int*, int, int)' existaimparedivimp.cpp:5:5: note: declared here int exista(int v[1001],int st, int dr) ^ existaimparedivimp.cpp: In function 'int exista(int*, int, int)': existaimparedivimp.cpp:17:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ExistaImpareDivImp 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ă.