#2276
cb
Se consideră un șir a[1]
, a[2]
, …, a[n]
de numere naturale. Se dau și T
intervale închise de forma [x, y]
, cu x ≤ y
. Pentru fiecare din cele T
intervale de forma [x, y]
trebuie să răspundeți la întrebarea: câte numere din șir aparțin intervalului [x, y]
?
-
Problema | cb | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #27323966 | Utilizator | |
Fișier | cb.cpp | Dimensiune | 1.05 KB |
Data încărcării | 18 Ianuarie 2021, 15:38 | Scor / rezultat | Eroare de compilare |
cb.cpp: In function 'int mini(int)': cb.cpp:11:12: error: 'l' was not declared in this scope while (l <= r) ^ cb.cpp:11:17: error: 'r' was not declared in this scope while (l <= r) ^ cb.cpp:14:15: error: 'm' was not declared in this scope if (v[m] >=x) ^ cb.cpp:9:10: warning: unused variable 'st' [-Wunused-variable] int st= 0, dr= n - 1, mij; ^ cb.cpp:9:17: warning: unused variable 'dr' [-Wunused-variable] int st= 0, dr= n - 1, mij; ^ cb.cpp: In function 'int maxi(int)': cb.cpp:29:12: error: 'l' was not declared in this scope while (l <= r) ^ cb.cpp:29:17: error: 'r' was not declared in this scope while (l <= r) ^ cb.cpp:31:9: error: 'm' was not declared in this scope m = (l + r) / 2; ^ cb.cpp:27:10: warning: unused variable 'st' [-Wunused-variable] int st= 0, dr= n - 1, mij; ^ cb.cpp:27:17: warning: unused variable 'dr' [-Wunused-variable] int st= 0, dr= n - 1, mij; ^ cb.cpp: In function 'int main()': cb.cpp:49:10: error: 'a' was not declared in this scope sort(a, a + n); ^ cb.cpp:49:18: error: 'sort' was not declared in this scope sort(a, a + n); ^ cb.cpp:57:13: error: 'p1' was not declared in this scope if (p1 == -1) ^ cb.cpp:60:21: error: 'p2' was not declared in this scope cout << p2 - p1 + 1 << '\n'; ^ cb.cpp:55:13: warning: unused variable 'poz2' [-Wunused-variable] int poz2 = maxi(y); ^ cb.cpp:56:13: warning: unused variable 'poz1' [-Wunused-variable] int poz1 = mini(x); ^ cb.cpp:50:15: warning: unused variable 'cnt' [-Wunused-variable] int x, y, cnt; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema cb 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ă.