Detalii evaluare #20427201

Rezumat problemă

Se dă lista muchiilor unui graf neorientat. Să se afișeze componentele conexe ale acestui graf.

Detalii

Problema ComponenteConexe Operații I/O componenteconexe.in/componenteconexe.out
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #20427201 Utilizator Licurici Ionel-Cristian (LicuriciCristian)
Fișier componenteconexe.cpp Dimensiune 2.13 KB
Data încărcării 30 Ianuarie 2020, 08:19 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

componenteconexe.cpp:43:11: error: redefinition of 'std::ifstream f'
 ifstream f("componenteconexe.in");

           ^
componenteconexe.cpp:4:10: error: 'std::ifstream f' previously declared here
 ifstream f("componenteconexe.in");

          ^
componenteconexe.cpp:44:11: error: redefinition of 'std::ofstream g'
 ofstream g("componenteconexe.out");

           ^
componenteconexe.cpp:5:10: error: 'std::ofstream g' previously declared here
 ofstream g("componenteconexe.out");

          ^
componenteconexe.cpp:45:15: error: redefinition of 'int a [101][101]'
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

               ^
componenteconexe.cpp:6:5: error: 'int a [101][101]' previously declared here
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

     ^
componenteconexe.cpp:45:17: error: redefinition of 'int n'
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                 ^
componenteconexe.cpp:6:17: error: 'int n' previously declared here
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                 ^
componenteconexe.cpp:45:19: error: redefinition of 'int i'
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                   ^
componenteconexe.cpp:6:19: error: 'int i' previously declared here
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                   ^
componenteconexe.cpp:45:21: error: redefinition of 'int j'
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                     ^
componenteconexe.cpp:6:21: error: 'int j' previously declared here
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                     ^
componenteconexe.cpp:45:28: error: redefinition of 'int v [101]'
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                            ^
componenteconexe.cpp:6:23: error: 'int v [101]' previously declared here
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                       ^
componenteconexe.cpp:45:35: error: redefinition of 'int m [101]'
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                                   ^
componenteconexe.cpp:6:30: error: 'int m [101]' previously declared here
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                              ^
componenteconexe.cpp:45:37: error: redefinition of 'int l'
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                                     ^
componenteconexe.cpp:6:37: error: 'int l' previously defined here
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                                     ^
componenteconexe.cpp:45:41: error: redefinition of 'int nrc'
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                                         ^
componenteconexe.cpp:6:41: error: 'int nrc' previously defined here
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                                         ^
componenteconexe.cpp: In function 'void dfs(int)':
componenteconexe.cpp:46:6: error: redefinition of 'void dfs(int)'
 void dfs(int k)

      ^
componenteconexe.cpp:7:6: error: 'void dfs(int)' previously defined here
 void dfs(int k)

      ^
componenteconexe.cpp: In function 'int main()':
componenteconexe.cpp:53:5: error: redefinition of 'int main()'
 int main()

     ^
componenteconexe.cpp:14:5: error: 'int main()' previously defined here
 int main()

     ^
componenteconexe.cpp: At global scope:
componenteconexe.cpp:82:11: error: redefinition of 'std::ifstream f'
 ifstream f("componenteconexe.in");

           ^
componenteconexe.cpp:4:10: error: 'std::ifstream f' previously declared here
 ifstream f("componenteconexe.in");

          ^
componenteconexe.cpp:83:11: error: redefinition of 'std::ofstream g'
 ofstream g("componenteconexe.out");

           ^
componenteconexe.cpp:5:10: error: 'std::ofstream g' previously declared here
 ofstream g("componenteconexe.out");

          ^
componenteconexe.cpp:84:15: error: redefinition of 'int a [101][101]'
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

               ^
componenteconexe.cpp:6:5: error: 'int a [101][101]' previously declared here
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

     ^
componenteconexe.cpp:84:17: error: redefinition of 'int n'
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                 ^
componenteconexe.cpp:6:17: error: 'int n' previously declared here
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                 ^
componenteconexe.cpp:84:19: error: redefinition of 'int i'
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                   ^
componenteconexe.cpp:6:19: error: 'int i' previously declared here
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                   ^
componenteconexe.cpp:84:21: error: redefinition of 'int j'
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                     ^
componenteconexe.cpp:6:21: error: 'int j' previously declared here
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                     ^
componenteconexe.cpp:84:28: error: redefinition of 'int v [101]'
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                            ^
componenteconexe.cpp:6:23: error: 'int v [101]' previously declared here
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                       ^
componenteconexe.cpp:84:35: error: redefinition of 'int m [101]'
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                                   ^
componenteconexe.cpp:6:30: error: 'int m [101]' previously declared here
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                              ^
componenteconexe.cpp:84:37: error: redefinition of 'int l'
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                                     ^
componenteconexe.cpp:6:37: error: 'int l' previously defined here
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                                     ^
componenteconexe.cpp:84:41: error: redefinition of 'int nrc'
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                                         ^
componenteconexe.cpp:6:41: error: 'int nrc' previously defined here
 int a[101][101],n,i,j,v[101],m[101],l=1,nrc=0;

                                         ^
componenteconexe.cpp: In function 'void dfs(int)':
componenteconexe.cpp:85:6: error: redefinition of 'void dfs(int)'
 void dfs(int k)

      ^
componenteconexe.cpp:7:6: error: 'void dfs(int)' previously defined here
 void dfs(int k)

      ^
componenteconexe.cpp: In function 'int main()':
componenteconexe.cpp:92:5: error: redefinition of 'int main()'
 int main()

     ^
componenteconexe.cpp:14:5: error: 'int main()' previously defined here
 int main()

     ^

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