Detalii evaluare #56878389

Rezumat problemă

ccmax

#4067

Se dă un graf neorientat cu n vârfuri. Determinați numărul maxim de vârfuri dintr-o componentă conexă și numarul de componente conexe care au acest număr maxim de vârfuri.

Detalii

Problema ccmax Operații I/O ccmax.in/ccmax.out
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #56878389 Utilizator Razvan Moraru (RazvanA_fr)
Fișier ccmax.cpp Dimensiune 5.00 KB
Data încărcării 09 Martie 2025, 18:28 Scor / rezultat Eroare de compilare

Evaluare

Mesaj compilare

ccmax.cpp:72:13: error: redefinition of 'std::ifstream fin'
 ifstream fin("nivele.in");

             ^
ccmax.cpp:8:10: error: 'std::ifstream fin' previously declared here
 ifstream fin("dmin.in");

          ^
ccmax.cpp:73:14: error: redefinition of 'std::ofstream fout'
 ofstream fout("nivele.out");

              ^
ccmax.cpp:9:10: error: 'std::ofstream fout' previously declared here
 ofstream fout("dmin.out");

          ^
ccmax.cpp:75:5: error: redefinition of 'int n'
 int n, k, t[101], x;

     ^
ccmax.cpp:11:5: error: 'int n' previously declared here
 int n, m, q;

     ^
ccmax.cpp: In function 'int main()':
ccmax.cpp:88:5: error: redefinition of 'int main()'
 int main()

     ^
ccmax.cpp:42:5: error: 'int main()' previously defined here
 int main()

     ^
ccmax.cpp: At global scope:
ccmax.cpp:112:13: error: redefinition of 'std::ifstream fin'
 ifstream fin("subarborenumarare.in");

             ^
ccmax.cpp:8:10: error: 'std::ifstream fin' previously declared here
 ifstream fin("dmin.in");

          ^
ccmax.cpp:113:14: error: redefinition of 'std::ofstream fout'
 ofstream fout("subarborenumarare.out");

              ^
ccmax.cpp:9:10: error: 'std::ofstream fout' previously declared here
 ofstream fout("dmin.out");

          ^
ccmax.cpp:115:5: error: redefinition of 'int n'
 int n , k , t[105], v[105];

     ^
ccmax.cpp:11:5: error: 'int n' previously declared here
 int n, m, q;

     ^
ccmax.cpp:115:9: error: redefinition of 'int k'
 int n , k , t[105], v[105];

         ^
ccmax.cpp:75:8: error: 'int k' previously declared here
 int n, k, t[101], x;

        ^
ccmax.cpp:115:18: error: conflicting declaration 'int t [105]'
 int n , k , t[105], v[105];

                  ^
ccmax.cpp:75:11: error: 't' has a previous declaration as 'int t [101]'
 int n, k, t[101], x;

           ^
ccmax.cpp: In function 'int main()':
ccmax.cpp:126:5: error: redefinition of 'int main()'
 int main()

     ^
ccmax.cpp:42:5: error: 'int main()' previously defined here
 int main()

     ^
ccmax.cpp: At global scope:
ccmax.cpp:145:14: error: redefinition of 'std::ifstream fin'
 ifstream fin ("knivel.in");

              ^
ccmax.cpp:8:10: error: 'std::ifstream fin' previously declared here
 ifstream fin("dmin.in");

          ^
ccmax.cpp:146:15: error: redefinition of 'std::ofstream fout'
 ofstream fout ("knivel.out");

               ^
ccmax.cpp:9:10: error: 'std::ofstream fout' previously declared here
 ofstream fout("dmin.out");

          ^
ccmax.cpp:149:5: error: redefinition of 'int n'
 int n , k;

     ^
ccmax.cpp:11:5: error: 'int n' previously declared here
 int n, m, q;

     ^
ccmax.cpp:149:9: error: redefinition of 'int k'
 int n , k;

         ^
ccmax.cpp:75:8: error: 'int k' previously declared here
 int n, k, t[101], x;

        ^
ccmax.cpp:150:10: error: redefinition of 'int t [101]'
 int t[101];

          ^
ccmax.cpp:75:11: error: 'int t [101]' previously declared here
 int n, k, t[101], x;

           ^
ccmax.cpp: In function 'int nivel(int)':
ccmax.cpp:152:5: error: redefinition of 'int nivel(int)'
 int nivel(int nod)

     ^
ccmax.cpp:77:5: error: 'int nivel(int)' previously defined here
 int nivel(int nod)

     ^
ccmax.cpp: In function 'int main()':
ccmax.cpp:160:5: error: redefinition of 'int main()'
 int main()

     ^
ccmax.cpp:42:5: error: 'int main()' previously defined here
 int main()

     ^
ccmax.cpp: At global scope:
ccmax.cpp:182:13: error: redefinition of 'std::ifstream fin'
 ifstream fin("drum_hamiltonian.in");

             ^
ccmax.cpp:8:10: error: 'std::ifstream fin' previously declared here
 ifstream fin("dmin.in");

          ^
ccmax.cpp:183:14: error: redefinition of 'std::ofstream fout'
 ofstream fout("drum_hamiltonian.out");

              ^
ccmax.cpp:9:10: error: 'std::ofstream fout' previously declared here
 ofstream fout("dmin.out");

          ^
ccmax.cpp:185:5: error: redefinition of 'int n'
 int n , a[12][12], x[12] , p, gasit = 0;

     ^
ccmax.cpp:11:5: error: 'int n' previously declared here
 int n, m, q;

     ^
ccmax.cpp:185:24: error: conflicting declaration 'int x [12]'
 int n , a[12][12], x[12] , p, gasit = 0;

                        ^
ccmax.cpp:75:19: error: 'x' has a previous declaration as 'int x'
 int n, k, t[101], x;

                   ^
ccmax.cpp: In function 'void afis(int)':
ccmax.cpp:191:20: error: invalid types 'int[int]' for array subscript
         fout << x[i] << " ";

                    ^
ccmax.cpp: In function 'int OK(int)':
ccmax.cpp:198:19: error: invalid types 'int[int]' for array subscript
         if(a[x[k-1]][x[k]] != 1)

                   ^
ccmax.cpp:198:25: error: invalid types 'int[int]' for array subscript
         if(a[x[k-1]][x[k]] != 1)

                         ^
ccmax.cpp:201:16: error: invalid types 'int[int]' for array subscript
         if( x[k] == x[i] )

                ^
ccmax.cpp:201:24: error: invalid types 'int[int]' for array subscript
         if( x[k] == x[i] )

                        ^
ccmax.cpp: In function 'void back(int)':
ccmax.cpp:210:12: error: invalid types 'int[int]' for array subscript
         x[k] = i;

            ^
ccmax.cpp:211:11: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
         if( OK(k) )

           ^
ccmax.cpp: In function 'int main()':
ccmax.cpp:219:5: error: redefinition of 'int main()'
 int main()

     ^
ccmax.cpp:42:5: error: 'int main()' previously defined here
 int main()

     ^
ccmax.cpp: At global scope:
ccmax.cpp:242:14: error: redefinition of 'std::ifstream fin'
 ifstream fin ("euler.in");

              ^
ccmax.cpp:8:10: error: 'std::ifstream fin' previously declared here
 ifstream fin("dmin.in");

          ^
ccmax.cpp:243:14: error: redefinition of 'std::ofstream fout'
 ofstream fout("euler.out");

              ^
ccmax.cpp:9:10: error: 'std::ofstream fout' previously declared here
 ofstream fout("dmin.out");

          ^
ccmax.cpp:245:5: error: redefinition of 'int n'
 int n , a[205][205], L[50000], p;

     ^
ccmax.cpp:11:5: error: 'int n' previously declared here
 int n, m, q;

     ^
ccmax.cpp:245:19: error: conflicting declaration 'int a [205][205]'
 int n , a[205][205], L[50000], p;

                   ^
ccmax.cpp:185:9: error: 'a' has a previous declaration as 'int a [12][12]'
 int n , a[12][12], x[12] , p, gasit = 0;

         ^
ccmax.cpp:245:32: error: redefinition of 'int p'
 int n , a[205][205], L[50000], p;

                                ^
ccmax.cpp:185:28: error: 'int p' previously declared here
 int n , a[12][12], x[12] , p, gasit = 0;

                            ^
ccmax.cpp: In function 'int main()':
ccmax.cpp:258:5: error: redefinition of 'int main()'
 int main()

     ^
ccmax.cpp:42:5: error: 'int main()' previously defined here
 int main()

     ^
ccmax.cpp: At global scope:
ccmax.cpp:286:13: error: redefinition of 'std::ifstream fin'
 ifstream fin("componenteconexe5.in");

             ^
ccmax.cpp:8:10: error: 'std::ifstream fin' previously declared here
 ifstream fin("dmin.in");

          ^
ccmax.cpp:287:14: error: redefinition of 'std::ofstream fout'
 ofstream fout("componenteconexe5.out");

              ^
ccmax.cpp:9:10: error: 'std::ofstream fout' previously declared here
 ofstream fout("dmin.out");

          ^
ccmax.cpp:289:5: error: redefinition of 'int n'
 int n, m;

     ^
ccmax.cpp:11:5: error: 'int n' previously declared here
 int n, m, q;

     ^
ccmax.cpp:289:8: error: redefinition of 'int m'
 int n, m;

        ^
ccmax.cpp:11:8: error: 'int m' previously declared here
 int n, m, q;

        ^
ccmax.cpp:290:17: error: conflicting declaration 'int a [1001][1001]'
 int a[1001][1001];

                 ^
ccmax.cpp:185:9: error: 'a' has a previous declaration as 'int a [12][12]'
 int n , a[12][12], x[12] , p, gasit = 0;

         ^
ccmax.cpp:294:5: error: redefinition of 'int x'
 int x, y;

     ^
ccmax.cpp:75:19: error: 'int x' previously declared here
 int n, k, t[101], x;

                   ^
ccmax.cpp: In function 'int main()':
ccmax.cpp:303:5: error: redefinition of 'int main()'
 int main()

     ^
ccmax.cpp:42:5: error: 'int main()' previously defined here
 int main()

     ^
ccmax.cpp: In function 'int bfs(int, int)':
ccmax.cpp:40: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 ccmax 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ă.

Du-te sus!