#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 | #50429037 | Utilizator | |
Fișier | cb.cpp | Dimensiune | 1.05 KB |
Data încărcării | 09 Aprilie 2024, 11:34 | Scor / rezultat | Eroare de compilare |
cb.cpp:3:10: warning: ISO C99 requires whitespace after the macro name [enabled by default] #define M=200000 ^ cb.cpp:3:10: error: expected primary-expression before '=' token #define M=200000 ^ cb.cpp:5:7: note: in expansion of macro 'M' int v[M]; ^ cb.cpp: In function 'int cbs(int)': cb.cpp:9:10: error: 'v' was not declared in this scope if(x>v[n]) ^ cb.cpp:9:12: error: 'n' was not declared in this scope if(x>v[n]) ^ cb.cpp:11:10: error: 'v' was not declared in this scope if(x<v[1]) ^ cb.cpp:14:12: error: 'n' was not declared in this scope dr=n; ^ cb.cpp:18:19: error: 'v' was not declared in this scope if(x<=v[mij]) ^ cb.cpp: In function 'int cbd(int)': cb.cpp:30:11: error: 'v' was not declared in this scope if(x>=v[n]) ^ cb.cpp:30:13: error: 'n' was not declared in this scope if(x>=v[n]) ^ cb.cpp:32:10: error: 'v' was not declared in this scope if(x<v[1]) ^ cb.cpp:34:8: error: 'n' was not declared in this scope dr=n; ^ cb.cpp:39:15: error: 'v' was not declared in this scope if(x>=v[mij]) ^ cb.cpp: In function 'int main()': cb.cpp:53:14: error: 'v' was not declared in this scope cin>>v[i]; ^ cb.cpp:54:10: error: 'v' was not declared in this scope sort(v+1,v+n+1); ^
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ă.