#676
Se dă un arbore binar care conține valori numere naturale. Se dau k
noduri din arbore și se cere determinarea, pentru fiecare nod, a numărului de noduri din subarborele cu rădăcina în acel nod care conțin valori prime.
Problema | CountPrimSub | Operații I/O |
![]() countprimsub.in /countprimsub.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #57752666 | Utilizator | |
Fișier | countprimsub.cpp | Dimensiune | 1.06 KB |
Data încărcării | 14 Aprilie 2025, 13:46 | Scor / rezultat | 20 puncte |
countprimsub.cpp: In function 'int rsd(int)': countprimsub.cpp:28:7: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(st[k]!=0 && dr[k]!=0) ^ countprimsub.cpp:33:7: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(st[k]==0 && dr[k]!=0 ) ^ countprimsub.cpp:39:7: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(st[k]!=0 && dr[k]==0 ) ^ countprimsub.cpp: In function 'int main()': countprimsub.cpp:50:9: warning: unused variable 'rad' [-Wunused-variable] int rad, s1, s2, x, k; ^ countprimsub.cpp:50:14: warning: unused variable 's1' [-Wunused-variable] int rad, s1, s2, x, k; ^ countprimsub.cpp:50:18: warning: unused variable 's2' [-Wunused-variable] int rad, s1, s2, x, k; ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | OK. | 20 | 20 | Exemplu | |
2 | 0 secunde | Raspuns gresit. | 40 | 0 | ||
3 | 0.004 secunde | Raspuns gresit. | 40 | 0 | ||
Punctaj total | 20 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CountPrimSub 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ă.