#4646
Se dă un șir ordonat crescător a1, a2, …, an de numere întregi. Asupra șirului putem efectua trei tipuri de interogări:
1 x – Câte numere din șir sunt mai mici sau egale decât x?2 x – Câte numere din șir sunt mai strict mai mari decât x?3 x – De câte ori apare în șir valoarea x?Să se răspundă la Q interogări.
Folclorul informatic
| Problema | cb1 | Operații I/O |
cb1.in/cb1.out
|
|---|---|---|---|
| Limita timp | 0.4 secunde | Limita memorie |
Total: 4 MB
/
Stivă 2 MB
|
| Id soluție | #65007322 | Utilizator | |
| Fișier | cb1.cpp | Dimensiune | 817 B |
| Data încărcării | 12 Iulie 2026, 15:05 | Scor/rezultat | 0 puncte |
cb1.cpp: In function ‘int main()’: cb1.cpp:8:26: warning: unused variable ‘x’ [-Wunused-variable] 8 | int n,Q,i,a[50001],j,x,y,z,b[500001][3]; | ^ cb1.cpp:8:28: warning: unused variable ‘y’ [-Wunused-variable] 8 | int n,Q,i,a[50001],j,x,y,z,b[500001][3]; | ^ cb1.cpp:8:30: warning: unused variable ‘z’ [-Wunused-variable] 8 | int n,Q,i,a[50001],j,x,y,z,b[500001][3]; | ^ cb1.cpp:30:24: warning: array subscript 3 is above array bounds of ‘int [3]’ [-Warray-bounds=] 30 | fout<<b[j][3]<<'\n'; | ^~~~ cb1.cpp:8:32: note: while referencing ‘b’ 8 | int n,Q,i,a[50001],j,x,y,z,b[500001][3]; | ^ cb1.cpp:28:35: warning: array subscript 3 is above array bounds of ‘int [3]’ [-Warray-bounds=] 28 | b[j][3]++; | ~~~~~~^ cb1.cpp:8:32: note: while referencing ‘b’ 8 | int n,Q,i,a[50001],j,x,y,z,b[500001][3]; | ^ cb1.cpp:28:35: warning: array subscript 3 is above array bounds of ‘int [3]’ [-Warray-bounds=] 28 | b[j][3]++; | ~~~~~~^ cb1.cpp:8:32: note: while referencing ‘b’ 8 | int n,Q,i,a[50001],j,x,y,z,b[500001][3]; | ^ cb1.cpp:24:31: warning: array subscript 3 is above array bounds of ‘int [3]’ [-Warray-bounds=] 24 | b[j][3]++; | ~~~~~~^ cb1.cpp:8:32: note: while referencing ‘b’ 8 | int n,Q,i,a[50001],j,x,y,z,b[500001][3]; | ^ cb1.cpp:24:31: warning: array subscript 3 is above array bounds of ‘int [3]’ [-Warray-bounds=] 24 | b[j][3]++; | ~~~~~~^ cb1.cpp:8:32: note: while referencing ‘b’ 8 | int n,Q,i,a[50001],j,x,y,z,b[500001][3]; | ^ cb1.cpp:20:27: warning: array subscript 3 is above array bounds of ‘int [3]’ [-Warray-bounds=] 20 | b[j][3]++; | ~~~~~~^ cb1.cpp:8:32: note: while referencing ‘b’ 8 | int n,Q,i,a[50001],j,x,y,z,b[500001][3]; | ^ cb1.cpp:20:27: warning: array subscript 3 is above array bounds of ‘int [3]’ [-Warray-bounds=] 20 | b[j][3]++; | ~~~~~~^ cb1.cpp:8:32: note: while referencing ‘b’ 8 | int n,Q,i,a[50001],j,x,y,z,b[500001][3]; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 0 | 0.004 secunde | Caught fatal signal 11 | 5 | 0 | Exemplu | |
| 1 | 0.01 secunde | Caught fatal signal 11 | 5 | 0 | ||
| 2 | 0.004 secunde | Caught fatal signal 11 | 10 | 0 | ||
| 3 | 0.005 secunde | Caught fatal signal 11 | 10 | 0 | ||
| 4 | 0.004 secunde | Caught fatal signal 11 | 10 | 0 | ||
| 5 | 0.008 secunde | Caught fatal signal 11 | 10 | 0 | ||
| 6 | 0.004 secunde | Caught fatal signal 11 | 10 | 0 | ||
| 7 | 0.004 secunde | Caught fatal signal 11 | 10 | 0 | ||
| 8 | 0.004 secunde | Caught fatal signal 11 | 10 | 0 | ||
| 9 | 0.004 secunde | Caught fatal signal 11 | 10 | 0 | ||
| 10 | 0.005 secunde | Caught fatal signal 11 | 10 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema cb1 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ă.