Detalii evaluare #50185706

Rezumat problemă

#4061 LantQ

Se dă un graf neorientat cu n vârfuri și un număr natural q. Să se determine toate lanțurile elementare formate din cel puțin o muchie, cu extremitatea finală în vârful q.

Detalii

Problema LantQ Operații I/O lantq.in/lantq.out
Limita timp 0.4 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #50185706 Utilizator Maga Emma (EmmaOana)
Fișier lantq.cpp Dimensiune 1.77 KB
Data încărcării 30 Martie 2024, 12:56 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

lantq.cpp:6:16: warning: missing terminating " character [enabled by default]
 ofstream fout ("lantq.out);

                ^
lantq.cpp:6:1: error: missing terminating " character
 ofstream fout ("lantq.out);

 ^
lantq.cpp:8:8: error: 'v' has not been declared
 int n, v[1001][1001],m,q,sol[1001], t=0,ok=0;

        ^
lantq.cpp:8:22: error: 'm' has not been declared
 int n, v[1001][1001],m,q,sol[1001], t=0,ok=0;

                      ^
lantq.cpp:8:24: error: 'q' has not been declared
 int n, v[1001][1001],m,q,sol[1001], t=0,ok=0;

                        ^
lantq.cpp:8:26: error: 'sol' has not been declared
 int n, v[1001][1001],m,q,sol[1001], t=0,ok=0;

                          ^
lantq.cpp:8:37: error: 't' has not been declared
 int n, v[1001][1001],m,q,sol[1001], t=0,ok=0;

                                     ^
lantq.cpp:8:41: error: 'ok' has not been declared
 int n, v[1001][1001],m,q,sol[1001], t=0,ok=0;

                                         ^
lantq.cpp:8:45: error: expected ')' before ';' token
 int n, v[1001][1001],m,q,sol[1001], t=0,ok=0;

                                             ^
lantq.cpp: In function 'void afisare()':
lantq.cpp:13:5: error: 'ok' was not declared in this scope
     ok =1 ;

     ^
lantq.cpp:14:22: error: 't' was not declared in this scope
     for (int i=1; i<=t; i++)

                      ^
lantq.cpp:16:17: error: 'sol' was not declared in this scope
         fout << sol[i] <<" ";

                 ^
lantq.cpp:19:13: error: invalid operands of types 'std::ofstream(int, int (*)[1001], int, int, int*, int, int) {aka std::basic_ofstream<char>(int, int (*)[1001], int, int, int*, int, int)}' and '<unresolved overloaded function type>' to binary 'operator<<'
     fout << endl;

             ^
lantq.cpp: In function 'bool valid(int, int)':
lantq.cpp:24:21: error: 't' was not declared in this scope
     for (int i=1; i<t; i++)

                     ^
lantq.cpp:28:13: error: 'sol' was not declared in this scope
         if (sol[i] == sol[j])

             ^
lantq.cpp:35:9: error: 'v' was not declared in this scope
     if (v[in][jn] == 0)

         ^
lantq.cpp: In function 'void bk(int)':
lantq.cpp:45:22: error: 'n' was not declared in this scope
     for (int k=1; k<=n; k++)

                      ^
lantq.cpp:50:13: error: 't' was not declared in this scope
             t++;

             ^
lantq.cpp:51:13: error: 'sol' was not declared in this scope
             sol[t] = k;

             ^
lantq.cpp:53:22: error: 'q' was not declared in this scope
             if (k == q)

                      ^
lantq.cpp: In function 'int main()':
lantq.cpp:71:12: error: 'n' was not declared in this scope
     fin >> n >> m;

            ^
lantq.cpp:71:17: error: 'm' was not declared in this scope
     fin >> n >> m;

                 ^
lantq.cpp:79:9: error: 'v' was not declared in this scope
         v[x][y] = 1;

         ^
lantq.cpp:83:12: error: 'q' was not declared in this scope
     fin >> q;

            ^
lantq.cpp:90:16: error: 'v' was not declared in this scope
             if(v[i][j] == 1)

                ^
lantq.cpp:92:17: error: 't' was not declared in this scope
                 t++;

                 ^
lantq.cpp:93:17: error: 'sol' was not declared in this scope
                 sol[t] = i;

                 ^
lantq.cpp:99:21: error: 'ok' was not declared in this scope
                     ok =1;

                     ^
lantq.cpp:100:29: error: invalid operands of types 'std::ofstream(int, int (*)[1001], int, int, int*, int, int) {aka std::basic_ofstream<char>(int, int (*)[1001], int, int, int*, int, int)}' and 'int' to binary 'operator<<'
                     fout << i << " " << j << endl;

                             ^
lantq.cpp:112:9: error: 'ok' was not declared in this scope
     if (ok == 0)

         ^
lantq.cpp:114:17: error: invalid operands of types 'std::ofstream(int, int (*)[1001], int, int, int*, int, int) {aka std::basic_ofstream<char>(int, int (*)[1001], int, int, int*, int, int)}' and 'const char [10]' to binary 'operator<<'
         fout << "NU EXISTA";

                 ^

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