#2749
Se dă un vector t=(t[1], t[2], ..., t[n]) care memorează numere naturale cuprinse între 0 și n. Să se verifice dacă t este sau nu vector de tați asociat unui arbore cu rădăcină.
| Problema | tata | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 32 MB
|
| Id soluție | #64105545 | Utilizator | |
| Fișier | tata.cpp | Dimensiune | 1.44 KB |
| Data încărcării | 17 Aprilie 2026, 10:21 | Scor/rezultat | 70 puncte |
tata.cpp: In function ‘int main()’: tata.cpp:82:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 82 | for(int i=1;i<=n;i++) | ^~~ tata.cpp:85:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 85 | tati[0]=-1; | ^~~~ tata.cpp:78:9: warning: unused variable ‘m’ [-Wunused-variable] 78 | int m,c,p,d[1001]={0},f[1001]={0},q,w,b,s=0,t=1,k,x; | ^ tata.cpp:78:11: warning: unused variable ‘c’ [-Wunused-variable] 78 | int m,c,p,d[1001]={0},f[1001]={0},q,w,b,s=0,t=1,k,x; | ^ tata.cpp:78:13: warning: unused variable ‘p’ [-Wunused-variable] 78 | int m,c,p,d[1001]={0},f[1001]={0},q,w,b,s=0,t=1,k,x; | ^ tata.cpp:78:15: warning: unused variable ‘d’ [-Wunused-variable] 78 | int m,c,p,d[1001]={0},f[1001]={0},q,w,b,s=0,t=1,k,x; | ^ tata.cpp:78:27: warning: unused variable ‘f’ [-Wunused-variable] 78 | int m,c,p,d[1001]={0},f[1001]={0},q,w,b,s=0,t=1,k,x; | ^ tata.cpp:78:39: warning: unused variable ‘q’ [-Wunused-variable] 78 | int m,c,p,d[1001]={0},f[1001]={0},q,w,b,s=0,t=1,k,x; | ^ tata.cpp:78:41: warning: unused variable ‘w’ [-Wunused-variable] 78 | int m,c,p,d[1001]={0},f[1001]={0},q,w,b,s=0,t=1,k,x; | ^ tata.cpp:78:43: warning: unused variable ‘b’ [-Wunused-variable] 78 | int m,c,p,d[1001]={0},f[1001]={0},q,w,b,s=0,t=1,k,x; | ^ tata.cpp:78:53: warning: unused variable ‘k’ [-Wunused-variable] 78 | int m,c,p,d[1001]={0},f[1001]={0},q,w,b,s=0,t=1,k,x; | ^ tata.cpp:78:55: warning: unused variable ‘x’ [-Wunused-variable] 78 | int m,c,p,d[1001]={0},f[1001]={0},q,w,b,s=0,t=1,k,x; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 10 | 10 | ||
| 2 | 0.002 secunde | OK. | 10 | 10 | ||
| 3 | 0.002 secunde | Raspuns gresit. | 10 | 0 | ||
| 4 | 0.002 secunde | OK. | 10 | 10 | ||
| 5 | 0.002 secunde | OK. | 10 | 10 | ||
| 6 | 0.016 secunde | Raspuns gresit. | 10 | 0 | ||
| 7 | 0.019 secunde | OK. | 10 | 10 | ||
| 8 | 0.031 secunde | Raspuns gresit. | 10 | 0 | ||
| 9 | 0.022 secunde | OK. | 10 | 10 | ||
| 10 | 0.033 secunde | OK. | 10 | 10 | ||
| Punctaj total | 70 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema tata 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ă.