#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 | #53821640 | Utilizator | |
Fișier | countprimsub.cpp | Dimensiune | 1.20 KB |
Data încărcării | 12 Noiembrie 2024, 14:38 | Scor / rezultat | Eroare de compilare |
countprimsub.cpp:9:13: error: 'NN' was not declared in this scope int n, info[NN], st[NN], dr[NN]; ^ countprimsub.cpp:9:21: error: 'NN' was not declared in this scope int n, info[NN], st[NN], dr[NN]; ^ countprimsub.cpp:9: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:15:16: error: 'info' was not declared in this scope fin >> info[i] >> st[i] >> dr[i]; ^ countprimsub.cpp:15:27: error: 'st' was not declared in this scope fin >> info[i] >> st[i] >> dr[i]; ^ countprimsub.cpp:15:36: error: 'dr' was not declared in this scope fin >> info[i] >> st[i] >> dr[i]; ^ countprimsub.cpp: In function 'int radacina()': countprimsub.cpp:20:11: error: 'NN' was not declared in this scope int v[NN]; ^ countprimsub.cpp:22:9: error: 'v' was not declared in this scope v[i] = 0; ^ countprimsub.cpp:25:12: error: 'st' was not declared in this scope if(st[i] != 0) ^ countprimsub.cpp:26:13: error: 'v' was not declared in this scope v[st[i]] = 1; ^ countprimsub.cpp:27:12: error: 'dr' was not declared in this scope if(dr[i] != 0) ^ countprimsub.cpp:28:13: error: 'v' was not declared in this scope v[dr[i]] = 1; ^ countprimsub.cpp:31:12: error: 'v' was not declared in this scope if(v[i] == 0) ^ countprimsub.cpp: At global scope: countprimsub.cpp:36:1: error: expected unqualified-id before '{' token { ^ 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:50:24: error: 'prim' 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ă.