#676
CountPrimSub
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 | #53435473 | Utilizator | |
Fișier | countprimsub.cpp | Dimensiune | 1.22 KB |
Data încărcării | 30 Octombrie 2024, 14:09 | Scor / rezultat | Eroare de compilare |
countprimsub.cpp:8:13: error: 'NN' was not declared in this scope int n, info[NN], st[NN], dr[NN]; ^ countprimsub.cpp:8:21: error: 'NN' was not declared in this scope int n, info[NN], st[NN], dr[NN]; ^ countprimsub.cpp:8:29: error: 'NN' was not declared in this scope int n, info[NN], st[NN], dr[NN]; ^ countprimsub.cpp: In function 'void citire()': countprimsub.cpp:14:16: error: 'info' was not declared in this scope fin >> info[i] >> st[i] >> dr[i]; ^ countprimsub.cpp:14:27: error: 'st' was not declared in this scope fin >> info[i] >> st[i] >> dr[i]; ^ countprimsub.cpp:14:36: error: 'dr' was not declared in this scope fin >> info[i] >> st[i] >> dr[i]; ^ countprimsub.cpp: In function 'int radacina()': countprimsub.cpp:19:11: error: 'NN' was not declared in this scope int v[NN]; ^ countprimsub.cpp:21:9: error: 'v' was not declared in this scope v[i] = 0; ^ countprimsub.cpp:24:12: error: 'st' was not declared in this scope if(st[i] != 0) ^ countprimsub.cpp:25:13: error: 'v' was not declared in this scope v[st[i]] = 1; ^ countprimsub.cpp:26:12: error: 'dr' was not declared in this scope if(dr[i] != 0) ^ countprimsub.cpp:27:13: error: 'v' was not declared in this scope v[dr[i]] = 1; ^ countprimsub.cpp:30:12: error: 'v' was not declared in this scope if(v[i] == 0) ^ countprimsub.cpp: In function 'int count(int)': countprimsub.cpp:50:17: error: 'info' was not declared in this scope if(prim(info[x])) ^ countprimsub.cpp:51:30: error: 'st' was not declared in this scope return 1 + count(st[x]) + count(dr[x]); ^ countprimsub.cpp:51:45: error: 'dr' was not declared in this scope return 1 + count(st[x]) + count(dr[x]); ^ countprimsub.cpp:53:26: error: 'st' was not declared in this scope return count(st[x]) + count(dr[x]); ^ countprimsub.cpp:53:41: error: 'dr' was not declared in this scope return count(st[x]) + count(dr[x]); ^ countprimsub.cpp:56:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
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ă.