Detalii evaluare #63768898

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 drumurilor 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 #63768898 Utilizator Ursescu Maria (maria46918)
Fișier roy-floyd.cpp Dimensiune 1.34 KB
Data încărcării 18 Martie 2026, 11:28 Scor/rezultat Eroare de compilare

Evaluare

Mesaj compilare

roy-floyd.cpp:27:2: error: stray '#' in program
 }#include <iostream>

  ^
roy-floyd.cpp:27:3: error: 'include' does not name a type
 }#include <iostream>

   ^
In file included from /usr/include/c++/4.8/fstream:936:0,
                 from roy-floyd.cpp:28:
/usr/include/c++/4.8/bits/fstream.tcc: In member function 'virtual std::basic_filebuf<_CharT, _Traits>::int_type std::basic_filebuf<_CharT, _Traits>::underflow()':
/usr/include/c++/4.8/bits/fstream.tcc:232:4: error: incomplete type 'std::codecvt_base' used in nested name specifier
    codecvt_base::result __r = codecvt_base::ok;
    ^
/usr/include/c++/4.8/bits/fstream.tcc:232:25: error: expected ';' before '__r'
    codecvt_base::result __r = codecvt_base::ok;
                         ^
/usr/include/c++/4.8/bits/fstream.tcc:304:7: error: '__r' was not declared in this scope
       __r = _M_codecvt->in(_M_state_cur, _M_ext_next,
       ^
/usr/include/c++/4.8/bits/fstream.tcc:308:9: error: '__r' was not declared in this scope
     if (__r == codecvt_base::noconv)
         ^
/usr/include/c++/4.8/bits/fstream.tcc:308:16: error: incomplete type 'std::codecvt_base' used in nested name specifier
     if (__r == codecvt_base::noconv)
                ^
/usr/include/c++/4.8/bits/fstream.tcc:323:9: error: '__r' was not declared in this scope
     if (__r == codecvt_base::error)
         ^
/usr/include/c++/4.8/bits/fstream.tcc:323:16: error: incomplete type 'std::codecvt_base' used in nested name specifier
     if (__r == codecvt_base::error)
                ^
/usr/include/c++/4.8/bits/fstream.tcc:346:12: error: '__r' was not declared in this scope
        if (__r == codecvt_base::partial)
            ^
/usr/include/c++/4.8/bits/fstream.tcc:346:19: error: incomplete type 'std::codecvt_base' used in nested name specifier
        if (__r == codecvt_base::partial)
                   ^
/usr/include/c++/4.8/bits/fstream.tcc:350:13: error: '__r' was not declared in this scope
    else if (__r == codecvt_base::error)
             ^
/usr/include/c++/4.8/bits/fstream.tcc:350:20: error: incomplete type 'std::codecvt_base' used in nested name specifier
    else if (__r == codecvt_base::error)
                    ^
/usr/include/c++/4.8/bits/fstream.tcc: In member function 'bool std::basic_filebuf<_CharT, _Traits>::_M_convert_to_external(_CharT*, std::streamsize)':
/usr/include/c++/4.8/bits/fstream.tcc:505:4: error: incomplete type 'std::codecvt_base' used in nested name specifier
    codecvt_base::result __r;
    ^
/usr/include/c++/4.8/bits/fstream.tcc:505:25: error: expected ';' before '__r'
    codecvt_base::result __r;
                         ^
/usr/include/c++/4.8/bits/fstream.tcc:506:4: error: '__r' was not declared in this scope
    __r = _M_codecvt->out(_M_state_cur, __ibuf, __ibuf + __ilen,
    ^
/usr/include/c++/4.8/bits/fstream.tcc:509:15: error: incomplete type 'std::codecvt_base' used in nested name specifier
    if (__r == codecvt_base::ok || __r == codecvt_base::partial)
               ^
/usr/include/c++/4.8/bits/fstream.tcc:509:42: error: incomplete type 'std::codecvt_base' used in nested name specifier
    if (__r == codecvt_base::ok || __r == codecvt_base::partial)
                                          ^
/usr/include/c++/4.8/bits/fstream.tcc:511:20: error: incomplete type 'std::codecvt_base' used in nested name specifier
    else if (__r == codecvt_base::noconv)
                    ^
/usr/include/c++/4.8/bits/fstream.tcc:525:15: error: incomplete type 'std::codecvt_base' used in nested name specifier
    if (__r == codecvt_base::partial && __elen == __plen)
               ^
/usr/include/c++/4.8/bits/fstream.tcc:532:19: error: incomplete type 'std::codecvt_base' used in nested name specifier
        if (__r != codecvt_base::error)
                   ^
/usr/include/c++/4.8/bits/fstream.tcc: In member function 'bool std::basic_filebuf<_CharT, _Traits>::_M_terminate_output()':
/usr/include/c++/4.8/bits/fstream.tcc:852:4: error: incomplete type 'std::codecvt_base' used in nested name specifier
    codecvt_base::result __r;
    ^
/usr/include/c++/4.8/bits/fstream.tcc:852:25: error: expected ';' before '__r'
    codecvt_base::result __r;
                         ^
/usr/include/c++/4.8/bits/fstream.tcc:858:8: error: '__r' was not declared in this scope
        __r = _M_codecvt->unshift(_M_state_cur, __buf,
        ^
/usr/include/c++/4.8/bits/fstream.tcc:860:19: error: incomplete type 'std::codecvt_base' used in nested name specifier
        if (__r == codecvt_base::error)
                   ^
/usr/include/c++/4.8/bits/fstream.tcc:862:24: error: incomplete type 'std::codecvt_base' used in nested name specifier
        else if (__r == codecvt_base::ok ||
                        ^
/usr/include/c++/4.8/bits/fstream.tcc:863:17: error: incomplete type 'std::codecvt_base' used in nested name specifier
          __r == codecvt_base::partial)
                 ^
/usr/include/c++/4.8/bits/fstream.tcc:874:11: error: '__r' was not declared in this scope
    while (__r == codecvt_base::partial && __ilen > 0 && __testvalid);
           ^
/usr/include/c++/4.8/bits/fstream.tcc:874:18: error: incomplete type 'std::codecvt_base' used in nested name specifier
    while (__r == codecvt_base::partial && __ilen > 0 && __testvalid);
                  ^
roy-floyd.cpp: At global scope:
roy-floyd.cpp:33:5: error: redefinition of 'int n'
 int n , a[105][105];

     ^
roy-floyd.cpp:3:5: error: 'int n' previously declared here
 int n,a[105][105];

     ^
roy-floyd.cpp:33:19: error: redefinition of 'int a [105][105]'
 int n , a[105][105];

                   ^
roy-floyd.cpp:3:7: error: 'int a [105][105]' previously declared here
 int n,a[105][105];

       ^
roy-floyd.cpp: In function 'int main()':
roy-floyd.cpp:34:5: error: redefinition of 'int main()'
 int main()

     ^
roy-floyd.cpp:4: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 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ă.

Du-te sus!