#1155
CautareBinara
Se dă un vector x
cu n
elemente numere naturale, ordonate crescător, și un vector y
cu m
elemente, de asemenea numere naturale. Verificați pentru fiecare element al vectorului y
dacă apare în x
.
Problema | CautareBinara | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54774498 | Utilizator | |
Fișier | cautarebinara.cpp | Dimensiune | 1.21 KB |
Data încărcării | 08 Decembrie 2024, 13:48 | Scor / rezultat | Eroare de compilare |
cautarebinara.cpp: In function 'bool cautbin(int*, int*, int, int, int, int)': cautarebinara.cpp:27:19: warning: left operand of comma operator has no effect [-Wunused-value] return(x, y, mij1 + 1, dr1, st2, dr2); ^ cautarebinara.cpp:27:29: warning: right operand of comma operator has no effect [-Wunused-value] return(x, y, mij1 + 1, dr1, st2, dr2); ^ cautarebinara.cpp:27:27: warning: right operand of comma operator has no effect [-Wunused-value] return(x, y, mij1 + 1, dr1, st2, dr2); ^ cautarebinara.cpp:27:37: warning: right operand of comma operator has no effect [-Wunused-value] return(x, y, mij1 + 1, dr1, st2, dr2); ^ cautarebinara.cpp:27:42: warning: right operand of comma operator has no effect [-Wunused-value] return(x, y, mij1 + 1, dr1, st2, dr2); ^ cautarebinara.cpp:29:19: warning: left operand of comma operator has no effect [-Wunused-value] return(x, y, st1, dr1, mij2 + 1, dr2); ^ cautarebinara.cpp:29:22: warning: right operand of comma operator has no effect [-Wunused-value] return(x, y, st1, dr1, mij2 + 1, dr2); ^ cautarebinara.cpp:29:27: warning: right operand of comma operator has no effect [-Wunused-value] return(x, y, st1, dr1, mij2 + 1, dr2); ^ cautarebinara.cpp:29:39: warning: right operand of comma operator has no effect [-Wunused-value] return(x, y, st1, dr1, mij2 + 1, dr2); ^ cautarebinara.cpp:29:37: warning: right operand of comma operator has no effect [-Wunused-value] return(x, y, st1, dr1, mij2 + 1, dr2); ^ cautarebinara.cpp:31:19: warning: left operand of comma operator has no effect [-Wunused-value] return(x, y, mij1 + 1, dr1, st2, dr2); ^ cautarebinara.cpp:31:29: warning: right operand of comma operator has no effect [-Wunused-value] return(x, y, mij1 + 1, dr1, st2, dr2); ^ cautarebinara.cpp:31:27: warning: right operand of comma operator has no effect [-Wunused-value] return(x, y, mij1 + 1, dr1, st2, dr2); ^ cautarebinara.cpp:31:37: warning: right operand of comma operator has no effect [-Wunused-value] return(x, y, mij1 + 1, dr1, st2, dr2); ^ cautarebinara.cpp:31:42: warning: right operand of comma operator has no effect [-Wunused-value] return(x, y, mij1 + 1, dr1, st2, dr2); ^ cautarebinara.cpp:33:19: warning: left operand of comma operator has no effect [-Wunused-value] return(x, y, st1, dr1, mij2 + 1, dr2); ^ cautarebinara.cpp:33:22: warning: right operand of comma operator has no effect [-Wunused-value] return(x, y, st1, dr1, mij2 + 1, dr2); ^ cautarebinara.cpp:33:27: warning: right operand of comma operator has no effect [-Wunused-value] return(x, y, st1, dr1, mij2 + 1, dr2); ^ cautarebinara.cpp:33:39: warning: right operand of comma operator has no effect [-Wunused-value] return(x, y, st1, dr1, mij2 + 1, dr2); ^ cautarebinara.cpp:33:37: warning: right operand of comma operator has no effect [-Wunused-value] return(x, y, st1, dr1, mij2 + 1, dr2); ^ cautarebinara.cpp: In function 'int main()': cautarebinara.cpp:43:5: error: expected ';' before 'for' for(i = 2; i <= n; i++) ^ cautarebinara.cpp:43:18: warning: statement has no effect [-Wunused-value] for(i = 2; i <= n; i++) ^ cautarebinara.cpp:43:27: error: expected ';' before ')' token for(i = 2; i <= n; i++) ^ cautarebinara.cpp: In function 'bool cautbin(int*, int*, int, int, int, int)': cautarebinara.cpp:35:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CautareBinara 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ă.