Detalii evaluare #29577082

Rezumat problemă

Se dă vectorul de tați al unui arbore cu rădăcină cu n noduri și doua noduri p q. Determinați drumul elementar de la nodul p la nodul q.

Detalii

Problema DetDrum2 Operații I/O detdrum2.in/detdrum2.out
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #29577082 Utilizator Nicolae Tudor (N1Tudor)
Fișier detdrum2.cpp Dimensiune 1.92 KB
Data încărcării 10 Mai 2021, 14:53 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

detdrum2.cpp:54:2: error: stray '#' in program
 }#include <fstream>

  ^
detdrum2.cpp: In function 'int main()':
detdrum2.cpp:46:9: warning: unused variable 'u2' [-Wunused-variable]
     int u2, x;

         ^
detdrum2.cpp: At global scope:
detdrum2.cpp:54:3: error: 'include' does not name a type
 }#include <fstream>

   ^
detdrum2.cpp:58:12: error: redefinition of 'std::ifstream in'
 ifstream in("detdrum2.in");

            ^
detdrum2.cpp:5:10: error: 'std::ifstream in' previously declared here
 ifstream in("detdrum2.in");

          ^
detdrum2.cpp:59:13: error: redefinition of 'std::ofstream out'
 ofstream out("detdrum2.out");

             ^
detdrum2.cpp:6:10: error: 'std::ofstream out' previously declared here
 ofstream out("detdrum2.out");

          ^
detdrum2.cpp:60:15: error: redefinition of 'int a [101][101]'
 int a[101][101],viz[101],n,m,x,y,p,q,prec[101];

               ^
detdrum2.cpp:7:5: error: 'int a [101][101]' previously declared here
 int a[101][101],viz[101],n,m,x,y,p,q,prec[101];

     ^
detdrum2.cpp:60:24: error: redefinition of 'int viz [101]'
 int a[101][101],viz[101],n,m,x,y,p,q,prec[101];

                        ^
detdrum2.cpp:7:17: error: 'int viz [101]' previously declared here
 int a[101][101],viz[101],n,m,x,y,p,q,prec[101];

                 ^
detdrum2.cpp:60:26: error: redefinition of 'int n'
 int a[101][101],viz[101],n,m,x,y,p,q,prec[101];

                          ^
detdrum2.cpp:7:26: error: 'int n' previously declared here
 int a[101][101],viz[101],n,m,x,y,p,q,prec[101];

                          ^
detdrum2.cpp:60:28: error: redefinition of 'int m'
 int a[101][101],viz[101],n,m,x,y,p,q,prec[101];

                            ^
detdrum2.cpp:7:28: error: 'int m' previously declared here
 int a[101][101],viz[101],n,m,x,y,p,q,prec[101];

                            ^
detdrum2.cpp:60:30: error: redefinition of 'int x'
 int a[101][101],viz[101],n,m,x,y,p,q,prec[101];

                              ^
detdrum2.cpp:7:30: error: 'int x' previously declared here
 int a[101][101],viz[101],n,m,x,y,p,q,prec[101];

                              ^
detdrum2.cpp:60:32: error: redefinition of 'int y'
 int a[101][101],viz[101],n,m,x,y,p,q,prec[101];

                                ^
detdrum2.cpp:7:32: error: 'int y' previously declared here
 int a[101][101],viz[101],n,m,x,y,p,q,prec[101];

                                ^
detdrum2.cpp:60:34: error: redefinition of 'int p'
 int a[101][101],viz[101],n,m,x,y,p,q,prec[101];

                                  ^
detdrum2.cpp:7:34: error: 'int p' previously declared here
 int a[101][101],viz[101],n,m,x,y,p,q,prec[101];

                                  ^
detdrum2.cpp:60:36: error: redefinition of 'int q'
 int a[101][101],viz[101],n,m,x,y,p,q,prec[101];

                                    ^
detdrum2.cpp:7:36: error: 'int q' previously declared here
 int a[101][101],viz[101],n,m,x,y,p,q,prec[101];

                                    ^
detdrum2.cpp:60:46: error: redefinition of 'int prec [101]'
 int a[101][101],viz[101],n,m,x,y,p,q,prec[101];

                                              ^
detdrum2.cpp:7:38: error: 'int prec [101]' previously declared here
 int a[101][101],viz[101],n,m,x,y,p,q,prec[101];

                                      ^
detdrum2.cpp: In function 'int bfs(int, int)':
detdrum2.cpp:61:5: error: redefinition of 'int bfs(int, int)'
 int bfs(int nodp, int nodq)

     ^
detdrum2.cpp:8:5: error: 'int bfs(int, int)' previously defined here
 int bfs(int nodp, int nodq)

     ^
detdrum2.cpp: In function 'void drum(int)':
detdrum2.cpp:88:6: error: redefinition of 'void drum(int)'
 void drum(int nod)

      ^
detdrum2.cpp:35:6: error: 'void drum(int)' previously defined here
 void drum(int nod)

      ^
detdrum2.cpp: In function 'int main()':
detdrum2.cpp:97:5: error: redefinition of 'int main()'
 int main()

     ^
detdrum2.cpp:44:5: error: 'int main()' previously defined here
 int main()

     ^
detdrum2.cpp:99:9: warning: unused variable 'u2' [-Wunused-variable]
     int u2, x;

         ^
detdrum2.cpp: In function 'int bfs(int, int)':
detdrum2.cpp:34:1: warning: control reaches end of non-void function [-Wreturn-type]
 }

 ^
detdrum2.cpp: In function 'int bfs(int, int)':
detdrum2.cpp:87:1: warning: control reaches end of non-void function [-Wreturn-type]
 }

 ^

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema DetDrum2 face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

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ă.