#4825
HeavyLightDecomposition
Se dă un arbore cu \(N\) noduri înrădăcinat în nodul \(1\), unde fiecare nod are un pondere asociat întreg \(V_i\). Să se proceseze \(Q\) evenimente de următoarele \(3\) tipuri:
Problema | HeavyLightDecomposition | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.8 secunde | Limita memorie |
Total: 128 MB
/
Stivă 128 MB
|
Id soluție | #57925967 | Utilizator | |
Fișier | heavylightdecomposition.cpp | Dimensiune | 5.78 KB |
Data încărcării | 02 Mai 2025, 10:27 | Scor / rezultat | 100 puncte |
heavylightdecomposition.cpp: In member function 'void Ainttt::update(int, int, int, int, int)': heavylightdecomposition.cpp:40:18: warning: suggest parentheses around '+' inside '>>' [-Wparentheses] int mj = st+dr >> 1; ^ heavylightdecomposition.cpp: In member function 'int Ainttt::query(int, int, int, int, int)': heavylightdecomposition.cpp:49:31: warning: suggest parentheses around '+' inside '>>' [-Wparentheses] int q = INT_MAX, mj = st+dr >> 1; ^ heavylightdecomposition.cpp: In function 'void build_enivrq()': heavylightdecomposition.cpp:107:57: warning: suggest parentheses around '-' inside '<<' [-Wparentheses] int a = enivrq[j-1][i], b = enivrq[j-1][i+(1<<j-1)]; ^ heavylightdecomposition.cpp: In function 'void ezsolve()': heavylightdecomposition.cpp:184:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int idxlant = 0; idxlant < lanturi.size(); ++idxlant) ^ heavylightdecomposition.cpp:187:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i < lanturi[idxlant].size(); ++i) ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0.012 secunde | OK. | 5 | 5 | ||
2 | 0.028 secunde | OK. | 5 | 5 | ||
3 | 0.044 secunde | OK. | 5 | 5 | ||
4 | 0.064 secunde | OK. | 5 | 5 | ||
5 | 0.08 secunde | OK. | 5 | 5 | ||
6 | 0.096 secunde | OK. | 5 | 5 | ||
7 | 0.128 secunde | OK. | 5 | 5 | ||
8 | 0.16 secunde | OK. | 5 | 5 | ||
9 | 0.164 secunde | OK. | 5 | 5 | ||
10 | 0.168 secunde | OK. | 5 | 5 | ||
11 | 0.212 secunde | OK. | 5 | 5 | ||
12 | 0.236 secunde | OK. | 5 | 5 | ||
13 | 0.284 secunde | OK. | 5 | 5 | ||
14 | 0.252 secunde | OK. | 5 | 5 | ||
15 | 0.292 secunde | OK. | 5 | 5 | ||
16 | 0.352 secunde | OK. | 5 | 5 | ||
17 | 0.308 secunde | OK. | 5 | 5 | ||
18 | 0.364 secunde | OK. | 5 | 5 | ||
19 | 0.428 secunde | OK. | 5 | 5 | ||
20 | 0.452 secunde | OK. | 5 | 5 | ||
Punctaj total | 100 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema HeavyLightDecomposition 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ă.