#3600
numbers_tree
Se dă un șir a
de n
numere naturale nenule strict mai mari decât 1
, indexat de la 1
. Asupra acestui șir se aplică 3
tipuri de operații:
1 st dr val
– toate valorile a[i]
cu i
din intervalul [st, dr]
devin egale cu val
;2 st dr
– se cere să se afle câte elemente ale șirului a
care au indicii aflați în intervalul [st, dr]
sunt numere compuse(un număr natural este compus dacă are cel puțin 3
divizori);3 st dr
– se cere să se afișeze lungimea cele mai lungi secvențe de numere prime alcătuită exclusiv din elemente ale șirului care au indicii aflați în intervalul [st, dr]
(o secvență a unui șir este alcătuită din elemente aflate poziții consecutive).Dându-se Q
operații, să se raspundă în ordine la cele de tip 2
și 3
.
Problema | numbers_tree | Operații I/O |
![]() numbers_tree.in /numbers_tree.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 8 MB
/
Stivă 4 MB
|
Id soluție | #57818402 | Utilizator | |
Fișier | numbers_tree.cpp | Dimensiune | 6.15 KB |
Data încărcării | 21 Aprilie 2025, 18:10 | Scor / rezultat | Eroare de compilare |
numbers_tree.cpp:163:2: error: no matching function for call to 'SegmentTree::SegmentTree()' }st; ^ numbers_tree.cpp:163:2: note: candidates are: numbers_tree.cpp:144:5: note: SegmentTree::SegmentTree(int) SegmentTree(int n) { ^ numbers_tree.cpp:144:5: note: candidate expects 1 argument, 0 provided numbers_tree.cpp:31:7: note: SegmentTree::SegmentTree(const SegmentTree&) class SegmentTree { ^ numbers_tree.cpp:31:7: note: candidate expects 1 argument, 0 provided numbers_tree.cpp:31:7: note: SegmentTree::SegmentTree(SegmentTree&&) numbers_tree.cpp:31:7: note: candidate expects 1 argument, 0 provided numbers_tree.cpp: In function 'int main()': numbers_tree.cpp:185:16: error: request for member 'update' in 'st', which is of non-class type 'int' st.update(st, dr, val); ^ numbers_tree.cpp:191:21: error: request for member 'queryCompCount' in 'st', which is of non-class type 'int' g << st.queryCompCount(st, dr) << '\n'; ^ numbers_tree.cpp:197:21: error: request for member 'queryPrimeSeq' in 'st', which is of non-class type 'int' g << st.queryPrimeSeq(st, dr) << '\n'; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema numbers_tree 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ă.