#1870
easyxy
Se dă un vector v
cu N
elemente numere naturale numerotate de la 1
la N
și M
întrebări de forma:
x y p
: se afișează valoarea ce s-ar afla pe poziția p
dacă v[x...y]
ar fi ordonat crescător.Problema | easyxy | Operații I/O |
![]() easyxy.in /easyxy.out
|
---|---|---|---|
Limita timp | 1.75 secunde | Limita memorie |
Total: 20 MB
/
Stivă 8 MB
|
Id soluție | #58248657 | Utilizator | |
Fișier | easyxy.cpp | Dimensiune | 2.81 KB |
Data încărcării | 22 Mai 2025, 11:01 | Scor / rezultat | Eroare de compilare |
easyxy.cpp:15:18: warning: overflow in implicit constant conversion [-Woverflow] const int nmax = 1e6, qmax = 1e6; ^ easyxy.cpp:15:30: warning: overflow in implicit constant conversion [-Woverflow] const int nmax = 1e6, qmax = 1e6; ^ easyxy.cpp:16:23: error: size of array 'a' is not an integral constant-expression int n, nrq, a[nmax + 2], actually[nmax + 2]; ^ easyxy.cpp:16:43: error: size of array 'actually' is not an integral constant-expression int n, nrq, a[nmax + 2], actually[nmax + 2]; ^ easyxy.cpp:17:18: error: size of array 'norm' is not an integral constant-expression pii norm[nmax + 2]; int value = 0, lf, rg, k; ^ easyxy.cpp:18:17: error: size of array 'ans' is not an integral constant-expression int ans[qmax + 2], blocks; ^ easyxy.cpp:22:30: error: array bound is not an integer constant before ']' token int buckets[maxblocks + 2], freq[nmax + 2], kval; ^ easyxy.cpp:22:46: error: size of array 'freq' is not an integral constant-expression int buckets[maxblocks + 2], freq[nmax + 2], kval; ^ easyxy.cpp: In member function 'void batog::add(short int, short int)': easyxy.cpp:30:9: error: 'buckets' was not declared in this scope buckets[getblock(value)] += sign; ^ easyxy.cpp: In member function 'short int batog::query(short int)': easyxy.cpp:36:26: error: 'buckets' was not declared in this scope if(smaller - buckets[b] > 0){ ^ easyxy.cpp: At global scope: easyxy.cpp:60:19: error: size of array 'queries' is not an integral constant-expression } queries[qmax + 2]; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema easyxy 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ă.