#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 | #48361127 | Utilizator | |
Fișier | easyxy.cpp | Dimensiune | 1.59 KB |
Data încărcării | 23 Ianuarie 2024, 09:51 | Scor / rezultat | Eroare de compilare |
easyxy.cpp: In constructor 'vertex::vertex(uint32_t)': easyxy.cpp:5:52: error: class 'vertex' does not have any field named 'S' vertex(uint32_t val) : l(nullptr), r(nullptr), S(val){} ^ easyxy.cpp: In constructor 'vertex::vertex(vertex*, vertex*)': easyxy.cpp:6:48: error: class 'vertex' does not have any field named 'S' vertex(vertex* l, vertex* r) : l(l), r(r), S(0) { ^ easyxy.cpp:8:13: error: 'S' was not declared in this scope S += l -> sum; ^ easyxy.cpp:8:23: error: 'struct vertex' has no member named 'sum' S += l -> sum; ^ easyxy.cpp:10:13: error: 'S' was not declared in this scope S += r -> sum; ^ easyxy.cpp:10:23: error: 'struct vertex' has no member named 'sum' S += r -> sum; ^ easyxy.cpp: In function 'vertex* update(vertex*, uint32_t, uint32_t&, uint32_t&)': easyxy.cpp:21:35: error: 'struct vertex' has no member named 'S' return new vertex(node -> S + 1); ^ easyxy.cpp: In function 'uint32_t find_kth(vertex*, vertex*, uint32_t, uint32_t, uint32_t)': easyxy.cpp:30:59: error: 'struct vertex' has no member named 'S' uint32_t mid = (l + r) >> 1, leftCnt = (nodeR -> l -> S) - (nodeL -> l > S); ^ easyxy.cpp:30:78: error: 'S' was not declared in this scope uint32_t mid = (l + r) >> 1, leftCnt = (nodeR -> l -> S) - (nodeL -> l > S); ^ easyxy.cpp: In function 'int main()': easyxy.cpp:40:35: error: invalid initialization of non-const reference of type 'uint32_t& {aka unsigned int&}' from an rvalue of type 'uint32_t {aka unsigned int}' roots.emplace_back(build(y, n + 1)); ^ easyxy.cpp:13:9: error: in passing argument 2 of 'vertex* build(uint32_t, uint32_t&)' vertex* build(uint32_t l, uint32_t &r) { ^ easyxy.cpp:43:54: error: invalid initialization of non-const reference of type 'uint32_t& {aka unsigned int&}' from an rvalue of type 'uint32_t {aka unsigned int}' roots.emplace_back(update(roots.back(), y, n + 1, val)); ^ easyxy.cpp:19:9: error: in passing argument 3 of 'vertex* update(vertex*, uint32_t, uint32_t&, uint32_t&)' vertex* update(vertex* node, uint32_t l, uint32_t &r, uint32_t &pos) { ^ easyxy.cpp:48:44: error: invalid conversion from 'uint32_t {aka unsigned int}' to 'vertex*' [-fpermissive] fout << find_kth(roots.back(), x, y); ^ easyxy.cpp:48:44: error: too few arguments to function 'uint32_t find_kth(vertex*, vertex*, uint32_t, uint32_t, uint32_t)' easyxy.cpp:27:10: note: declared here uint32_t find_kth(vertex* nodeL, vertex* nodeR, uint32_t l, uint32_t r, uint32_t k) { ^
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ă.