Detalii evaluare #20586187

Rezumat problemă

Se dă un graf orientat ponderat cu n noduri și m arce – în care fiecare arc are asociat un cost, număr natural strict pozitiv. Folosind algoritmul Roy-Floyd, construiți matricea costurilor minime.

Detalii

Problema Roy-Floyd Operații I/O roy-floyd.in/roy-floyd.out
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #20586187 Utilizator Stanica Vlad (vladandrei123)
Fișier roy-floyd.cpp Dimensiune 1.25 KB
Data încărcării 04 Februarie 2020, 12:42 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

roy-floyd.cpp:4:1: error: expected ',' or ';' before 'ofstream'
 ofstream cout("roy-floyd.out" )

 ^
roy-floyd.cpp: In function 'int main()':
roy-floyd.cpp:9:10: error: 'n' was not declared in this scope
     cin>>n>>m;

          ^
roy-floyd.cpp:9:13: error: 'm' was not declared in this scope
     cin>>n>>m;

             ^
roy-floyd.cpp:10:9: error: 'i' was not declared in this scope
     for(i=1; i<=n; i++)

         ^
roy-floyd.cpp:12:13: error: 'j' was not declared in this scope
         for(j=1; j<=n; j++)

             ^
roy-floyd.cpp:14:13: error: 'C' was not declared in this scope
             C[i][j]=2000;

             ^
roy-floyd.cpp:18:9: error: 'i' was not declared in this scope
     for(i=1; i<=n; i++)

         ^
roy-floyd.cpp:20:9: error: 'C' was not declared in this scope
         C[i][i]=0;

         ^
roy-floyd.cpp:22:9: error: 'i' was not declared in this scope
     for(i=1; i<=m; i++)

         ^
roy-floyd.cpp:24:14: error: 'x' was not declared in this scope
         cin>>x>>y>>cost;

              ^
roy-floyd.cpp:24:17: error: 'y' was not declared in this scope
         cin>>x>>y>>cost;

                 ^
roy-floyd.cpp:24:20: error: 'cost' was not declared in this scope
         cin>>x>>y>>cost;

                    ^
roy-floyd.cpp:25:9: error: 'C' was not declared in this scope
         C[x][y]=cost;

         ^
roy-floyd.cpp:28:9: error: 'i' was not declared in this scope
     for(i=1; i<=n; i++)

         ^
roy-floyd.cpp:30:13: error: 'j' was not declared in this scope
         for(j=1; j<=n; j++)

             ^
roy-floyd.cpp:32:13: error: 'D' was not declared in this scope
             D[i][j]=C[i][j];

             ^
roy-floyd.cpp:32:21: error: 'C' was not declared in this scope
             D[i][j]=C[i][j];

                     ^
roy-floyd.cpp:37:9: error: 'k' was not declared in this scope
     for(k=1; k<=n; k++)

         ^
roy-floyd.cpp:39:13: error: 'i' was not declared in this scope
         for(i=1; i<=n; i++)

             ^
roy-floyd.cpp:41:17: error: 'j' was not declared in this scope
             for(j=1; j<=n; j++)

                 ^
roy-floyd.cpp:43:20: error: 'D' was not declared in this scope
                 if(D[i][k]+D[k][j]<D[i][j])

                    ^
roy-floyd.cpp:52:9: error: 'i' was not declared in this scope
     for(i=1;i<=n;i++)

         ^
roy-floyd.cpp:54:13: error: 'j' was not declared in this scope
         for(j=1;j<=n;j++)

             ^
roy-floyd.cpp:56:20: error: 'D' was not declared in this scope
                 if(D[i][j]==2000)

                    ^
roy-floyd.cpp:58:25: error: 'cout' was not declared in this scope
                         cout<<"-1"<<" ";

                         ^
roy-floyd.cpp:63:25: error: 'cout' was not declared in this scope
                         cout<<D[i][j]<<" ";

                         ^
roy-floyd.cpp:67:13: error: 'cout' was not declared in this scope
             cout<<"\n";

             ^
roy-floyd.cpp:70:5: error: 'cout' was not declared in this scope
     cout.close();

     ^

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