#4265
Se dă un șir v1, v2, …, vn de numere naturale nenule și de asemenea se dau două numere naturale nenule A și B. Să se determine numărul perechilor (vi , vj) cu i < j și A ≤ vi + vj ≤ B.
Folclorul informatic
| Problema | perechiAB | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64487811 | Utilizator | |
| Fișier | perechiab.cpp | Dimensiune | 713 B |
| Data încărcării | 10 Mai 2026, 19:21 | Scor/rezultat | 20 puncte |
perechiab.cpp: In function ‘int main()’: perechiab.cpp:21:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 21 | while(st<=dr&&v[mij]!=val) | ~~~~~~^~~~~ perechiab.cpp:23:10: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 23 | if(v[mij]<val) {st=mij+1;} | ~~~~~~^~~~ perechiab.cpp:24:15: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 24 | else if(v[mij]>val) {dr=mij-1;} | ~~~~~~^~~~ perechiab.cpp:27:10: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 27 | if(v[mij]==val) poz1=mij; | ~~~~~~^~~~~ perechiab.cpp:28:15: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 28 | else if(v[mij]!=val) poz1=st; | ~~~~~~^~~~~ perechiab.cpp:33:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 33 | while(st<=dr&&v[mij]!=val) | ~~~~~~^~~~~ perechiab.cpp:35:10: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 35 | if(v[mij]<val) {st=mij+1;} | ~~~~~~^~~~ perechiab.cpp:36:15: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 36 | else if(v[mij]>val) {dr=mij-1;} | ~~~~~~^~~~ perechiab.cpp:39:10: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 39 | if(v[mij]==val) poz2=mij; | ~~~~~~^~~~~ perechiab.cpp:40:15: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 40 | else if(v[mij]!=val) poz2=dr; | ~~~~~~^~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 0 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 1 | 0.002 secunde | Raspuns gresit. | 10 | 0 | ||
| 2 | 0.014 secunde | Raspuns gresit. | 10 | 0 | ||
| 3 | 0.044 secunde | Raspuns gresit. | 10 | 0 | ||
| 4 | 0.006 secunde | OK. | 10 | 10 | ||
| 5 | 0.068 secunde | Raspuns gresit. | 10 | 0 | ||
| 6 | 0.047 secunde | OK. | 10 | 10 | ||
| 7 | 0.004 secunde | Raspuns gresit. | 10 | 0 | ||
| 8 | 0.036 secunde | Raspuns gresit. | 10 | 0 | ||
| 9 | 0.059 secunde | Raspuns gresit. | 10 | 0 | ||
| Punctaj total | 20 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema perechiAB 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ă.