#2749
tata
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 | #54295307 | Utilizator | |
Fișier | tata.cpp | Dimensiune | 469 B |
Data încărcării | 25 Noiembrie 2024, 09:32 | Scor / rezultat | Eroare de compilare |
tata.cpp: In function 'int main()': tata.cpp:9:5: error: 'fin' was not declared in this scope fin>>n; ^ tata.cpp:12:11: error: 'cin' was not declared in this scope cin>>t[i]; ^ tata.cpp:12:11: note: suggested alternative: In file included from tata.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: 'std::cin' extern istream cin; /// Linked to standard input ^ tata.cpp:15:16: error: 'cout' was not declared in this scope if(rad==0) cout<<"NU"; ^ tata.cpp:15:16: note: suggested alternative: In file included from tata.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ tata.cpp:21:21: error: 'cout' was not declared in this scope cout<<"NU",i=n+1,j=n+1,ok=0; ^ tata.cpp:21:21: note: suggested alternative: In file included from tata.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ tata.cpp:23:13: error: 'cout' was not declared in this scope cout<<"DA"; ^ tata.cpp:23:13: note: suggested alternative: In file included from tata.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: 'std::cout' extern ostream cout; /// Linked to standard output ^ tata.cpp:8:19: warning: unused variable 'p' [-Wunused-variable] int rad=0,i,j,p=0,k,x,ok=1; ^ tata.cpp:8:23: warning: unused variable 'k' [-Wunused-variable] int rad=0,i,j,p=0,k,x,ok=1; ^ tata.cpp:8:25: warning: unused variable 'x' [-Wunused-variable] int rad=0,i,j,p=0,k,x,ok=1; ^
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ă.